git.git
16 years agoMerge branch 'jn/gitweb-config-error-die'
Junio C Hamano [Tue, 2 Mar 2010 20:44:11 +0000 (12:44 -0800)]
Merge branch 'jn/gitweb-config-error-die'

* jn/gitweb-config-error-die:
  gitweb: Die if there are parsing errors in config file

16 years agoMerge branch 'jc/for-each-ref'
Junio C Hamano [Tue, 2 Mar 2010 20:44:10 +0000 (12:44 -0800)]
Merge branch 'jc/for-each-ref'

* jc/for-each-ref:
  for-each-ref --format='%(flag)'
  for-each-ref --format='%(symref) %(symref:short)'
  builtin-for-each-ref.c: check if we need to peel onion while parsing the format
  builtin-for-each-ref.c: comment fixes

16 years agoMerge branch 'ld/maint-diff-quiet-w'
Junio C Hamano [Tue, 2 Mar 2010 20:44:10 +0000 (12:44 -0800)]
Merge branch 'ld/maint-diff-quiet-w'

* ld/maint-diff-quiet-w:
  git-diff: add a test for git diff --quiet -w
  git diff --quiet -w: check and report the status

16 years agoMerge branch 'tr/maint-cherry-pick-list'
Junio C Hamano [Tue, 2 Mar 2010 20:44:10 +0000 (12:44 -0800)]
Merge branch 'tr/maint-cherry-pick-list'

* tr/maint-cherry-pick-list:
  cherry_pick_list: quit early if one side is empty

16 years agoMerge branch 'rs/optim-text-wrap'
Junio C Hamano [Tue, 2 Mar 2010 20:44:10 +0000 (12:44 -0800)]
Merge branch 'rs/optim-text-wrap'

* rs/optim-text-wrap:
  utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()
  utf8.c: remove strbuf_write()
  utf8.c: remove print_spaces()
  utf8.c: remove print_wrapped_text()

16 years agoMerge branch 'ml/send-pack-transport-refactor'
Junio C Hamano [Tue, 2 Mar 2010 20:44:09 +0000 (12:44 -0800)]
Merge branch 'ml/send-pack-transport-refactor'

* ml/send-pack-transport-refactor:
  refactor duplicated code in builtin-send-pack.c and transport.c

16 years agoMerge branch 'ml/fill-mm-refactor'
Junio C Hamano [Tue, 2 Mar 2010 20:44:09 +0000 (12:44 -0800)]
Merge branch 'ml/fill-mm-refactor'

* ml/fill-mm-refactor:
  refactor duplicated fill_mm() in checkout and merge-recursive

16 years agoMerge branch 'ml/connect-refactor'
Junio C Hamano [Tue, 2 Mar 2010 20:44:09 +0000 (12:44 -0800)]
Merge branch 'ml/connect-refactor'

* ml/connect-refactor:
  connect.c: move duplicated code to a new function 'get_host_and_port'

16 years agoMerge branch 'np/compress-loose-object-memsave'
Junio C Hamano [Tue, 2 Mar 2010 20:44:09 +0000 (12:44 -0800)]
Merge branch 'np/compress-loose-object-memsave'

* np/compress-loose-object-memsave:
  sha1_file: be paranoid when creating loose objects
  sha1_file: don't malloc the whole compressed result when writing out objects

16 years agoMerge branch 'dp/read-not-mmap-small-loose-object'
Junio C Hamano [Tue, 2 Mar 2010 20:44:08 +0000 (12:44 -0800)]
Merge branch 'dp/read-not-mmap-small-loose-object'

* dp/read-not-mmap-small-loose-object:
  hash-object: don't use mmap() for small files

16 years agoMerge branch 'jn/makedepend'
Junio C Hamano [Tue, 2 Mar 2010 20:44:08 +0000 (12:44 -0800)]
Merge branch 'jn/makedepend'

