1
0
mirror of https://github.com/git/git.git synced 2024-10-20 14:39:10 +02:00
Commit Graph

18708 Commits

Author SHA1 Message Date
Junio C Hamano
bbc0995792 Merge branch 'da/mergetool-lib'
* da/mergetool-lib:
  mergetool--lib: specialize diff options for emerge and ecmerge
2009-05-23 01:41:51 -07:00
Junio C Hamano
d34f715853 Merge branch 'cc/bisect' (early part)
* 'cc/bisect' (early part):
  bisect: make "git bisect" use new "--next-all" bisect-helper function
  bisect: add "check_good_are_ancestors_of_bad" function
  bisect: implement the "check_merge_bases" function
  bisect: automatically sort sha1_array if needed when looking it up
  bisect: make skipped array functions more generic
  bisect: remove too much function nesting
  bisect: use new "struct argv_array" to prepare argv for "setup_revisions"
  bisect: store good revisions in a "sha1_array"
  bisect: implement "rev_argv_push" to fill an argv with revs
  bisect: use "sha1_array" to store skipped revisions
  am: simplify "sq" function by using "git rev-parse --sq-quote"
  bisect: use "git rev-parse --sq-quote" instead of a custom "sq" function
  rev-parse: add --sq-quote to shell quote arguments
  rev-list: remove stringed output flag from "show_bisect_vars"
  bisect--helper: remove "--next-vars" option as it is now useless
  bisect: use "git bisect--helper --next-exit" in "git-bisect.sh"
  bisect--helper: add "--next-exit" to output bisect results
  bisect: move common bisect functionality to "bisect_common"
  rev-list: refactor printing bisect vars
  rev-list: make "estimate_bisect_steps" non static
2009-05-23 01:41:27 -07:00
Junio C Hamano
3ed24211d4 Merge branch 'lt/maint-diff-reduce-lstat'
* lt/maint-diff-reduce-lstat:
  Teach 'git checkout' to preload the index contents
  Avoid unnecessary 'lstat()' calls in 'get_stat_data()'
2009-05-23 01:40:33 -07:00
Junio C Hamano
5781e80ffd Merge branch 'jm/format-patch-no-auto-n-when-k-is-given'
* jm/format-patch-no-auto-n-when-k-is-given:
  format-patch let -k override a config-specified format.numbered
2009-05-23 01:40:22 -07:00
Junio C Hamano
d32643c0ff Merge branch 'do/maint-merge-recursive-fix'
* do/maint-merge-recursive-fix:
  merge-recursive: never leave index unmerged while recursing
2009-05-23 01:39:50 -07:00
Junio C Hamano
e05aae684d Merge branch 'rr/forbid-bs-in-ref'
* rr/forbid-bs-in-ref:
  Disallow '\' in ref names
2009-05-23 01:39:45 -07:00
Junio C Hamano
5eb3d94553 Merge branch 'hv/sample-update'
* hv/sample-update:
  Extend sample update hook, disable modifying of existing tags
2009-05-23 01:39:15 -07:00
Junio C Hamano
2beba6beb0 Merge branch 'jk/maint-1.6.0-trace-argv'
* jk/maint-1.6.0-trace-argv:
  fix GIT_TRACE segfault with shell-quoted aliases

Conflicts:
	alias.c
2009-05-23 01:39:08 -07:00
Junio C Hamano
15d29dde04 Merge branch 'jk/no-no-no-empty-directory'
* jk/no-no-no-empty-directory:
  parseopt: add OPT_NEGBIT
2009-05-23 01:38:35 -07:00
Junio C Hamano
104d379448 Merge branch 'rs/grep-parseopt'
* rs/grep-parseopt:
  grep: make callback functions static
  grep: use parseopt
  grep: remove global variable builtin_grep
  parseopt: add PARSE_OPT_NODASH
  parseopt: add OPT_NUMBER_CALLBACK
  parseopt: add OPT_NEGBIT
2009-05-23 01:38:32 -07:00
Junio C Hamano
9d764f9538 Merge branch 'fl/git-pm'
* fl/git-pm:
  Git.pm: Always set Repository to absolute path if autodetecting
  Git.pm: Set GIT_WORK_TREE if we set GIT_DIR
2009-05-23 01:38:28 -07:00
Junio C Hamano
77ce907786 Merge branch 'mt/submodule-reference'
* mt/submodule-reference:
  Add --reference option to git submodule.
2009-05-23 01:38:24 -07:00
Jakub Narebski
14afe77486 gitweb: Sanitize title attribute in format_subject_html
Replace control characters with question mark '?' (like in
chop_and_esc_str).

