gitweb.git
Merge 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

Merge 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

Merge 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'

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

Merge 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

fallback SSH_ASKPASS when GIT_ASKPASS not setFrank 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 <lznuaa@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge 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

bisect: error out when passing bad path parametersChristian 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 <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge 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

Git 1.7.0.1 v1.7.0.1Junio C Hamano Sun, 28 Feb 2010 19:41:24 +0000 (11:41 -0800)

Git 1.7.0.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Remove reference to GREP_COLORS from documentationMark 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 <lodatom@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: clarify definition of TEST_OBJSJonathan 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 <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sha1_name: fix segfault caused by invalid index accessMarkus 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 <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git svn: delay importing SVN::Base until it is neededjosh 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 <josh_robb@fastmail.fm>
Acked-by: Eric Wong <normalperson@yhbt.net>

git-svn: Fix discarding of extra parents from svn:mergeinfoTuomas 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 <tuomas.suutari@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>

t9151: Add two new svn:mergeinfo test casesTuomas 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 <tuomas.suutari@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>

t9151: Fix a few commits in the SVN dumpTuomas 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 <tuomas.suutari@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>

Merge 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

Merge branch 'maint-1.6.6' into maintJunio 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

Windows: redirect f[re]open("/dev/null") to f[re]open... 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 <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3301-notes: insert a shbang line in ./fake_editor.shJohannes 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 <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge 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

commit: quote the user name in the exampleMatt 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 <kraai@ftbfs.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ml/maint-grep-doc' into maintJunio 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

Merge 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

am: remove rebase-apply directory before gcJonathan 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 <broonie@debian.org> through
http://bugs.debian.org/570966

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rerere: fix memory leak if rerere images can't be readBert 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 <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: mention conflict marker size argument... 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 <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sha1_file: be paranoid when creating loose objectsNicolas Pitre Sun, 21 Feb 2010 20:48:06 +0000 (15:48 -0500)

sha1_file: be paranoid when creating loose objects

We don't want the data being deflated and stored into loose objects
to be different from what we expect. While the deflated data is
protected by a CRC which is good enough for safe data retrieval
operations, we still want to be doubly sure that the source data used
at object creation time is still what we expected once that data has
been deflated and its CRC32 computed.

The most plausible data corruption may occur if the source file is
modified while Git is deflating and writing it out in a loose object.
Or Git itself could have a bug causing memory corruption. Or even bad
RAM could cause trouble. So it is best to make sure everything is
coherent and checksum protected from beginning to end.

To do so we compute the SHA1 of the data being deflated _after_ the
deflate operation has consumed that data, and make sure it matches
with the expected SHA1. This way we can rely on the CRC32 checked by
the inflate operation to provide a good indication that the data is still
coherent with its SHA1 hash. One pathological case we ignore is when
the data is modified before (or during) deflate call, but changed back
before it is hashed.

There is some overhead of course. Using 'git add' on a set of large files:

Before:

real 0m25.210s
user 0m23.783s
sys 0m1.408s

After:

real 0m26.537s
user 0m25.175s
sys 0m1.358s

The overhead is around 5% for full data coherency guarantee.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ml/maint-grep-doc'Junio C Hamano Sun, 21 Feb 2010 20:01:06 +0000 (12:01 -0800)

Merge branch 'ml/maint-grep-doc'

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

Merge branch 'tc/maint-transport-ls-remote-with-void'Junio C Hamano Sun, 21 Feb 2010 20:01:03 +0000 (12:01 -0800)

Merge branch 'tc/maint-transport-ls-remote-with-void'

* tc/maint-transport-ls-remote-with-void:
transport: add got_remote_refs flag

Merge branch 'hm/maint-imap-send-crlf'Junio C Hamano Sun, 21 Feb 2010 20:00:21 +0000 (12:00 -0800)

Merge branch 'hm/maint-imap-send-crlf'

* hm/maint-imap-send-crlf:
git-imap-send: Convert LF to CRLF before storing patch to draft box

Merge branch 'sp/push-sideband'Junio C Hamano Sun, 21 Feb 2010 20:00:07 +0000 (12:00 -0800)

Merge branch 'sp/push-sideband'