* jn/makedepend:
  Makefile: clarify definition of TEST_OBJS
  Makefile: always remove .depend directories on 'make clean'
  Makefile: tuck away generated makefile fragments in .depend
  Teach Makefile to check header dependencies
  Makefile: list standalone program object files in PROGRAM_OBJS
  Makefile: lazily compute header dependencies
  Makefile: list generated object files in OBJECTS
  Makefile: disable default implicit rules
  Makefile: rearrange dependency rules
  Makefile: transport.o depends on branch.h now
  Makefile: drop dependency on $(wildcard */*.h)
  Makefile: clean up http-walker.o dependency rules
  Makefile: remove wt-status.h from LIB_H
  Makefile: make sure test helpers are rebuilt when headers change
  Makefile: add missing header file dependencies

Conflicts:
Makefile

16 years agoMerge branch 'jc/maint-status-preload'
Junio C Hamano [Tue, 2 Mar 2010 20:44:07 +0000 (12:44 -0800)]
Merge branch 'jc/maint-status-preload'

* jc/maint-status-preload:
  status: preload index to optimize lstat(2) calls

16 years agoMerge branch 'gf/maint-sh-setup-nongit-ok'
Junio C Hamano [Tue, 2 Mar 2010 20:44:07 +0000 (12:44 -0800)]
Merge branch 'gf/maint-sh-setup-nongit-ok'

* gf/maint-sh-setup-nongit-ok:
  require_work_tree broken with NONGIT_OK

16 years agoMerge branch 'jh/maint-submodule-status-in-void'
Junio C Hamano [Tue, 2 Mar 2010 20:44:07 +0000 (12:44 -0800)]
Merge branch 'jh/maint-submodule-status-in-void'

* jh/maint-submodule-status-in-void:
  submodule summary: Don't barf when invoked in an empty repo

16 years agoMerge branch 'hm/imap-send-cram-md5'
Junio C Hamano [Tue, 2 Mar 2010 20:44:06 +0000 (12:44 -0800)]
Merge branch 'hm/imap-send-cram-md5'

* hm/imap-send-cram-md5:
  imap-send: support CRAM-MD5 authentication

16 years agoMerge branch 'ml/color-when'
Junio C Hamano [Tue, 2 Mar 2010 20:44:06 +0000 (12:44 -0800)]
Merge branch 'ml/color-when'

* ml/color-when:
  Add an optional argument for --color options

16 years agoMerge branch 'ac/cvsimport-revision-mapping'
Junio C Hamano [Tue, 2 Mar 2010 20:44:06 +0000 (12:44 -0800)]
Merge branch 'ac/cvsimport-revision-mapping'

* ac/cvsimport-revision-mapping:
  cvsimport: new -R option: generate .git/cvs-revisions mapping

16 years agoMerge branch 'jc/grep-author-all-match-implicit'
Junio C Hamano [Tue, 2 Mar 2010 20:44:06 +0000 (12:44 -0800)]
Merge branch 'jc/grep-author-all-match-implicit'

* jc/grep-author-all-match-implicit:
  "log --author=me --grep=it" should find intersection, not union

16 years agofallback SSH_ASKPASS when GIT_ASKPASS not set
Frank Li [Tue, 2 Mar 2010 11:52:11 +0000 (19:52 +0800)]
fallback SSH_ASKPASS when GIT_ASKPASS not set

If GIT_ASKPASS is not set and SSH_ASKPASS set, GIT_ASKPASS will
use SSH_ASKPASS.

Signed-off-by: Frank Li <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogitweb: Fix project-specific feature override behavior
Jakub Narebski [Mon, 1 Mar 2010 21:51:34 +0000 (22:51 +0100)]
gitweb: Fix project-specific feature override behavior

This commit fixes a bug in processing project-specific override in
a situation when there is no project, e.g. for the projects list page.

When 'snapshot' feature had project specific config override enabled
by putting
  $feature{'snapshot'}{'override'} = 1;

(or equivalent) in $GITWEB_CONFIG, and when viewing toplevel gitweb
page, which means the projects list page (to be more exact this
happens for any project-less action), gitweb would put the following
Perl warnings in error log:

  gitweb.cgi: Use of uninitialized value $git_dir in concatenation (.) or string at gitweb.cgi line 2065.
  fatal: error processing config file(s)
  gitweb.cgi: Use of uninitialized value $git_dir in concatenation (.) or string at gitweb.cgi line 2221.
  gitweb.cgi: Use of uninitialized value $git_dir in concatenation (.) or string at gitweb.cgi line 2218.

The problem is in the following fragment of code:

  # path to the current git repository
  our $git_dir;
  $git_dir = "$projectroot/$project" if $project;

  # list of supported snapshot formats
  our @snapshot_fmts = gitweb_get_feature('snapshot');
  @snapshot_fmts = filter_snapshot_fmts(@snapshot_fmts);

For the toplevel gitweb page, which is the list of projects, $project is not
defined, therefore neither is $git_dir.  gitweb_get_feature() subroutine
calls git_get_project_config() if project specific override is turned
on... but we don't have project here.

Those errors mentioned above occur in the following fragment of code in
git_get_project_config():

   # get config
   if (!defined $config_file ||
       $config_file ne "$git_dir/config") {
   %config = git_parse_project_config('gitweb');
   $config_file = "$git_dir/config";
   }

git_parse_project_config() calls git_cmd() which has '--git-dir='.$git_dir

There are (at least) three possible solutions:
1. Harden gitweb_get_feature() so that it doesn't call
   git_get_project_config() if $project (and therefore $git_dir) is not
   defined; there is no project for project specific config.
2. Harden git_get_project_config() like you did in your fix, returning early
   if $git_dir is not defined.
3. Harden git_cmd() so that it doesn't add "--git-dir=$git_dir" if $git_dir
   is not defined, and change git_get_project_config() so that it doesn't
   even try to access $git_dir if it is not defined.

This commit implements both 1.) and 2.), i.e. gitweb_get_feature() doesn't
call project-specific override if $git_dir is not defined (if there is no
project), and git_get_project_config() returns early if $git_dir is not
defined.

Add a test for this bug to t/t9500-gitweb-standalone-no-errors.sh test.

Reported-by: Eli Barzilay <redacted>
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogitweb multiple project roots documentation
Sylvain Rabot [Tue, 2 Mar 2010 00:04:57 +0000 (01:04 +0100)]
gitweb multiple project roots documentation

This commit adds in the gitweb/README file a description of how to use gitweb
with several project roots using apache virtualhost rewrite rules.

Signed-off-by: Sylvain Rabot <redacted>
Acked-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agorefactor merge flags into xmparam_t
Bert Wesarg [Mon, 1 Mar 2010 21:46:26 +0000 (22:46 +0100)]
refactor merge flags into xmparam_t

Include the merge level, favor, and style flags into the xmparam_t struct.
This removes the bit twiddling with these three values into the one flags
parameter.

Signed-off-by: Bert Wesarg <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agomake union merge an xdl merge favor
Bert Wesarg [Mon, 1 Mar 2010 21:46:25 +0000 (22:46 +0100)]
make union merge an xdl merge favor

The current union merge driver is implemented as an post process.  But the
xdl_merge code is quite capable to produce the result by itself.  Therefore
move it there.

Signed-off-by: Bert Wesarg <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoremote-curl: init walker only when needed
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:31 +0000 (18:49 +0800)]
remote-curl: init walker only when needed

Invoke get_http_walker() only when fetching with the dumb protocol.
Additionally, add an invocation to walker_free() after we're done using
the walker.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoremote-curl: use http_fetch_ref() instead of walker wrapper
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:30 +0000 (18:49 +0800)]
remote-curl: use http_fetch_ref() instead of walker wrapper

The http-walker implementation of walker->fetch_ref() doesn't do
anything special compared to http_fetch_ref() anyway.

Remove init_walker() invocation before fetching the ref, since we aren't
using the walker wrapper and don't need a walker instance anymore.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agohttp: init and cleanup separately from http-walker
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:29 +0000 (18:49 +0800)]
http: init and cleanup separately from http-walker

Previously, all our http operations were done with http-walker. With the
new remote-curl helper, we find ourselves using http methods outside of
http-walker - for example, fetching info/refs.

Accomodate this by separating http_init() and http_cleanup() invocations
from http-walker.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agohttp-walker: cleanup more thoroughly
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:28 +0000 (18:49 +0800)]
http-walker: cleanup more thoroughly

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agohttp-push: remove "|| 1" to enable verbose check
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:27 +0000 (18:49 +0800)]
http-push: remove "|| 1" to enable verbose check

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agot554[01]-http-push: refactor, add non-ff tests
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:26 +0000 (18:49 +0800)]
t554[01]-http-push: refactor, add non-ff tests

Move non-fast forward tests to lib-httpd.sh so that we don't have to
duplicate the tests in both t5540 and t5541.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agot5541-http-push: check that ref is unchanged for non-ff test
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:25 +0000 (18:49 +0800)]
t5541-http-push: check that ref is unchanged for non-ff test

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoMerge branch 'cc/maint-bisect-paths'
Junio C Hamano [Mon, 1 Mar 2010 09:09:21 +0000 (01:09 -0800)]
Merge branch 'cc/maint-bisect-paths'

* cc/maint-bisect-paths:
  bisect: error out when passing bad path parameters

16 years agobisect: error out when passing bad path parameters
Christian Couder [Sun, 28 Feb 2010 22:19:09 +0000 (23:19 +0100)]
bisect: error out when passing bad path parameters

As reported by Mark Lodato, "git bisect", when it was started with
path parameters that match no commit was kind of working without
taking account of path parameters and was reporting something like:

Bisecting: -1 revisions left to test after this (roughly 0 steps)

It is more correct and safer to just error out in this case, before
displaying the revisions left, so this patch does just that.

Note that this bug is very old, it exists at least since v1.5.5.
And it is possible to detect that case earlier in the bisect
algorithm, but it is not clear that it would be an improvement to
error out earlier, on the contrary it may change the behavior of
"git rev-list --bisect-all" for example, which is currently correct.

Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoMerge branch 'maint'
Junio C Hamano [Sun, 28 Feb 2010 19:41:57 +0000 (11:41 -0800)]
Merge branch 'maint'

* maint:
  Git 1.7.0.1
  Remove reference to GREP_COLORS from documentation
  sha1_name: fix segfault caused by invalid index access

16 years agoGit 1.7.0.1
Junio C Hamano [Sun, 28 Feb 2010 19:41:24 +0000 (11:41 -0800)]
Git 1.7.0.1

Signed-off-by: Junio C Hamano <redacted>
16 years agoRemove reference to GREP_COLORS from documentation
Mark Lodato [Sat, 27 Feb 2010 04:57:48 +0000 (23:57 -0500)]
Remove reference to GREP_COLORS from documentation

There is no longer support for external grep, as per bbc09c2 (grep: rip
out support for external grep, 2010-01-12), so remove the reference to it
from the documentation.

Signed-off-by: Mark Lodato <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit-am: Add tests for `--keep-cr`, `--no-keep-cr` and `am.keepcr`
Stefan-W. Hahn [Sat, 27 Feb 2010 14:20:28 +0000 (15:20 +0100)]
git-am: Add tests for `--keep-cr`, `--no-keep-cr` and `am.keepcr`

Add tests for git-am using files with DOS line endings for various
combinations of `--keep-cr`, `--no-keep-cr` and `am.keepcr`.

Signed-off-by: Stefan-W. Hahn <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit-am: Add am.keepcr and --no-keep-cr to override it
Stefan-W. Hahn [Sat, 27 Feb 2010 14:20:27 +0000 (15:20 +0100)]
git-am: Add am.keepcr and --no-keep-cr to override it

This patch adds the configuration `am.keepcr` for git-am. It also adds
`--no-keep-cr` parameter for git-am to give the possibility to
override configuration from command line.

Signed-off-by: Stefan-W. Hahn <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit-am: Add command line parameter `--keep-cr` passing it to git-mailsplit
Stefan-W. Hahn [Sat, 27 Feb 2010 14:20:26 +0000 (15:20 +0100)]
git-am: Add command line parameter `--keep-cr` passing it to git-mailsplit

c2ca1d7 (Allow mailsplit (and hence git-am) to handle mails with CRLF
line-endings, 2009-08-04) fixed "git mailsplit" to help people with
MUA whose output from save-as command uses CRLF as line terminators by
stripping CR at the end of lines.

However, when you know you are feeding output from "git format-patch"
directly to "git am", and especially when your contents have CR at the
end of line, such stripping is undesirable.  To help such a use case,
teach --keep-cr option to "git am" and pass that to "git mailinfo".

Signed-off-by: Stefan-W. Hahn <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agodocumentation: 'git-mailsplit --keep-cr' is not hidden anymore
Stefan-W. Hahn [Sat, 27 Feb 2010 14:20:25 +0000 (15:20 +0100)]
documentation: 'git-mailsplit --keep-cr' is not hidden anymore

So far this was an internal mechanism for rebase, but we will be exposing
it to the end users.

Signed-off-by: Stefan-W. Hahn <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoMakefile: clarify definition of TEST_OBJS
Jonathan Nieder [Sun, 28 Feb 2010 09:11:55 +0000 (03:11 -0600)]
Makefile: clarify definition of TEST_OBJS

The definition of TEST_OBJS in commit daa99a91 (Makefile: make sure
test helpers are rebuilt when headers change, 2010-01-26) moved a use
of $X to before the platform-specific section where it gets defined.
There are at least two ways to fix that:

 - Change the definition of TEST_OBJS to use the = delayed
   evaluation operator.  This way, one need not worry about $(X)
   needing to be defined before TEST_OBJS is set.

 - Move the definition of TEST_OBJS to below the definition of $X.

Carry out the second.  The later site of definition makes the code more
readable, since now a reader only has to look down one line to see what
TEST_OBJS is meant to be used for.

Oddly enough, with or without this change the behavior of the Makefile
is the same.  Since TEST_PROGRAMS is defined with delayed evaluation,
the value of

 TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))

is independent of the value of $X when it is evaluated: the $X in the
pattern and the $X in $(TEST_PROGRAMS) will simply always cancel out.
Make sure $X has the expected expansion anyway to make the code and
the reader’s sanity more robust in the face of future changes.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit-push: add tests for git push --porcelain
Larry D'Anna [Sat, 27 Feb 2010 04:52:16 +0000 (23:52 -0500)]
git-push: add tests for git push --porcelain

Verify that the output format is correct for successful, rejected, and
flagrantly erroneous pushes.

Signed-off-by: Larry D'Anna <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit-push: make git push --porcelain print "Done"
Larry D'Anna [Sat, 27 Feb 2010 04:52:15 +0000 (23:52 -0500)]
git-push: make git push --porcelain print "Done"

The script calling git push --porcelain --dry-run can see clearly from the
output if an update was rejected.  However, it will probably need to distinguish
this condition from the push failing for other reasons, such as the remote not
being reachable.

This patch modifies git push --porcelain to print "Done" after the rest of its
output unless any errors have occurred.  For the purpose of the "Done" line,
knowing a ref will be rejected in a --dry-run does not count as an error.
Actual rejections in non --dry-run pushes do count as errors.

Signed-off-by: Larry D'Anna <redacted>
Acked-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit-push: send "To <remoteurl>" messages to the standard output in --porcelain mode
Larry D'Anna [Sat, 27 Feb 2010 04:52:14 +0000 (23:52 -0500)]
git-push: send "To <remoteurl>" messages to the standard output in --porcelain mode

git-push prints the line "To <remoteurl>" before above each of the ref status
lines.  In --porcelain mode, these "To <remoteurl>" lines go to the standard
error, but the ref status lines go to the standard output.  This makes it
difficult for the process reading standard output to know which ref status lines
correspond to which remote.  This patch sends the "To <remoteurl>" lines to the
the standard output instead.

Signed-off-by: Larry D'Anna <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit-push: fix an advice message so it goes to stderr
Larry D'Anna [Sat, 27 Feb 2010 04:52:13 +0000 (23:52 -0500)]
git-push: fix an advice message so it goes to stderr

These sort of messages typically go to the standard error.

Signed-off-by: Larry D'Anna <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agosha1_name: fix segfault caused by invalid index access
Markus Heidelberg [Sun, 28 Feb 2010 15:49:15 +0000 (16:49 +0100)]
sha1_name: fix segfault caused by invalid index access

The code to see if user input "git show :path" makes sense tried to access
the index without properly checking the array bound.

Signed-off-by: Markus Heidelberg <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoreflog: honor gc.reflogexpire=never
Adam Simpkins [Sat, 27 Feb 2010 03:50:03 +0000 (19:50 -0800)]
reflog: honor gc.reflogexpire=never

Previously, if gc.reflogexpire or gc.reflogexpire were set to "never"
or "false", the builtin default values were used instead.

Signed-off-by: Adam Simpkins <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoprune: honor --expire=never
Adam Simpkins [Sat, 27 Feb 2010 03:50:02 +0000 (19:50 -0800)]
prune: honor --expire=never

Previously, prune treated an expiration time of 0 to mean that no
expire argument was supplied, and everything should be pruned.  As a
result, "prune --expire=never" would prune all unreachable objects,
regardless of their timestamp.

prune can be called with --expire=never automatically by gc, when the
gc.pruneExpire configuration is set to "never".

Signed-off-by: Adam Simpkins <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit svn: delay importing SVN::Base until it is needed
josh robb [Wed, 24 Feb 2010 03:13:50 +0000 (16:13 +1300)]
git svn: delay importing SVN::Base until it is needed

Importing functions from a .dll into Git for Windows' perl is pretty slow,
so let's avoid importing if it is not necessary.

This seems particularly slow in virtualized enviroments. Before this
change (on my machine):

$ time perl /libexec/git-core/git-svn rebase
Current branch master is up to date.

real 2m56.750s
user 0m3.129s
sys 2m39.232s

Afterwards:

$ time perl /libexec/git-core/git-svn rebase
Current branch master is up to date.

real 0m33.407s
user 0m1.409s
sys 0m23.054s

git svn rebase -n goes from 3m7.046s to 0m10.312s.

Signed-off-by: Josh Robb <redacted>
Acked-by: Eric Wong <redacted>
16 years agogit-svn: Fix discarding of extra parents from svn:mergeinfo
Tuomas Suutari [Mon, 22 Feb 2010 18:12:53 +0000 (20:12 +0200)]
git-svn: Fix discarding of extra parents from svn:mergeinfo

If parent J is an ancestor of parent I, then parent J should be
discarded, not I.

Note that J is an ancestor of I if and only if rev-list I..J is emtpy,
which is what we are testing here.

Signed-off-by: Tuomas Suutari <redacted>
Acked-by: Eric Wong <redacted>
16 years agot9151: Add two new svn:mergeinfo test cases
Tuomas Suutari [Mon, 22 Feb 2010 07:57:21 +0000 (09:57 +0200)]
t9151: Add two new svn:mergeinfo test cases

When svn:mergeinfo contains two new parents in a specific order and
one is ancestor of the other, it is possible that git-svn discards the
wrong one. The first test case ("commit made to merged branch is
reachable from the merge") proves this.

The second test case ("merging two branches in one commit is detected
correctly") is just for completeness, since there was no test for
merging two (feature) branches to trunk in one commit.

Signed-off-by: Tuomas Suutari <redacted>
Acked-by: Eric Wong <redacted>
16 years agot9151: Fix a few commits in the SVN dump
Tuomas Suutari [Mon, 22 Feb 2010 07:57:20 +0000 (09:57 +0200)]
t9151: Fix a few commits in the SVN dump

A few "svn cp" commands and commit commands were executed in incorrect
order. Therefore some of the desired commits were missing and some
were committed with wrong revision number in the commit message. This
made it hard to compare the produced git repository with the SVN
repository.

The dump file is updated too, but only the relevant parts and with
hand-edited timestamps to make history linear.

Signed-off-by: Tuomas Suutari <redacted>
Acked-by: Eric Wong <redacted>
16 years agoMerge branch 'maint'
Junio C Hamano [Fri, 26 Feb 2010 07:21:50 +0000 (23:21 -0800)]
Merge branch 'maint'

* maint:
  t3301-notes: insert a shbang line in ./fake_editor.sh

16 years agoMerge branch 'maint-1.6.6' into maint
Junio C Hamano [Fri, 26 Feb 2010 07:21:42 +0000 (23:21 -0800)]
Merge branch 'maint-1.6.6' into maint

* maint-1.6.6:
  t3301-notes: insert a shbang line in ./fake_editor.sh

16 years agot/t0001-init.sh: add test for 'init with init.templatedir set'
Steven Drake [Fri, 26 Feb 2010 04:00:21 +0000 (17:00 +1300)]
t/t0001-init.sh: add test for 'init with init.templatedir set'

Requires a small change to wrap-for-bin.sh in order to work.

Signed-off-by: Steven Drake <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoinit: having keywords without value is not a global error.
Steven Drake [Fri, 26 Feb 2010 04:00:20 +0000 (17:00 +1300)]
init: having keywords without value is not a global error.

We may later add a new configuration variable in "init" section that takes
a boolean value.  Erroring out at the beginning of the config parser makes
life harder for later enhancement.

The existing configuration variable is parsed by git_config_pathname()
that checks and rejects init.templatedir that is unset without this extra
check.  Remove it.

Signed-off-by: Steven Drake <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogrep docs: document --no-index option
Mark Lodato [Fri, 26 Feb 2010 03:40:13 +0000 (22:40 -0500)]
grep docs: document --no-index option

Also clarify --cached and <tree>.

Signed-off-by: Mark Lodato <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogrep docs: --cached and <tree>... are incompatible
Mark Lodato [Fri, 26 Feb 2010 03:40:12 +0000 (22:40 -0500)]
grep docs: --cached and <tree>... are incompatible

In the synopsis for git-grep(1), show that --cached and <tree>... cannot
be used together.

Signed-off-by: Mark Lodato <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogrep docs: use AsciiDoc literals consistently
Mark Lodato [Fri, 26 Feb 2010 03:40:11 +0000 (22:40 -0500)]
grep docs: use AsciiDoc literals consistently

The convention for this particular page is to use AsciiDoc literal
strings only for options (`-x` or `--long`), but not for definition list
terms and not for <meta-vars>.

Signed-off-by: Mark Lodato <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogrep docs: pluralize "Example" section
Mark Lodato [Fri, 26 Feb 2010 03:40:10 +0000 (22:40 -0500)]
grep docs: pluralize "Example" section

Signed-off-by: Mark Lodato <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoWindows: redirect f[re]open("/dev/null") to f[re]open("nul")
Johannes Sixt [Thu, 25 Feb 2010 20:03:44 +0000 (21:03 +0100)]
Windows: redirect f[re]open("/dev/null") to f[re]open("nul")

On Windows, the equivalent of "/dev/null" is "nul". This implements
compatibility wrappers around fopen() and freopen() that check for this
particular file name.

The new tests exercise code paths where this is relevant.

Signed-off-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agot3301-notes: insert a shbang line in ./fake_editor.sh
Johannes Sixt [Thu, 25 Feb 2010 10:39:50 +0000 (11:39 +0100)]
t3301-notes: insert a shbang line in ./fake_editor.sh

This is required on Windows because git-notes is now a built-in
rather than a shell script.

Signed-off-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoFix gitmkdtemp: correct test for mktemp() return value
Filippo Negroni [Thu, 25 Feb 2010 10:01:31 +0000 (10:01 +0000)]
Fix gitmkdtemp: correct test for mktemp() return value

In gitmkdtemp, the return value of mktemp is not tested correctly.
mktemp() always returns its 'template' argument, even upon failure.
An error is signalled by making the template an empty string.

Signed-off-by: Filippo Negroni <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agonotes: fix malformed tree entry
Junio C Hamano [Thu, 25 Feb 2010 05:39:06 +0000 (21:39 -0800)]
notes: fix malformed tree entry

The mode bits for entries in a tree object should be an octal number
with minimum number of digits.  Do not pad it with 0 to the left.

Signed-off-by: Junio C Hamano <redacted>
16 years agobuiltin-notes: Minor (mostly parse_options-related) fixes
Johan Herland [Thu, 25 Feb 2010 00:48:11 +0000 (01:48 +0100)]
builtin-notes: Minor (mostly parse_options-related) fixes

Use PARSE_OPT_NONEG to disallow --no-<option> for message, file,
reedit-message and reuse-message. for which --no-<option> does not make
sense.  This also simplifies the code in the option-handling callbacks.

Also, use strbuf_addch(... '\n') instead of strbuf_addstr(... "\n") in
couple of places.

Finally, improve the short-help by dividing the options into two
OPT_GROUPs.

Suggested-by: Stephen Boyd <redacted>
Signed-off-by: Johan Herland <redacted>
Acked-by: Stephen Boyd <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agopack-objects documentation: Fix --honor-pack-keep as well.
Nelson Elhage [Thu, 25 Feb 2010 00:11:23 +0000 (19:11 -0500)]
pack-objects documentation: Fix --honor-pack-keep as well.

Signed-off-by: Nelson Elhage <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agois_submodule_modified(): clear environment properly
Giuseppe Bilotta [Wed, 24 Feb 2010 23:34:18 +0000 (00:34 +0100)]
is_submodule_modified(): clear environment properly

Rather than only clearing GIT_INDEX_FILE, take the list of environment
variables to clear from local_repo_env, appending the settings for
GIT_DIR and GIT_WORK_TREE.

Signed-off-by: Giuseppe Bilotta <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agosubmodules: ensure clean environment when operating in a submodule
Giuseppe Bilotta [Wed, 24 Feb 2010 23:34:17 +0000 (00:34 +0100)]
submodules: ensure clean environment when operating in a submodule

git-submodule used to take care of clearing GIT_DIR whenever it operated
on a submodule index or configuration, but forgot to unset GIT_WORK_TREE
or other repo-local variables. This would lead to failures e.g. when
GIT_WORK_TREE was set.

This only happened in very unusual contexts such as operating on the
main worktree from outside of it, but since "git-gui: set GIT_DIR and
GIT_WORK_TREE after setup" (a9fa11fe5bd5978bb) such failures could also
be provoked by invoking an external tool such as "git submodule update"
from the Git Gui in a standard setup.

Solve by using the newly introduced clear_local_git_env() shell function
to ensure that all repo-local environment variables are unset.

Signed-off-by: Giuseppe Bilotta <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoshell setup: clear_local_git_env() function
Giuseppe Bilotta [Wed, 24 Feb 2010 23:34:16 +0000 (00:34 +0100)]
shell setup: clear_local_git_env() function

Introduce an auxiliary function to clear all repo-local environment
variables. This should be invoked by any shell script that switches
repository during execution, to ensure that the environment is clean
and that things such as the git dir and worktree are set up correctly.

Signed-off-by: Giuseppe Bilotta <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agorev-parse: --local-env-vars option
Giuseppe Bilotta [Wed, 24 Feb 2010 23:34:15 +0000 (00:34 +0100)]
rev-parse: --local-env-vars option

This prints the list of repo-local environment variables.

Signed-off-by: Giuseppe Bilotta <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoRefactor list of of repo-local env vars
Giuseppe Bilotta [Wed, 24 Feb 2010 23:34:14 +0000 (00:34 +0100)]
Refactor list of of repo-local env vars

Move the list of GIT_* environment variables that are local to a
repository into a static list in environment.c, as it is also
useful elsewhere. Also add the missing GIT_CONFIG variable to the
list.

Make it easy to use the list both by NULL-termination and by size;
the latter (excluding the terminating NULL) is stored in the
local_repo_env_size define.

Signed-off-by: Giuseppe Bilotta <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agopack-objects documentation: reword "objects that appear in the standard input"
Junio C Hamano [Wed, 24 Feb 2010 23:41:27 +0000 (15:41 -0800)]
pack-objects documentation: reword "objects that appear in the standard input"

These were written back when we always read objects from the standard
input.  These days --revs and its friends can feed only the start and
end points and have the command internally enumerate the objects.

Signed-off-by: Junio C Hamano <redacted>
16 years agoMerge branch 'maint'
Junio C Hamano [Wed, 24 Feb 2010 23:34:07 +0000 (15:34 -0800)]
Merge branch 'maint'

* maint:
  commit: quote the user name in the example

16 years agocommit: quote the user name in the example
Matt Kraai [Wed, 24 Feb 2010 14:18:25 +0000 (06:18 -0800)]
commit: quote the user name in the example

If the user runs

 git config --global user.name Your Name

as suggested, user.name will be set to "Your".  With this patch, the
suggested command will be

 git config --global user.name "Your Name"

which will set user.name to "Your Name" and hopefully help users avoid
the former mistake.

Signed-off-by: Matt Kraai <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoMerge branch 'ml/maint-grep-doc' into maint
Junio C Hamano [Wed, 24 Feb 2010 23:33:23 +0000 (15:33 -0800)]
Merge branch 'ml/maint-grep-doc' into maint

* ml/maint-grep-doc:
  grep documentation: clarify what files match

16 years agoshortlog: warn the user when there is no input
Michele Ballabio [Wed, 24 Feb 2010 20:49:03 +0000 (21:49 +0100)]
shortlog: warn the user when there is no input

A simple "git shortlog" outside of a git repository stalls
waiting for an input. Check if that's the case by testing with
isatty() before read_from_stdin(), and warn the user like
"git commit" does in a similar case.

Signed-off-by: Michele Ballabio <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agofetch --all/--multiple: keep all the fetched branch information
Junio C Hamano [Wed, 24 Feb 2010 19:02:05 +0000 (11:02 -0800)]
fetch --all/--multiple: keep all the fetched branch information

Since "git fetch" learned "--all" and "--multiple" options, it has become
tempting for users to say "git pull --all".  Even though it may fetch from
remotes that do not need to be fetched from for merging with the current
branch, it is handy.

"git fetch" however clears the list of fetched branches every time it
contacts a different remote.  Unless the current branch is configured to
merge with a branch from a remote that happens to be the last in the list
of remotes that are contacted, "git pull" that fetches from multiple
remotes will not be able to find the branch it should be merging with.

Make "fetch" clear FETCH_HEAD (unless --append is given) and then append
the list of branches fetched to it (even when --append is not given).  That
way, "pull" will be able to find the data for the branch being merged in
FETCH_HEAD no matter where the remote appears in the list of remotes to be
contacted by "git fetch".

Reported-by: Michael Lukashov
Signed-off-by: Junio C Hamano <redacted>
16 years agopush: fix segfault for odd config
Jeff King [Wed, 24 Feb 2010 17:08:53 +0000 (12:08 -0500)]
push: fix segfault for odd config

If you have a branch.$X.merge config option, but no branch.$X.remote, and
your configuration tries to push tracking branches, git will segfault.

The problem is that even though branch->merge_nr is 1, you don't actually
have an upstream since there is no remote.  Other callsites generally
check explicitly that branch->merge is not NULL, so let's do that here,
too.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agobuiltin-fetch --all/--multi: propagate options correctly
Junio C Hamano [Wed, 24 Feb 2010 18:22:06 +0000 (10:22 -0800)]
builtin-fetch --all/--multi: propagate options correctly

When running a subfetch, the code propagated some options but not others.
Propagate --force, --update-head-ok and --keep options as well.

Signed-off-by: Junio C Hamano <redacted>
16 years agot5521: fix and modernize
Junio C Hamano [Wed, 24 Feb 2010 18:22:05 +0000 (10:22 -0800)]
t5521: fix and modernize

All of these tests were bogus, as they created new directory and tried to
run "git pull" without even running "git init" in there.  They were mucking
with the repository in $TEST_DIRECTORY.

While fixing it, modernize the style not to chdir around outside of
subshell.  Otherwise a failed test will take us to an unexpected directory
and we need to chdir back to the test directory in each test, which is
ugly and error prone.

Signed-off-by: Junio C Hamano <redacted>
16 years agotransport: update flags to be in running order
Tay Ray Chuan [Wed, 24 Feb 2010 12:50:29 +0000 (20:50 +0800)]
transport: update flags to be in running order

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agofetch and pull: learn --progress
Tay Ray Chuan [Wed, 24 Feb 2010 12:50:28 +0000 (20:50 +0800)]
fetch and pull: learn --progress

Note that in the documentation for git-pull, documentation for the
--progress option is displayed under the "Options related to fetching"
subtitle via fetch-options.txt.

Also, update the documentation of the -q/--quiet option for git-pull to
mention its effect on progress reporting during fetching.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agopush: learn --progress
Tay Ray Chuan [Wed, 24 Feb 2010 12:50:27 +0000 (20:50 +0800)]
push: learn --progress

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agotransport->progress: use flag authoritatively
Tay Ray Chuan [Wed, 24 Feb 2010 12:50:26 +0000 (20:50 +0800)]
transport->progress: use flag authoritatively

Set transport->progress in transport.c::transport_set_verbosity() after
checking for the appropriate conditions (eg. --progress, isatty(2)),
and thereafter use it without having to check again.

The rules used are as follows (processing aborts when a rule is
satisfied):

  1. Report progress, if force_progress is 1 (ie. --progress).
  2. Don't report progress, if verbosity < 0 (ie. -q/--quiet).
  3. Report progress if isatty(2) is 1.

This changes progress reporting behaviour such that if both --progress
and --quiet are specified, progress is reported.

In two areas, the logic to determine whether to *not* show progress is
changed to simply use the negation of transport->progress. This changes
behaviour in some ways (see previous paragraph for details).

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoclone: support multiple levels of verbosity
Tay Ray Chuan [Wed, 24 Feb 2010 12:50:25 +0000 (20:50 +0800)]
clone: support multiple levels of verbosity

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agopush: support multiple levels of verbosity
Tay Ray Chuan [Wed, 24 Feb 2010 12:50:24 +0000 (20:50 +0800)]
push: support multiple levels of verbosity

Remove the flags TRANSPORT_PUSH_QUIET and TRANSPORT_PUSH_VERBOSE; use
transport->verbose instead to determine verbosity for pushing.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agofetch: refactor verbosity option handling into transport.[ch]
Tay Ray Chuan [Wed, 24 Feb 2010 12:50:23 +0000 (20:50 +0800)]
fetch: refactor verbosity option handling into transport.[ch]

transport_set_verbosity() is now provided to transport users.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoDocumentation/git-pull: put verbosity options before merge/fetch ones
Tay Ray Chuan [Wed, 24 Feb 2010 12:50:21 +0000 (20:50 +0800)]
Documentation/git-pull: put verbosity options before merge/fetch ones

After 3f7a9b5 (Documentation/git-pull.txt: Add subtitles above included
option files, Thu Oct 22 2009), the -q/-v options were mentioned only
for the merge options section, giving the impression that git-fetch did
not take those arguments.

Follow 90e4311 (git-pull: do not mention --quiet and --verbose twice,
Mon Sep 7 2009) and hide -q/-v for merge options, while mentioning -q/-v
before the merge- and fetch-specific options.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoDocumentation/git-push: put --quiet before --verbose
Tay Ray Chuan [Wed, 24 Feb 2010 12:50:22 +0000 (20:50 +0800)]
Documentation/git-push: put --quiet before --verbose

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoDocumentation/git-clone: mention progress in -v
Tay Ray Chuan [Wed, 24 Feb 2010 12:50:20 +0000 (20:50 +0800)]
Documentation/git-clone: mention progress in -v

After 5a518ad (clone: use --progress to force progress reporting),
-v/--verbose did not affect whether progress status was reported to
stderr, and users accustomed to using -v to do so since 21188b1
(Implement git clone -v) may be confused.

Mitigate such risks by stating -v does not affect progress in the
documentation.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agobash: completion for gitk aliases
SZEDER Gábor [Tue, 23 Feb 2010 21:03:00 +0000 (22:03 +0100)]
bash: completion for gitk aliases

gitk aliases either start with "!gitk", or look something like "!sh -c
FOO=bar gitk", IOW they contain the "gitk" word.  With this patch the
completion script will recognize these cases and will offer gitk's
options.

Just like the earlier change improving on aliased command recognition,
this change can also be fooled easily by some complex aliases, but
users of such aliases could remedy it with custom completion
functions.

Signed-off-by: SZEDER Gábor <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agobash: support user-supplied completion scripts for aliases
SZEDER Gábor [Tue, 23 Feb 2010 21:02:59 +0000 (22:02 +0100)]
bash: support user-supplied completion scripts for aliases

Shell command aliases can get rather complex, and the completion
script can not always determine correctly the git command invoked by
such an alias.  For such cases users might want to provide custom
completion scripts the same way like for their custom commands made
possible by the previous patch.

The current completion script does not allow this, because if it
encounters an alias, then it will unconditionally perform completion
for the aliased git command (in case it can determine the aliased git
command, of course).  With this patch the completion script will first
search for a completion function for the command given on the command
line, be it a git command, a custom git command of the user, or an
alias, and invoke that function to perform the completion.  This has
no effect on git commands, because they can not be aliased anyway.  If
it is an alias and there is a completion function for that alias (e.g.
_git_foo() for the alias 'foo'), then it will be invoked to perform
completion, allowing users to provide custom completion functions for
aliases.  If such a completion function can not be found, only then
will the completion script check whether the command given on the
command line is an alias or not, and proceed as usual (i.e. find out
the aliased git command and provide completion for it).

Signed-off-by: SZEDER Gábor <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agobash: support user-supplied completion scripts for user's git commands
SZEDER Gábor [Tue, 23 Feb 2010 21:02:58 +0000 (22:02 +0100)]
bash: support user-supplied completion scripts for user's git commands

The bash completion script already provides support to complete
aliases, options and refs for aliases (if the alias can be traced back
to a supported git command by __git_aliased_command()), and the user's
custom git commands, but it does not support the options of the user's
custom git commands (of course; how could it know about the options of
a custom git command?).  Users of such custom git commands could
extend git's bash completion script by writing functions to support
their commands, but they might have issues with it: they might not
have the rights to modify a system-wide git completion script, and
they will need to track and merge upstream changes in the future.

This patch addresses this by providing means for users to supply
custom completion scriplets for their custom git commands without
modifying the main git bash completion script.

Instead of having a huge hard-coded list of command-completion
function pairs (in _git()), the completion script will figure out
which completion function to call based on the command's name.  That
is, when completing the options of 'git foo', the main completion
script will check whether the function '_git_foo' is declared, and if
declared, it will invoke that function to perform the completion.  If
such a function is not declared, it will fall back to complete file
names.  So, users will only need to provide this '_git_foo' completion
function in a separate file, source that file, and it will be used the
next time they press TAB after 'git foo '.

There are two git commands (stage and whatchanged), for which the
completion functions of other commands were used, therefore they
got their own completion function.

Signed-off-by: SZEDER Gábor <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agobash: improve aliased command recognition
SZEDER Gábor [Tue, 23 Feb 2010 21:02:57 +0000 (22:02 +0100)]
bash: improve aliased command recognition

To support completion for aliases, the completion script tries to
figure out which git command is invoked by an alias.  Its
implementation in __git_aliased_command() is rather straightforward:
it returns the first word from the alias.  For simple aliases starting
with the git command (e.g. alias.last = cat-file commit HEAD) this
gives the right results.  Unfortunately, it does not work with shell
command aliases, which can get rather complex, as illustrated by one
of Junio's aliases:

[alias]
    lgm = "!sh -c 'GIT_NOTES_REF=refs/notes/amlog git log \"$@\" || :' -"

In this case the current implementation returns "!sh" as the aliased
git command, which is obviosly wrong.

The full parsing of a shell command alias like that in the completion
code is clearly unfeasible.  However, we can easily improve on aliased
command recognition by eleminating stuff that is definitely not a git
command: shell commands (anything starting with '!'), command line
options (anything starting with '-'), environment variables (anything
with a '=' in it), and git itself.  This way the above alias would be
handled correctly, and the completion script would correctly recognize
"log" as the aliased git command.

Of course, this solution is not perfect either, and could be fooled
easily.  It's not hard to construct an alias, in which a word does not
match any of these filter patterns, but is still not a git command
(e.g.  by setting an environment variable to a value which contains
spaces).  It may even return false positives, when the output of a git
command is piped into an other git command, and the second gets the
command line options via $@, but options for the first one are
offered.  However, the following patches will enable the user to
supply custom completion scripts for aliases, which can be used to
remedy these problematic cases.

Signed-off-by: SZEDER Gábor <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoMerge branch 'maint'
Junio C Hamano [Tue, 23 Feb 2010 22:27:55 +0000 (14:27 -0800)]
Merge branch 'maint'

* maint:
  am: remove rebase-apply directory before gc
  rerere: fix memory leak if rerere images can't be read
  Documentation: mention conflict marker size argument (%L) for merge driver

16 years agoam: remove rebase-apply directory before gc
Jonathan Nieder [Mon, 22 Feb 2010 14:35:46 +0000 (08:35 -0600)]
am: remove rebase-apply directory before gc

When git am does an automatic gc it doesn't clean up the rebase-apply
directory until after this has finished.  This means that if the user
aborts the gc then future am or rebase operations will report that an
existing operation is in progress, which is undesirable and confusing.

Reported by Mark Brown <redacted> through
http://bugs.debian.org/570966

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agorerere: fix memory leak if rerere images can't be read
Bert Wesarg [Tue, 23 Feb 2010 20:11:53 +0000 (21:11 +0100)]
rerere: fix memory leak if rerere images can't be read

Signed-off-by: Bert Wesarg <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoPrint RUNTIME_PREFIX warning only when GIT_TRACE is set
Johannes Sixt [Tue, 23 Feb 2010 11:42:56 +0000 (12:42 +0100)]
Print RUNTIME_PREFIX warning only when GIT_TRACE is set

When RUNTIME_PREFIX is enabled, the installation prefix is derived by
trying a limited set of known locations where the git executable can
reside. If none of these is found, a warning is emitted.

When git is built in a directory that matches neither of these known names,
the warning would always be emitted when the uninstalled executable is run.
This is a problem on Windows, where gitk picks the uninstalled git when
invoked from the build directory and gets confused by the warning.

Print the warning only when GIT_TRACE is set.

Signed-off-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoAllow '+', '-' and '.' in remote helper names
Ilari Liusvaara [Tue, 23 Feb 2010 12:33:48 +0000 (14:33 +0200)]
Allow '+', '-' and '.' in remote helper names

According to relevant RFCs, in addition to alphanumerics, the following
characters are valid in URL scheme parts: '+', '-' and '.', but
currently only alphanumerics are allowed in remote helper names.

Allow those three characters in remote helper names (both 'foo://' and
'foo::' syntax).

Signed-off-by: Ilari Liusvaara <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoDocumentation: mention conflict marker size argument (%L) for merge driver
Bert Wesarg [Tue, 23 Feb 2010 20:11:12 +0000 (21:11 +0100)]
Documentation: mention conflict marker size argument (%L) for merge driver

23a64c9e (conflict-marker-size: new attribute, 2010-01-16) introduced the
new attribute and also pass the conflict marker size as %L to merge driver
commands. This documents the substitution.

Signed-off-by: Bert Wesarg <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agomove encode_in_pack_object_header() to a better place
Nicolas Pitre [Tue, 23 Feb 2010 20:02:37 +0000 (15:02 -0500)]
move encode_in_pack_object_header() to a better place

Commit 1b22b6c897 made duplicated versions of encode_header() into a
common version called encode_in_pack_object_header(). There is however
a better location that sha1_file.c for such a function though, as
sha1_file.c contains nothing related to the creation of packs, and
it is quite populated already.

Also the comment that was moved to the header file should really remain
near the function as it covers implementation details and provides no
information about the actual function interface.

Signed-off-by: Nicolas Pitre <redacted>
Signed-off-by: Junio C Hamano <redacted>
git clone https://git.99rst.org/PROJECT