A little background: some web browsers turn on strict (and
unforgiving) XML validating mode for XHTML documents served using
application/xhtml+xml content type.  This means among others that
control characters are forbidden to appear in gitweb output.

CGI.pm does by default slight escaping (using simple_escape subroutine
from CGI::Util) of all _attribute_ values (depending on the value of
autoEscape, by default on).  This escaping, at least in CGI.pm version
3.10 (most current version at CPAN is 3.43), is minimal: only '"',
'&', '<' and '>' are escaped using named HTML entity references
(&quot;, &amp;, &lt; and &gt; respectively).  But simple_escape does
not do escaping of control characters such as ^X which are invalid in
XHTML (in strict mode).

If by some accident commit message do contain some control character
in first 50 characters (more or less) of first line of commit message,
and this line is longer than 50 characters (so gitweb shortens it for
display), then gitweb would put this control character in title
attribute (and CGI.pm would not remove them).  The tag _contents_ is
safe because it is escaped using esc_html() explicitly, and it
replaces control characters by their printable representation.

While at it: chop_and_escape_str doesn't need capturing group.

Noticed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-22 09:26:54 -07:00
Nguyễn Thái Ngọc Duy
a80aad7b85 Terminate argv with NULL before calling setup_revisions()
It is convention that argv should be terminated with NULL, even if
argc is used to specify the size of argv. setup_revisions() requires
this and may segfault otherwise.

This patch makes sure that all argv (that I can find) is NULL terminated.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-21 08:56:24 -07:00
Nguyễn Thái Ngọc Duy
06f391906a doc/git-rebase.txt: remove mention of multiple strategies
git-rebase.sh does not seem to support this.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-21 07:33:23 -07:00
Junio C Hamano
581412cb02 Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
  git-svn: add --authors-prog option
  git-svn: Set svn.authorsfile if it is passed to git svn clone
  git-svn: Correctly report max revision when following deleted paths
  git-svn: Fix for svn paths removed > log-window-size revisions ago
  git-svn testsuite: use standard configuration for Subversion tools
2009-05-21 07:28:07 -07:00
Eric W. Biederman
fe87c92138 git-send-email: Handle quotes when parsing .mailrc files
It is legal and not uncommon to use quotes in a .mailrc file so
you can include a persons fullname as well as their email alias.
Handle this by using quotewords instead of split when parsing
.mailrc files.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-21 07:08:58 -07:00
Mark Lodato
36db1eddf9 git-svn: add --authors-prog option
Add a new option, --authors-prog, to git-svn that allows a more flexible
alternative (or supplement) to --authors-file.  This allows more
advanced username operations than the authors file will allow.  For
example, one may look up Subversion users via LDAP, or may generate the
name and email address from the Subversion username.

Notes:

* If both --authors-name and --authors-prog are given, the former is
  tried first, falling back to the later.

* The program is called once per unique SVN username, and the result is
  cached.

* The command-line argument must be the path to a program, not a generic
  shell command line.  The absolute path to this program is taken at
  startup since the git-svn script changes directory during operation.