* sp/push-sideband:
receive-pack: Send internal errors over side-band #2
t5401: Use a bare repository for the remote peer
receive-pack: Send hook output over side band #2
receive-pack: Wrap status reports inside side-band-64k
receive-pack: Refactor how capabilities are shown to the client
send-pack: demultiplex a sideband stream with status data
run-command: support custom fd-set in async
run-command: Allow stderr to be a caller supplied pipe

Merge branch 'jc/checkout-detached'Junio C Hamano Sun, 21 Feb 2010 19:59:42 +0000 (11:59 -0800)

Merge branch 'jc/checkout-detached'

* jc/checkout-detached:
Reword "detached HEAD" notification

Merge branch 'jc/maint-fix-test-perm'Junio C Hamano Sun, 21 Feb 2010 19:59:35 +0000 (11:59 -0800)

Merge branch 'jc/maint-fix-test-perm'

* jc/maint-fix-test-perm:
lib-patch-mode.sh: Fix permission
t6000lib: Fix permission

Merge branch 'jn/makefile-script-lib'Junio C Hamano Sun, 21 Feb 2010 19:59:22 +0000 (11:59 -0800)

Merge branch 'jn/makefile-script-lib'

* jn/makefile-script-lib:
Do not install shell libraries executable

Merge branch 'mv/request-pull-modernize'Junio C Hamano Sun, 21 Feb 2010 19:59:17 +0000 (11:59 -0800)

Merge branch 'mv/request-pull-modernize'

* mv/request-pull-modernize:
request-pull: avoid mentioning that the start point is a single commit

hash-object: don't use mmap() for small filesDmitry Potapov Sun, 21 Feb 2010 06:32:19 +0000 (09:32 +0300)

hash-object: don't use mmap() for small files

Using read() instead of mmap() can be 39% speed up for 1Kb files and is
1% speed up 1Mb files. For larger files, it is better to use mmap(),
because the difference between is not significant, and when there is not
enough memory, mmap() performs much better, because it avoids swapping.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sha1_file: don't malloc the whole compressed result... Nicolas Pitre Sun, 21 Feb 2010 04:27:31 +0000 (23:27 -0500)

sha1_file: don't malloc the whole compressed result when writing out objects

There is no real advantage to malloc the whole output buffer and
deflate the data in a single pass when writing loose objects. That is
like only 1% faster while using more memory, especially with large
files where memory usage is far more. It is best to deflate and write
the data out in small chunks reusing the same memory instead.

For example, using 'git add' on a few large files averaging 40 MB ...

Before:
21.45user 1.10system 0:22.57elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+828040outputs (0major+142640minor)pagefaults 0swaps

After:
21.50user 1.25system 0:22.76elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+828040outputs (0major+104408minor)pagefaults 0swaps

While the runtime stayed relatively the same, the number of minor page
faults went down significantly.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sat, 20 Feb 2010 18:38:42 +0000 (10:38 -0800)

Merge branch 'maint'

* maint:
git-p4: fix bug in symlink handling
t1450: fix testcases that were wrongly expecting failure
Documentation: Fix indentation problem in git-commit(1)

git-p4: fix bug in symlink handlingEvan Powers Tue, 16 Feb 2010 08:44:08 +0000 (00:44 -0800)

git-p4: fix bug in symlink handling

Fix inadvertent breakage from b932705 (git-p4: stream from perforce to
speed up clones, 2009-07-30) in the code that strips the trailing '\n'
from p4 print on a symlink. (In practice, contents is of the form
['target\n', ''].)

Signed-off-by: Evan Powers <evan.powers@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1450: fix testcases that were wrongly expecting failureThomas Rast Sat, 20 Feb 2010 00:18:44 +0000 (01:18 +0100)

t1450: fix testcases that were wrongly expecting failure

Almost exactly a year ago in 02a6552 (Test fsck a bit harder), I
introduced two testcases that were expecting failure.

However, the only bug was that the testcases wrote *blobs* because I
forgot to pass -t tag to hash-object. Fix this, and then adjust the
rest of the test to properly check the result.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: Fix indentation problem in git-commit(1)Jacob Helwig Mon, 15 Feb 2010 12:33:06 +0000 (04:33 -0800)

Documentation: Fix indentation problem in git-commit(1)

Ever since the "See linkgit:git-config[1]..." paragraph was added to the
description for --untracked-files (d6293d1), the paragraphs for the
following options were indented at the same level as the "See
linkgit:git-config[1]" paragraph. This problem showed up in the
manpages, but not in the HTML documentation.

While this does fix the alignment of the options following
--untracked-files in the manpage, the "See linkgit..." portion of the
description does not retain its previous indentation level in the
manpages, or HTML documentation.

Signed-off-by: Jacob Helwig <jacob.helwig@gmail.com>
Acked-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Fri, 19 Feb 2010 09:31:42 +0000 (01:31 -0800)

Merge branch 'maint'

* maint:
rm: fix bug in recursive subdirectory removal
Documentation: describe --thin more accurately

Merge branch 'jk/maint-rmdir-fix' into maintJunio C Hamano Fri, 19 Feb 2010 09:31:37 +0000 (01:31 -0800)

Merge branch 'jk/maint-rmdir-fix' into maint

* jk/maint-rmdir-fix:
rm: fix bug in recursive subdirectory removal

rm: fix bug in recursive subdirectory removalJeff King Fri, 19 Feb 2010 05:57:21 +0000 (00:57 -0500)

rm: fix bug in recursive subdirectory removal

If we remove a path in a/deep/subdirectory, we should try to
remove as many trailing components as possible (i.e.,
subdirectory, then deep, then a). However, the test for the
return value of rmdir was reversed, so we only ever deleted
at most one level.

The fix is in remove_path, so "apply" and "merge-recursive"
also are fixed.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add an optional argument for --color optionsMark Lodato Wed, 17 Feb 2010 04:55:58 +0000 (23:55 -0500)

Add an optional argument for --color options

Make git-branch, git-show-branch, git-grep, and all the diff-based
programs accept an optional argument <when> for --color. The argument
is a colorbool: "always", "never", or "auto". If no argument is given,
"always" is used; --no-color is an alias for --color=never. This makes
the command-line interface consistent with other GNU tools, such as `ls'
and `grep', and with the git-config color options. Note that, without
an argument, --color and --no-color work exactly as before.

To implement this, two internal changes were made:

1. Allow the first argument of git_config_colorbool() to be NULL,
in which case it returns -1 if the argument isn't "always", "never",
or "auto".

2. Add OPT_COLOR_FLAG(), OPT__COLOR(), and parse_opt_color_flag_cb()
to the option parsing library. The callback uses
git_config_colorbool(), so color.h is now a dependency
of parse-options.c.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: describe --thin more accuratelyStephen Boyd Thu, 18 Feb 2010 09:10:28 +0000 (01:10 -0800)

Documentation: describe --thin more accurately

The description for --thin was misleading and downright wrong. Correct
it with some inspiration from the description of index-pack's --fix-thin
and some background information from Nicolas Pitre <nico@fluxnic.net>.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Thu, 18 Feb 2010 07:03:46 +0000 (23:03 -0800)

Merge branch 'maint'

* maint:
docs: don't talk about $GIT_DIR/refs/ everywhere

docs: don't talk about $GIT_DIR/refs/ everywhereJeff King Thu, 18 Feb 2010 01:16:20 +0000 (20:16 -0500)

docs: don't talk about $GIT_DIR/refs/ everywhere