* The option is not enabled for `git svn log'.

[ew: fixed case where neither --authors-(name|prog) were defined]
Signed-off-by: Mark Lodato <lodatom@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-05-21 00:56:18 -07:00
Alex Vandiver
42a5da1806 git-svn: Set svn.authorsfile if it is passed to git svn clone
Signed-off-by: Alex Vandiver <alexmv@mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-05-21 00:31:08 -07:00
Alex Vandiver
b6c61778d4 git-svn: Correctly report max revision when following deleted paths
Report the maximum found revision in the range, instead of the minimum
changed revision.

Signed-off-by: Alex Vandiver <alexmv@mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-05-21 00:31:08 -07:00
Alex Vandiver
c69700fe04 git-svn: Fix for svn paths removed > log-window-size revisions ago
Instead of trying to find the end of the commit history only in the
last window, track if we have seen commits yet, and use that to judge
if we need to backtrack and look for a tail.  Otherwise, conversion
can silently lose up to 100 revisions of a branch if it was deleted
>100 revisions ago.

Signed-off-by: Alex Vandiver <alexmv@mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-05-21 00:31:08 -07:00
Eygene Ryabinkin
da083d688e git-svn testsuite: use standard configuration for Subversion tools
I have tweaked configuration in my ~/.subversion directory, namely I am
running auto-properties and automatically adding '$Id$' expansion to
every file.  This choke the last test named 'proplist' from
t9101-git-svn-props.sh, because one more property, svn:keywords is
automatically added.

I had just wrapped svn invocation with the svn_cmd that specifies empty
directory via --config-dir argument.  Since the latter is the global
option, it should be recognized by all svn subcommands, so no
regressions will be introduced.

Now svn_cmd is used everywhere, not just in the failed test module: this
should guard us from the future clashes with user-defined configuration
tweaks.

Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-05-21 00:31:07 -07:00
Junio C Hamano
065b0702f7 Merge branch 'maint'
* maint:
  grep: fix word-regexp colouring
  completion: use git rev-parse to detect bare repos
  Cope better with a _lot_ of packs
  for-each-ref: fix segfault in copy_email
2009-05-20 18:59:09 -07:00
René Scharfe
e701fadb9e grep: fix word-regexp colouring
As noticed by Dmitry Gryazin: When a pattern is found but it doesn't
start and end at word boundaries, bol is forwarded to after the match and
the pattern is searched again.  When a pattern is finally found between
word boundaries, the match offsets are off by the number of characters
that have been skipped.

This patch corrects the offsets to be relative to the value of bol as
passed to match_one_pattern() by its caller.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-20 18:49:20 -07:00
Giuseppe Bilotta
8dfb17e1fd completion: use git rev-parse to detect bare repos
Its check is more robust than a config check for core.bare

Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org>

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-20 18:35:23 -07:00
Johannes Schindelin
fd73ccf279 Cope better with a _lot_ of packs
You might end up with a situation where you have tons of pack files, e.g.
when using hg2git.  In this situation, all kinds of operations may
end up with a "too many files open" error.  Let's recover gracefully from
that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Looks-right-to-me-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-20 18:23:06 -07:00
René Scharfe
ff3c7f9a26 grep: make callback functions static
Suggested by Stephen Boyd: make the callback functions used for option
parsing static.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-20 18:16:25 -07:00
Jeff King
e64c1b0053 for-each-ref: fix segfault in copy_email
You can trigger a segfault in git.git by doing:

  git for-each-ref --format='%(taggeremail)' refs/tags/v0.99

The v0.99 tag is special in that it contains no "tagger"
header.

The bug is obvious in copy_email, which carefully checks to
make sure the result of a strchr is non-NULL, but only after
already having used it to perform other work. The fix is to
move the check up.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-20 00:06:19 -07:00
Heiko Voigt
d00e364de9 Extend sample pre-commit hook to check for non ascii filenames
At the moment non-ascii encodings of filenames are not portably
converted between different filesystems by git. This will most likely
change in the future but to allow repositories to be portable among
different file/operating systems this check is enabled by default.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-20 00:04:37 -07:00
Dan McGee
91fe2f9091 Unify signedness in hashing calls
Our hash_obj and hashtable_index calls and functions were doing a lot of
funny things with signedness. Unify all of it to 'unsigned int'.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-20 00:02:24 -07:00
Junio C Hamano
99ddd24ad7 Merge branch 'np/push-delta'
* np/push-delta:
  allow OFS_DELTA objects during a push
2009-05-18 09:01:16 -07:00
Junio C Hamano
d430262fac Merge branch 'ar/merge-one-file-diag'
* ar/merge-one-file-diag:
  Clarify kind of conflict in merge-one-file helper
2009-05-18 09:01:11 -07:00
Junio C Hamano
36587681b4 Merge branch 'ar/unlink-err'
* ar/unlink-err:
  print unlink(2) errno in copy_or_link_directory
  replace direct calls to unlink(2) with unlink_or_warn
  Introduce an unlink(2) wrapper which gives warning if unlink failed
2009-05-18 09:01:06 -07:00
Junio C Hamano
f2a56171ac Merge branch 'jk/maint-add-empty'
* jk/maint-add-empty:
  add: don't complain when adding empty project root
2009-05-18 09:01:01 -07:00
Junio C Hamano
362724af6c Merge branch 'js/add-edit'
* js/add-edit:
  t3702: fix reliance on SHELL_PATH being '/bin/sh'
  git-add: introduce --edit (to edit the diff vs. the index)
2009-05-18 09:00:06 -07:00
Junio C Hamano
c16cea7345 Merge branch 'mh/diff-stat-color'
* mh/diff-stat-color:
  diff: do not color --stat output like patch context
2009-05-18 08:59:54 -07:00
Junio C Hamano
96825a8054 Merge branch 'mh/show-branch-color'
* mh/show-branch-color:
  bash completion: show-branch color support
  show-branch: color the commit status signs

Conflicts:
	contrib/completion/git-completion.bash
2009-05-18 08:59:48 -07:00
Junio C Hamano
7f1eaec7f4 Merge branch 'ac/graph-horizontal-line'
* ac/graph-horizontal-line:
  graph API: Use horizontal lines for more compact graphs
2009-05-18 08:59:30 -07:00
Junio C Hamano
983e9b63ae Merge branch 'ae/anon-fetch-info'
* ae/anon-fetch-info:
  fetch: Strip usernames from url's before storing them
2009-05-18 08:59:27 -07:00
Junio C Hamano
59e5fb356e Merge branch 'maint'
* maint:
  show-branch: Fix die message in parse_reflog_param()
2009-05-18 08:59:20 -07:00
Stephen Boyd
5acb3e5012 show-branch: Fix die message in parse_reflog_param()
Commit 76a44c5 (show-branch --reflog: show the reflog message at the
top, 2007-01-19) introduced parse_reflog_param(). The die() call was
incorrectly passed arg + 9, when it should have been passed arg.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-17 12:05:22 -07:00
Junio C Hamano
55524fcf9d Merge branch 'maint'
* maint:
  completion: add missing options to show-branch and show
  dir.c: clean up handling of 'path' parameter in read_directory_recursive()
  Fix type-punning issues
2009-05-16 23:08:49 -07:00
Stephen Boyd
076c32370d completion: add missing options to show-branch and show
Add --oneline and --abbrev-commit to show and --sparse to show-branch.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-16 22:46:22 -07:00
Linus Torvalds
da4b3e8c28 dir.c: clean up handling of 'path' parameter in read_directory_recursive()
Right now we pass two different pathnames ('path' and 'base') down to
read_directory_recursive(), and the only real reason for that is that we
want to allow an empty 'base' parameter, but when we do so, we need the
pathname to "opendir()" to be "." rather than the empty string.

And rather than handle that confusion in the caller, we can just fix
read_directory_recursive() to handle the case of an empty path itself,
by just passing opendir() a "." ourselves if the path is empty.

This would allow us to then drop one of the pathnames entirely from the
calling convention, but rather than do that, we'll start separating them
out as a "filesystem pathname" (the one we use for filesystem accesses)
and a "git internal base name" (which is the name that we use for git
internally).

That will eventually allow us to do things like handle different
encodings (eg the filesystem pathnames might be Latin1, while git itself
would use UTF-8 for filename information).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-16 22:41:46 -07:00
Dan McGee
b867d324ce Fix type-punning issues
In these two places we are casting part of our unsigned char sha1 array into
an unsigned int, which violates GCCs strict-aliasing rules (and probably
other compilers).

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-16 22:41:18 -07:00
Junio C Hamano
671d1bc6a0 Merge branch 'maint'
* maint:
  test: checkout shouldn't say that HEAD has moved if it didn't
  completion: enhance "current branch" display
  completion: simplify "current branch" in __git_ps1()
  completion: fix PS1 display during a merge on detached HEAD
  builtin-checkout: Don't tell user that HEAD has moved before it has
  pre-commit.sample: don't print incidental SHA1
  tests: Add tests for missing format-patch long options
  api-parse-options.txt: use 'func' instead of 'funct'
  Turn on USE_ST_TIMESPEC for OpenBSD
  ls-tree manpage: output of ls-tree is compatible with update-index
  ls-tree manpage: use "unless" instead of "when ... is not"
2009-05-16 19:49:42 -07:00
Nanako Shiraishi
e4b09dad9f test: checkout shouldn't say that HEAD has moved if it didn't
Signed-off-by: しらいしななこ <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-16 19:49:25 -07:00
Junio C Hamano
dd42c2f015 completion: enhance "current branch" display
Introduce GIT_PS1_DESCRIBE option you can set to "contains", "branch", or
"describe" to tweak the way how a detached HEAD is described.

The default behaviour is to describe only exact match with some tag
(otherwise use the first 7 hexdigits) as before.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-16 19:46:31 -07:00
Junio C Hamano
ff790b6a4b completion: simplify "current branch" in __git_ps1()
As I very often work on a detached HEAD, I found it pretty confusing
when __git_ps1() said 'some-name'.  Did I create a branch with that name
by mistake, or do I happen to be on a commit with that exact tag?

This patch fixes the issue by enclosing non branch names in a pair of
parentheses when used to substitute %s token in __git_ps1() argument.

It also fixes a small bug where the branch part is left empty when
.git/HEAD is unreadable for whatever reason.  The output now says
"(unknown)".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-16 19:46:31 -07:00
Junio C Hamano
8763dbb1b2 completion: fix PS1 display during a merge on detached HEAD
If your merge stops in a conflict while on a detached HEAD, recent
completion code fails to show anything.  This was because various cases
added to support the operation-in-progress markers (e.g. REBASE, MERGING)
forgot that they need to set the variable "b" to something for the result
they computed to be displayed at all.

Probably not many people make trial merges on a detached HEAD (which is
tremendously useful feature of git, by the way), and that may be why this
was not noticed for a long time.

Acked-By: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-16 19:46:31 -07:00