It is misleading to say that we pull refs from $GIT_DIR/refs/*, because we
may also consult the packed refs mechanism. These days we tend to treat
the "refs hierarchy" as more of an abstract namespace that happens to be
represented as $GIT_DIR/refs. At best, this is a minor inaccuracy, but at
worst it can confuse users who then look in $GIT_DIR/refs and find that it
is missing some of the refs they expected to see.

This patch drops most uses of "$GIT_DIR/refs/*", changing them into just
"refs/*", under the assumption that users can handle the concept of an
abstract refs namespace. There are a few things to note:

- most cases just dropped the $GIT_DIR/ portion. But for cases where
that left _just_ the word "refs", I changed it to "refs/" to help
indicate that it was a hierarchy. I didn't do the same for longer
paths (e.g., "refs/heads" remained, instead of becoming
"refs/heads/").

- in some cases, no change was made, as the text was explicitly about
unpacked refs (e.g., the discussion in git-pack-refs).

- In some cases it made sense instead to note the existence of packed
refs (e.g., in check-ref-format and rev-parse).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'np/fast-import-idx-v2'Junio C Hamano Wed, 17 Feb 2010 23:28:25 +0000 (15:28 -0800)

Merge branch 'np/fast-import-idx-v2'

* np/fast-import-idx-v2:
fast-import: use the diff_delta() max_delta_size argument
fast-import: honor pack.indexversion and pack.packsizelimit config vars
fast-import: make default pack size unlimited
fast-import: use write_idx_file() instead of custom code
fast-import: use sha1write() for pack data
fast-import: start using struct pack_idx_entry

Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refactor duplicated fill_mm() in checkout and merge... Michael Lukashov Tue, 16 Feb 2010 23:42:55 +0000 (23:42 +0000)

refactor duplicated fill_mm() in checkout and merge-recursive

The following function is duplicated:

fill_mm

Move it to xdiff-interface.c and rename it 'read_mmblob', as suggested
by Junio C Hamano.

Also, change parameters order for consistency with read_mmfile().

Signed-off-by: Michael Lukashov <michael.lukashov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refactor duplicated code in builtin-send-pack.c and... Michael Lukashov Tue, 16 Feb 2010 23:42:52 +0000 (23:42 +0000)

refactor duplicated code in builtin-send-pack.c and transport.c

The following functions are (almost) identical:

verify_remote_names
update_tracking_ref
refs_pushed
print_push_status

Move common versions of these functions to transport.c and rename
them, as suggested by Jeff King and Junio C Hamano.

These functions have been removed entirely from builtin-send-pack.c,
since they are only used internally by print_push_status():

print_ref_status
status_abbrev
print_ok_ref_status
print_one_push_status

Also, move #define SUMMARY_WIDTH to transport.h and rename it
TRANSPORT_SUMMARY_WIDTH as it is used in builtin-fetch.c and
transport.c

Signed-off-by: Michael Lukashov <michael.lukashov@gmail.com>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

connect.c: move duplicated code to a new function ... Michael Lukashov Wed, 17 Feb 2010 20:56:02 +0000 (20:56 +0000)

connect.c: move duplicated code to a new function 'get_host_and_port'

The following functions:

git_tcp_connect_sock (IPV6 version)
git_tcp_connect_sock (no IPV6 version),
git_proxy_connect

have common block of code. Move it to a new function 'get_host_and_port'

Signed-off-by: Michael Lukashov <michael.lukashov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.7.1Junio C Hamano Wed, 17 Feb 2010 23:01:11 +0000 (15:01 -0800)

Update draft release notes to 1.7.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Wed, 17 Feb 2010 23:00:10 +0000 (15:00 -0800)

Merge branch 'maint'

* maint:
Update 1.7.0.1 release notes

Update 1.7.0.1 release notesJunio C Hamano Wed, 17 Feb 2010 23:00:00 +0000 (15:00 -0800)

Update 1.7.0.1 release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jk/cherry-pick-reword' into maintJunio C Hamano Wed, 17 Feb 2010 22:55:24 +0000 (14:55 -0800)

Merge branch 'jk/cherry-pick-reword' into maint

* jk/cherry-pick-reword:
cherry-pick: prettify the advice message
cherry-pick: show commit name instead of sha1
cherry-pick: format help message as strbuf
cherry-pick: refactor commit parsing code
cherry-pick: rewrap advice message

Merge branch 'jk/grep-double-dash' into maintJunio C Hamano Wed, 17 Feb 2010 22:55:15 +0000 (14:55 -0800)

Merge branch 'jk/grep-double-dash' into maint

* jk/grep-double-dash:
accept "git grep -- pattern"

Merge branch 'jc/typo' into maintJunio C Hamano Wed, 17 Feb 2010 22:55:09 +0000 (14:55 -0800)

Merge branch 'jc/typo' into maint

* jc/typo:
Typofixes outside documentation area

status: preload index to optimize lstat(2) callsJunio C Hamano Wed, 17 Feb 2010 20:30:41 +0000 (12:30 -0800)

status: preload index to optimize lstat(2) calls

Noticed by James Pickens

Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Protect escaping functions against calling... Jakub Narebski Sun, 7 Feb 2010 20:52:25 +0000 (21:52 +0100)

gitweb: Protect escaping functions against calling on undef

This is a bit of future-proofing esc_html and friends: when called
with undefined value they would now would return undef... which would
probably mean that error would still occur, but closer to the source
of problem.

This means that we can safely use
esc_html(shift) || "Internal Server Error"
in die_error() instead of
esc_html(shift || "Internal Server Error")

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: esc_html (short) error message in die_errorJakub Narebski Sun, 7 Feb 2010 20:51:18 +0000 (21:51 +0100)

gitweb: esc_html (short) error message in die_error

The error message (second argument to die_error) is meant to be short,
one-line text description of given error. A few callers call
die_error with error message containing unescaped user supplied data
($hash, $file_name). Instead of forcing callers to escape data,
simply call esc_html on the parameter.

Note that optional third parameter, which contains detailed error
description, is meant to be HTML formatted, and therefore should be
not escaped.

While at it update esc_html synopsis/usage, and bring default error
description to read 'Internal Server Error' (titlecased).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule summary: Don't barf when invoked in an empty... Johan Herland Tue, 16 Feb 2010 10:21:14 +0000 (11:21 +0100)

submodule summary: Don't barf when invoked in an empty repo

When invoking "git submodule summary" in an empty repo (which can be
indirectly done by setting status.submodulesummary = true), it currently
emits an error message (via "git diff-index") since HEAD points to an
unborn branch.

This patch adds handling of the HEAD-points-to-unborn-branch special case,
so that "git submodule summary" no longer emits this error message.

The patch also adds a test case that verifies the fix.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: use the diff_delta() max_delta_size argumentNicolas Pitre Wed, 17 Feb 2010 19:05:56 +0000 (14:05 -0500)

fast-import: use the diff_delta() max_delta_size argument

This let diff_delta() abort early if it is going to bust the given
size limit. Also, only objects larger than 20 bytes are considered
as objects smaller than that are most certainly going to produce
larger deltas than the original object due to the additional headers.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: honor pack.indexversion and pack.packsizel... Nicolas Pitre Wed, 17 Feb 2010 19:05:55 +0000 (14:05 -0500)

fast-import: honor pack.indexversion and pack.packsizelimit config vars

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: make default pack size unlimitedNicolas Pitre Wed, 17 Feb 2010 19:05:54 +0000 (14:05 -0500)

fast-import: make default pack size unlimited

Now that fast-import is creating packs with index version 2, there is
no point limiting the pack size by default. A pack split will still
happen if off_t is not sufficiently large to hold large offsets.

While updating the doc, let's remove the "packfiles fit on CDs"
suggestion. Pack files created by fast-import are still suboptimal and
a 'git repack -a -f -d' or even 'git gc --aggressive' would be a pretty
good idea before considering storage on CDs.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: use write_idx_file() instead of custom... Nicolas Pitre Wed, 17 Feb 2010 19:05:53 +0000 (14:05 -0500)

fast-import: use write_idx_file() instead of custom code

This allows for the creation of pack index version 2 with its object
CRC and the possibility for a pack to be larger than 4 GB.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: use sha1write() for pack dataNicolas Pitre Wed, 17 Feb 2010 19:05:52 +0000 (14:05 -0500)

fast-import: use sha1write() for pack data

This is in preparation for using write_idx_file(). Also, by using
sha1write() we get some buffering to reduces the number of write
syscalls, and the written data is SHA1 summed which allows for the extra
data integrity validation check performed in fixup_pack_header_footer()
(details on this in commit abeb40e5aa).

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: start using struct pack_idx_entryNicolas Pitre Wed, 17 Feb 2010 19:05:51 +0000 (14:05 -0500)

fast-import: start using struct pack_idx_entry

This is in preparation for using write_idx_file().

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

require_work_tree broken with NONGIT_OKGabriel Filion Wed, 17 Feb 2010 04:18:50 +0000 (23:18 -0500)

require_work_tree broken with NONGIT_OK

With NONGIT_OK set, require_work_tree function outside a git repository
gives a syntax error. This is caused by an incorrect use of "test" that
didn't anticipate $(git rev-parse --is-inside-work-tree) may return an
empty string.

Properly quote the argument to "test", and send the standard error stream
to /dev/null to avoid giving duplicate error messages.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

imap-send: support CRAM-MD5 authenticationHitoshi Mitake Tue, 16 Feb 2010 06:34:07 +0000 (22:34 -0800)

imap-send: support CRAM-MD5 authentication

CRAM-MD5 authentication ought to be independent from SSL, but NO_OPENSSL
build will not support this because the base64 and md5 code are used from
the OpenSSL library in this implementation.

Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep documentation: clarify what files matchMark Lodato Tue, 16 Feb 2010 00:25:40 +0000 (19:25 -0500)

grep documentation: clarify what files match

Clarify that git-grep(1) searches only tracked files, and that each
<pathspec> is a pathspec, as in any other ordinary git commands.

Add an example to show a simple use case for searching all .c and .h
files in the current directory and below.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/typo'Junio C Hamano Wed, 17 Feb 2010 06:45:14 +0000 (22:45 -0800)

Merge branch 'jc/typo'

* jc/typo:
Typofixes outside documentation area

Merge branch 'maint'Junio C Hamano Wed, 17 Feb 2010 06:40:45 +0000 (22:40 -0800)

Merge branch 'maint'

* maint:
Prepare 1.7.0.1 release notes
Fix use of mutex in threaded grep
dwim_ref: fix dangling symref warning
stash pop: remove 'apply' options during 'drop' invocation
diff: make sure --output=/bad/path is caught
Remove hyphen from "git-command" in two error messages

Prepare 1.7.0.1 release notesJunio C Hamano Wed, 17 Feb 2010 06:25:03 +0000 (22:25 -0800)

Prepare 1.7.0.1 release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/maint-grep-one-thread-mutex-fix' into... Junio C Hamano Wed, 17 Feb 2010 06:23:25 +0000 (22:23 -0800)

Merge branch 'jc/maint-grep-one-thread-mutex-fix' into maint

* jc/maint-grep-one-thread-mutex-fix:
Fix use of mutex in threaded grep

Fix use of mutex in threaded grepJunio C Hamano Tue, 16 Feb 2010 02:34:28 +0000 (18:34 -0800)

Fix use of mutex in threaded grep

The program can decide at runtime not to use threading even if the support
is compiled in. In such a case, mutexes are not necessary and left
uninitialized. But the code incorrectly tried to take and release the
read_sha1_mutex unconditionally.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Fredrik Kuivinen <frekui@gmail.com>

Merge branch 'maint-1.6.6' into maintJunio C Hamano Tue, 16 Feb 2010 23:05:02 +0000 (15:05 -0800)

Merge branch 'maint-1.6.6' into maint

* maint-1.6.6:
dwim_ref: fix dangling symref warning
stash pop: remove 'apply' options during 'drop' invocation
diff: make sure --output=/bad/path is caught
Remove hyphen from "git-command" in two error messages

Merge branch 'maint-1.6.5' into maint-1.6.6Junio C Hamano Tue, 16 Feb 2010 23:04:55 +0000 (15:04 -0800)

Merge branch 'maint-1.6.5' into maint-1.6.6

* maint-1.6.5:
dwim_ref: fix dangling symref warning
stash pop: remove 'apply' options during 'drop' invocation
diff: make sure --output=/bad/path is caught

transport: add got_remote_refs flagTay Ray Chuan Tue, 16 Feb 2010 07:18:21 +0000 (15:18 +0800)

transport: add got_remote_refs flag

transport_get_remote_refs() in tranport.c checks transport->remote_refs
to determine whether transport->get_refs_list() should be invoked. The
logic is "if it is NULL, we haven't run ls-remote to find out yet".

However, transport->remote_refs could still be NULL while cloning from
an empty repository. This causes get_refs_list() to be run unnecessarily.

Introduce a flag, transport->got_remote_refs, to more explicitly record
if we have run transport->get_refs_list() already.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dwim_ref: fix dangling symref warningJeff King Tue, 16 Feb 2010 07:03:16 +0000 (02:03 -0500)

dwim_ref: fix dangling symref warning

If we encounter a symref that is dangling, in most cases we will warn
about it. The one exception is a dangling HEAD, as that indicates a
branch yet to be born.

However, the check in dwim_ref was not quite right. If we were fed
something like "HEAD^0" we would try to resolve "HEAD", see that it is
dangling, and then check whether the _original_ string we got was
"HEAD" (which it wasn't in this case). And that makes no sense; the
dangling thing we found was not "HEAD^0" but rather "HEAD".

Fixing this squelches a scary warning from "submodule summary HEAD" (and
consequently "git status" with status.submodulesummary set) in an empty
repo, as the submodule script calls "git rev-parse -q --verify HEAD^0".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stash pop: remove 'apply' options during 'drop' invocationThomas Rast Mon, 15 Feb 2010 16:05:46 +0000 (17:05 +0100)

stash pop: remove 'apply' options during 'drop' invocation

The 'git stash pop' option parsing used to remove the first argument
in --index mode. At the time this was implemented, this first
argument was always --index. However, since the invention of the -q
option in fcdd0e9 (stash: teach quiet option, 2009-06-17) you can
cause an internal invocation of

git stash drop --index

by running

git stash pop -q --index

which then of course fails because drop doesn't know --index.

To handle this, instead let 'git stash apply' decide what the future
argument to 'drop' should be.

Warning: this means that 'git stash apply' must parse all options that
'drop' can take, and deal with them in the same way. This is
currently true for its only option -q.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: make sure --output=/bad/path is caughtLarry D'Anna Tue, 16 Feb 2010 04:10:45 +0000 (23:10 -0500)

diff: make sure --output=/bad/path is caught

The return value from fopen wasn't being checked.

Signed-off-by: Larry D'Anna <larry@elder-gods.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Remove hyphen from "git-command" in two error messagesPete Harlan Mon, 15 Feb 2010 23:33:18 +0000 (15:33 -0800)

Remove hyphen from "git-command" in two error messages

Signed-off-by: Pete Harlan <pgit@pcharlan.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Mon, 15 Feb 2010 02:59:20 +0000 (18:59 -0800)

Merge branch 'maint'

* maint:
fix minor memory leak in get_tree_entry()

Merge branch 'maint-1.6.6' into maintJunio C Hamano Mon, 15 Feb 2010 02:59:14 +0000 (18:59 -0800)

Merge branch 'maint-1.6.6' into maint

* maint-1.6.6:
fix minor memory leak in get_tree_entry()

fix minor memory leak in get_tree_entry()René Scharfe Sun, 14 Feb 2010 09:56:46 +0000 (10:56 +0100)

fix minor memory leak in get_tree_entry()

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sat, 13 Feb 2010 23:14:04 +0000 (15:14 -0800)

Merge branch 'maint'

* maint:
Start 1.7.0 maintenance track

Conflicts:
RelNotes

Merge branch 'rs/git-dir-cleanup'Junio C Hamano Sat, 13 Feb 2010 23:09:33 +0000 (15:09 -0800)

Merge branch 'rs/git-dir-cleanup'

* rs/git-dir-cleanup:
Resurrect "git grep --no-index"
setenv(GIT_DIR) clean-up

Conflicts:
builtin-grep.c
t/t7002-grep.sh

Merge branch 'jk/cherry-pick-reword'Junio C Hamano Sat, 13 Feb 2010 23:09:33 +0000 (15:09 -0800)

Merge branch 'jk/cherry-pick-reword'

* jk/cherry-pick-reword:
cherry-pick: prettify the advice message
cherry-pick: show commit name instead of sha1
cherry-pick: format help message as strbuf
cherry-pick: refactor commit parsing code
cherry-pick: rewrap advice message

Merge branch 'jk/grep-double-dash'Junio C Hamano Sat, 13 Feb 2010 23:09:33 +0000 (15:09 -0800)

Merge branch 'jk/grep-double-dash'

* jk/grep-double-dash:
accept "git grep -- pattern"