gitweb.git
Merge branch 'rs/submodule-summary-limit'Junio C Hamano Wed, 3 Apr 2013 16:34:46 +0000 (09:34 -0700)

Merge branch 'rs/submodule-summary-limit'

"submodule summary --summary-limit" option did not support
"--option=value" form.

* rs/submodule-summary-limit:
submodule summary: support --summary-limit=<n>

Merge branch 'tr/valgrind'Junio C Hamano Wed, 3 Apr 2013 16:34:44 +0000 (09:34 -0700)

Merge branch 'tr/valgrind'

Let us use not just memgrind but other *grind debuggers.

* tr/valgrind:
tests: notice valgrind error in test_must_fail
tests --valgrind: provide a mode without --track-origins
tests: parameterize --valgrind option
t/README: --valgrind already implies -v

Merge branch 'rr/prompt-revert-head'Junio C Hamano Wed, 3 Apr 2013 16:34:43 +0000 (09:34 -0700)

Merge branch 'rr/prompt-revert-head'

The prompt string generator did not notice when we are in a middle
of a "git revert" session.

* rr/prompt-revert-head:
bash: teach __git_ps1 about REVERT_HEAD

Merge branch 'jm/branch-rename-nothing-error'Junio C Hamano Wed, 3 Apr 2013 16:34:40 +0000 (09:34 -0700)

Merge branch 'jm/branch-rename-nothing-error'

"git branch -m" without any argument noticed an error, but with an
incorrect error message.

* jm/branch-rename-nothing-error:
branch: give better message when no names specified for rename

Merge branch 'js/iterm-is-on-osx'Junio C Hamano Wed, 3 Apr 2013 16:34:37 +0000 (09:34 -0700)

Merge branch 'js/iterm-is-on-osx'

Add more logic to detect graphic environment of OS X by simply
checking TERM_PROGRAM has some value, not Apple_Terminal, to detect
iTerm.app and any other.

* js/iterm-is-on-osx:
git-web--browse: recognize any TERM_PROGRAM as a GUI terminal on OS X

Merge branch 'jk/check-corrupt-objects-carefully'Junio C Hamano Wed, 3 Apr 2013 16:34:28 +0000 (09:34 -0700)

Merge branch 'jk/check-corrupt-objects-carefully'

Have the streaming interface and other codepaths more carefully
examine for corrupt objects.

* jk/check-corrupt-objects-carefully:
clone: leave repo in place after checkout errors
clone: run check_everything_connected
clone: die on errors from unpack_trees
add tests for cloning corrupted repositories
streaming_write_entry: propagate streaming errors
add test for streaming corrupt blobs
avoid infinite loop in read_istream_loose
read_istream_filtered: propagate read error from upstream
check_sha1_signature: check return value from read_istream
stream_blob_to_fd: detect errors reading from stream

Merge branch 'jc/apply-ws-fix-tab-in-indent'Junio C Hamano Wed, 3 Apr 2013 16:34:22 +0000 (09:34 -0700)

Merge branch 'jc/apply-ws-fix-tab-in-indent'

"git apply --whitespace=fix" was not prepared to see a line getting
longer after fixing whitespaces (e.g. tab-in-indent aka Python).

* jc/apply-ws-fix-tab-in-indent:
test: resurrect q_to_tab
apply --whitespace=fix: avoid running over the postimage buffer

Merge branch 'jk/difftool-no-overwrite-on-copyback'Junio C Hamano Wed, 3 Apr 2013 16:34:09 +0000 (09:34 -0700)

Merge branch 'jk/difftool-no-overwrite-on-copyback'

Try to be careful when difftool backend allows the user to write
into the temporary files being shown *and* the user makes changes
to the working tree at the same time. One of the changes has to be
lost in such a case, but at least tell the user what he did.

* jk/difftool-no-overwrite-on-copyback:
t7800: run --dir-diff tests with and without symlinks
t7800: fix tests when difftool uses --no-symlinks
t7800: don't hide grep output
difftool: don't overwrite modified files
t7800: move '--symlinks' specific test to the end

Merge branch 'jc/directory-attrs-regression-fix'Junio C Hamano Wed, 3 Apr 2013 16:34:04 +0000 (09:34 -0700)

Merge branch 'jc/directory-attrs-regression-fix'

Fix 1.8.1.x regression that stopped matching "dir" (without
trailing slash) to a directory "dir".

* jc/directory-attrs-regression-fix:
t: check that a pattern without trailing slash matches a directory
dir.c::match_pathname(): pay attention to the length of string parameters
dir.c::match_pathname(): adjust patternlen when shifting pattern
dir.c::match_basename(): pay attention to the length of string parameters
attr.c::path_matches(): special case paths that end with a slash
attr.c::path_matches(): the basename is part of the pathname

Merge branch 'nd/checkout-paths-reduce-match-pathspec... Junio C Hamano Wed, 3 Apr 2013 16:34:00 +0000 (09:34 -0700)

Merge branch 'nd/checkout-paths-reduce-match-pathspec-calls'

Consolidate repeated pathspec matches on the same paths, while
fixing a bug in "git checkout dir/" code started from an unmerged
index.

* nd/checkout-paths-reduce-match-pathspec-calls:
checkout: avoid unnecessary match_pathspec calls

Update draft release notes to 1.8.3Junio C Hamano Tue, 2 Apr 2013 22:14:26 +0000 (15:14 -0700)

Update draft release notes to 1.8.3

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

Merge branch 'jk/config-with-empty-section'Junio C Hamano Tue, 2 Apr 2013 22:10:53 +0000 (15:10 -0700)

Merge branch 'jk/config-with-empty-section'

Document that "git config --unset" does not remove an empty section
head after removing the last variable in a section, and adding a
new variable does not try to reuse a leftover empty section head.

* jk/config-with-empty-section:
t1300: document some aesthetic failures of the config editor

Merge branch 'js/log-gpg'Junio C Hamano Tue, 2 Apr 2013 22:10:49 +0000 (15:10 -0700)

Merge branch 'js/log-gpg'

Teach "show/log" honor gpg.program configuration just like other
parts of the code that use GnuPG.

* js/log-gpg:
log: read gpg settings for signed commit verification

Merge branch 'tr/log-tree-optim'Junio C Hamano Tue, 2 Apr 2013 22:10:46 +0000 (15:10 -0700)

Merge branch 'tr/log-tree-optim'

Optimize "log" that shows the difference between the parent and the
child.

* tr/log-tree-optim:
Avoid loading commits twice in log with diffs

Merge branch 'tb/cygwin-shared-repository'Junio C Hamano Tue, 2 Apr 2013 22:09:54 +0000 (15:09 -0700)

Merge branch 'tb/cygwin-shared-repository'

Cygwin port has a faster-but-lying lstat(2) emulation whose
incorrectness does not matter in practice except for a few
codepaths, and setting permission bits to directories is a codepath
that needs to use a more correct one.

* tb/cygwin-shared-repository:
Make core.sharedRepository work under cygwin 1.7

Merge branch 'sw/safe-create-leading-dir-race'Junio C Hamano Tue, 2 Apr 2013 22:09:48 +0000 (15:09 -0700)

Merge branch 'sw/safe-create-leading-dir-race'

* sw/safe-create-leading-dir-race:
safe_create_leading_directories: fix race that could give a false negative

Merge branch 'bk/document-commit-tree-S'Junio C Hamano Tue, 2 Apr 2013 22:09:43 +0000 (15:09 -0700)

Merge branch 'bk/document-commit-tree-S'

* bk/document-commit-tree-S:
commit-tree: document -S option consistently

Merge branch 'jk/no-more-self-assignment'Junio C Hamano Tue, 2 Apr 2013 22:09:35 +0000 (15:09 -0700)

Merge branch 'jk/no-more-self-assignment'

This started as a topic to reduce "type var = var" self assignment
tricks that were used to squelch "variable used uninitialized perhaps?"
warning from some compilers, but resulted in rewriting logic with
a version that is simpler and easier to understand for humans.

* jk/no-more-self-assignment:
match-trees: simplify score_trees() using tree_entry()
submodule: clarify logic in show_submodule_summary

Update draft release notes to 1.8.3Junio C Hamano Mon, 1 Apr 2013 16:13:31 +0000 (09:13 -0700)

Update draft release notes to 1.8.3

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

Merge branch 'maint'Junio C Hamano Mon, 1 Apr 2013 16:23:30 +0000 (09:23 -0700)

Merge branch 'maint'

* maint:
Update draft release notes to 1.8.2.1

Update draft release notes to 1.8.2.1Junio C Hamano Mon, 1 Apr 2013 16:23:05 +0000 (09:23 -0700)

Update draft release notes to 1.8.2.1

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

Merge branch 'ap/maint-diff-rename-avoid-overlap' into... Junio C Hamano Mon, 1 Apr 2013 16:19:46 +0000 (09:19 -0700)

Merge branch 'ap/maint-diff-rename-avoid-overlap' into maint

* ap/maint-diff-rename-avoid-overlap:
tests: make sure rename pretty print works
diff: prevent pprint_rename from underrunning input
diff: Fix rename pretty-print when suffix and prefix overlap

Merge branch 'rr/tests-dedup-test-config' into maintJunio C Hamano Mon, 1 Apr 2013 16:19:41 +0000 (09:19 -0700)

Merge branch 'rr/tests-dedup-test-config' into maint

* rr/tests-dedup-test-config:
t4018,7810,7811: remove test_config() redefinition

Merge branch 'yd/doc-is-in-asciidoc' into maintJunio C Hamano Mon, 1 Apr 2013 16:19:40 +0000 (09:19 -0700)

Merge branch 'yd/doc-is-in-asciidoc' into maint

* yd/doc-is-in-asciidoc:
CodingGuidelines: our documents are in AsciiDoc

Merge branch 'yd/doc-merge-annotated-tag' into maintJunio C Hamano Mon, 1 Apr 2013 16:19:37 +0000 (09:19 -0700)

Merge branch 'yd/doc-merge-annotated-tag' into maint

* yd/doc-merge-annotated-tag:
Documentation: merging a tag is a special case

Merge branch 'tb/document-status-u-tradeoff' into maintJunio C Hamano Mon, 1 Apr 2013 16:19:30 +0000 (09:19 -0700)

Merge branch 'tb/document-status-u-tradeoff' into maint

* tb/document-status-u-tradeoff:
status: advise to consider use of -u when read_directory takes too long
git status: document trade-offs in choosing parameters to the -u option

Merge branch 'da/downcase-u-in-usage' into maintJunio C Hamano Mon, 1 Apr 2013 16:19:04 +0000 (09:19 -0700)

Merge branch 'da/downcase-u-in-usage' into maint

* da/downcase-u-in-usage:
contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" string
contrib/examples/git-remote.perl: use a lowercase "usage:" string
tests: use a lowercase "usage:" string
git-svn: use a lowercase "usage:" string
Documentation/user-manual.txt: use a lowercase "usage:" string
templates/hooks--update.sample: use a lowercase "usage:" string
contrib/hooks/setgitperms.perl: use a lowercase "usage:" string
contrib/examples: use a lowercase "usage:" string
contrib/fast-import/import-zips.py: use spaces instead of tabs
contrib/fast-import/import-zips.py: fix broken error message
contrib/fast-import: use a lowercase "usage:" string
contrib/credential: use a lowercase "usage:" string
git-cvsimport: use a lowercase "usage:" string
git-cvsimport: use a lowercase "usage:" string
git-cvsexportcommit: use a lowercase "usage:" string
git-archimport: use a lowercase "usage:" string
git-merge-one-file: use a lowercase "usage:" string
git-relink: use a lowercase "usage:" string
git-svn: use a lowercase "usage:" string
git-sh-setup: use a lowercase "usage:" string

Merge branch 'nd/index-pack-threaded-fixes'Junio C Hamano Mon, 1 Apr 2013 16:06:23 +0000 (09:06 -0700)

Merge branch 'nd/index-pack-threaded-fixes'

"index-pack --verify-stat" used a few counters outside protection
of mutex, possibly showing incorrect numbers.

* nd/index-pack-threaded-fixes:
index-pack: guard nr_resolved_deltas reads by lock
index-pack: protect deepest_delta in multithread code

Merge branch 'jk/index-pack-correct-depth-fix'Junio C Hamano Mon, 1 Apr 2013 16:06:19 +0000 (09:06 -0700)

Merge branch 'jk/index-pack-correct-depth-fix'

"index-pack --fix-thin" used uninitialize value to compute delta
depths of objects it appends to the resulting pack.

* jk/index-pack-correct-depth-fix:
index-pack: always zero-initialize object_entry list

Merge branch 'jn/push-tests'Junio C Hamano Mon, 1 Apr 2013 16:06:15 +0000 (09:06 -0700)

Merge branch 'jn/push-tests'

Update t5516 with style fixes.

* jn/push-tests:
push test: rely on &&-chaining instead of 'if bad; then echo Oops; fi'
push test: simplify check of push result
push test: use test_config when appropriate

Merge branch 'nd/branch-show-rebase-bisect-state'Junio C Hamano Mon, 1 Apr 2013 16:05:45 +0000 (09:05 -0700)

Merge branch 'nd/branch-show-rebase-bisect-state'

Add a bit more information to "git status" during a rebase/bisect
session.

* nd/branch-show-rebase-bisect-state:
status, branch: fix the misleading "bisecting" message
branch: show more information when HEAD is detached
status: show more info than "currently not on any branch"
wt-status: move wt_status_get_state() out to wt_status_print()
wt-status: split wt_status_state parsing function out
wt-status: move strbuf into read_and_strip_branch()

Merge branch 'jc/nobody-sets-src-peer-ref'Junio C Hamano Mon, 1 Apr 2013 16:05:35 +0000 (09:05 -0700)

Merge branch 'jc/nobody-sets-src-peer-ref'

Dead code removal.

* jc/nobody-sets-src-peer-ref:
match_push_refs(): nobody sets src->peer_ref anymore

Merge branch 'jc/remove-export-from-config-mak-in'Junio C Hamano Mon, 1 Apr 2013 16:00:01 +0000 (09:00 -0700)

Merge branch 'jc/remove-export-from-config-mak-in'

Stop exporting mandir that used to be exported only when
config.mak.autogen was used. It would have broken installation of
manpages (but not other documentation formats).

* jc/remove-export-from-config-mak-in:
Fix `make install` when configured with autoconf
Makefile: do not export mandir/htmldir/infodir
config.mak.in: remove unused definitions

Merge branch 'kb/name-hash'Junio C Hamano Mon, 1 Apr 2013 15:59:53 +0000 (08:59 -0700)

Merge branch 'kb/name-hash'

The code to keep track of what directory names are known to Git on
platforms with case insensitive filesystems can get confused upon
a hash collision between these pathnames and looped forever.

* kb/name-hash:
name-hash.c: fix endless loop with core.ignorecase=true

Merge branch 'jk/common-make-variables-export-safety'Junio C Hamano Mon, 1 Apr 2013 15:59:47 +0000 (08:59 -0700)

Merge branch 'jk/common-make-variables-export-safety'

Make the three variables safer to be exported to submakes by
ensuring that they are full paths so that they can be used as
installation location.

* jk/common-make-variables-export-safety:
Makefile: make mandir, htmldir and infodir absolute

Merge branch 'jk/pkt-line-cleanup'Junio C Hamano Mon, 1 Apr 2013 15:59:37 +0000 (08:59 -0700)

Merge branch 'jk/pkt-line-cleanup'

Clean up pkt-line API, implementation and its callers to make them
more robust.

* jk/pkt-line-cleanup:
do not use GIT_TRACE_PACKET=3 in tests
remote-curl: always parse incoming refs
remote-curl: move ref-parsing code up in file
remote-curl: pass buffer straight to get_remote_heads
teach get_remote_heads to read from a memory buffer
pkt-line: share buffer/descriptor reading implementation
pkt-line: provide a LARGE_PACKET_MAX static buffer
pkt-line: move LARGE_PACKET_MAX definition from sideband
pkt-line: teach packet_read_line to chomp newlines
pkt-line: provide a generic reading function with options
pkt-line: drop safe_write function
pkt-line: move a misplaced comment
write_or_die: raise SIGPIPE when we get EPIPE
upload-archive: use argv_array to store client arguments
upload-archive: do not copy repo name
send-pack: prefer prefixcmp over memcmp in receive_status
fetch-pack: fix out-of-bounds buffer offset in get_ack
upload-pack: remove packet debugging harness
upload-pack: do not add duplicate objects to shallow list
upload-pack: use get_sha1_hex to parse "shallow" lines

Merge branch 'bc/append-signed-off-by'Junio C Hamano Mon, 1 Apr 2013 15:59:23 +0000 (08:59 -0700)

Merge branch 'bc/append-signed-off-by'

Consolidate codepaths that inspect log-message-to-be and decide to
add a new Signed-off-by line in various commands.

* bc/append-signed-off-by:
git-commit: populate the edit buffer with 2 blank lines before s-o-b
Unify appending signoff in format-patch, commit and sequencer
format-patch: update append_signoff prototype
t4014: more tests about appending s-o-b lines
sequencer.c: teach append_signoff to avoid adding a duplicate newline
sequencer.c: teach append_signoff how to detect duplicate s-o-b
sequencer.c: always separate "(cherry picked from" from commit body
sequencer.c: require a conforming footer to be preceded by a blank line
sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footer
t/t3511: add some tests of 'cherry-pick -s' functionality
t/test-lib-functions.sh: allow to specify the tag name to test_commit
commit, cherry-pick -s: remove broken support for multiline rfc2822 fields
sequencer.c: rework search for start of footer to improve clarity

Merge branch 'sr/am-show-final-message-in-applying... Junio C Hamano Mon, 1 Apr 2013 15:59:18 +0000 (08:59 -0700)

Merge branch 'sr/am-show-final-message-in-applying-indicator'

In addition to the case where the user edits the log message with
the "e)dit" option of "am -i", replace the "Applying: this patch"
message with the final log message contents after applymsg hook
munges it.

* sr/am-show-final-message-in-applying-indicator:
git-am: show the final log message on "Applying:" indicator

Merge branch 'rr/test-3200-style'Junio C Hamano Mon, 1 Apr 2013 15:59:14 +0000 (08:59 -0700)

Merge branch 'rr/test-3200-style'

Churns.

* rr/test-3200-style:
t3200 (branch): modernize style

tests: notice valgrind error in test_must_failThomas Rast Sun, 31 Mar 2013 08:37:25 +0000 (10:37 +0200)

tests: notice valgrind error in test_must_fail

We tell valgrind to return 126 if it notices that something is wrong,
but we did not actually handle this in test_must_fail, leading to
false negatives. Catch and report it.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests --valgrind: provide a mode without --track-originsThomas Rast Sun, 31 Mar 2013 08:00:17 +0000 (10:00 +0200)

tests --valgrind: provide a mode without --track-origins

With --valgrind=memcheck-fast, the tests run under memcheck but
without the autodetected --track-origins. If you just run valgrind to
see *if* there is any memory issue with your program, the extra
information is not needed, and it comes at a roughly 30% hit in
runtime.

While it is possible to achieve the same through GIT_VALGRIND_OPTIONS,
this should be more discoverable and hopefully encourage more users to
run their tests with valgrind.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: parameterize --valgrind optionThomas Rast Sun, 31 Mar 2013 08:00:16 +0000 (10:00 +0200)

tests: parameterize --valgrind option

Running tests under helgrind and DRD recently proved useful in
tracking down thread interaction issues. This can unfortunately not
be done through GIT_VALGRIND_OPTIONS because any tool other than
memcheck would complain about unknown options.

Let --valgrind take an optional parameter that describes the valgrind
tool to invoke. The default mode is to run memcheck as before.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/README: --valgrind already implies -vThomas Rast Sun, 31 Mar 2013 08:00:15 +0000 (10:00 +0200)

t/README: --valgrind already implies -v

This was missed in 3da9365 (Tests: let --valgrind imply --verbose and
--tee, 2009-02-04).

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule summary: support --summary-limit=<n>René Scharfe Mon, 1 Apr 2013 13:06:27 +0000 (15:06 +0200)

submodule summary: support --summary-limit=<n>

In addition to "--summary-limit <n>" support the form "--summary-limit=<n>",
for consistency with other parameters and commands.

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

branch: give better message when no names specified... Jonathon Mah Sun, 31 Mar 2013 01:27:44 +0000 (18:27 -0700)

branch: give better message when no names specified for rename

Signed-off-by: Jonathon Mah <me@JonathonMah.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Mon, 1 Apr 2013 02:27:54 +0000 (19:27 -0700)

Merge branch 'maint'

* maint:
cat-file: Fix an gcc -Wuninitialized warning
fast-import: Fix an gcc -Wuninitialized warning

bash: teach __git_ps1 about REVERT_HEADRobin Rosenberg Sun, 31 Mar 2013 00:30:48 +0000 (01:30 +0100)

bash: teach __git_ps1 about REVERT_HEAD

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cat-file: Fix an gcc -Wuninitialized warningRamsay Jones Tue, 26 Mar 2013 19:20:11 +0000 (19:20 +0000)

cat-file: Fix an gcc -Wuninitialized warning

After commit cbfd5e1c ("drop some obsolete "x = x" compiler warning
hacks", 21-03-2013) removed a gcc specific hack, older versions of
gcc now issue an "'contents' might be used uninitialized" warning.
In order to suppress the warning, we simply initialize the variable
to NULL in it's declaration.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: Fix an gcc -Wuninitialized warningRamsay Jones Tue, 26 Mar 2013 19:09:44 +0000 (19:09 +0000)

fast-import: Fix an gcc -Wuninitialized warning

Commit cbfd5e1c ("drop some obsolete "x = x" compiler warning hacks",
21-03-2013) removed a gcc hack that suppressed an "might be used
uninitialized" warning issued by older versions of gcc.

However, commit 3aa99df8 ('fast-import: clarify "inline" logic in
file_change_m', 21-03-2013) addresses an (almost) identical issue
(with very similar code), but includes additional code in it's
resolution. The solution used by this commit, unlike that used by
commit cbfd5e1c, also suppresses the -Wuninitialized warning on
older versions of gcc.

In order to suppress the warning (against the 'oe' symbol) in the
note_change_n() function, we adopt the same solution used by commit
3aa99df8.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-web--browse: recognize any TERM_PROGRAM as a GUI... John Szakmeister Mon, 25 Mar 2013 10:13:18 +0000 (06:13 -0400)

git-web--browse: recognize any TERM_PROGRAM as a GUI terminal on OS X

It turns out that the presence of SECURITYSESSIONID is not sufficient
for detecting the presence of a GUI under Mac OS X. SECURITYSESSIONID
appears to only be set when the user has Screen Sharing enabled.
Disabling Screen Sharing and relaunching the shell showed that the
variable was missing, at least under Mac OS X 10.6.8.

On the other hand, TERM_PROGRAM seems to be set for any terminals on
OS X, so just check it is set to something, instead of hardcoding
"Apple_Terminal" and missing other terminals such as iTerm.app.

Signed-off-by: John Szakmeister <john@szakmeister.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clone: leave repo in place after checkout errorsJeff King Tue, 26 Mar 2013 22:22:09 +0000 (18:22 -0400)

clone: leave repo in place after checkout errors

If we manage to clone a remote repository but run into an
error in the checkout, it is probably sane to leave the repo
directory in place. That lets the user examine the situation
without spending time to re-clone from the remote (which may
be a lengthy process).

Rather than try to convert each die() from the checkout code
path into an error(), we simply set a flag that tells the
"remove_junk" atexit function to print a helpful message and
leave the repo in place.

Note that the test added in this patch actually passes
without the code change. The reason is that the cleanup code
is buggy; we chdir into the working tree for the checkout,
but still may use relative paths to remove the directories
(which means if you cloned into "foo", we would accidentally
remove "foo" from the working tree!). There's no point in
fixing it now, since this patch means we will never try to
remove anything after the chdir, anyway.

[jc: replaced the message with a more succinct version from
Jonathan]

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

t7800: run --dir-diff tests with and without symlinksJohn Keeping Fri, 29 Mar 2013 11:28:36 +0000 (11:28 +0000)

t7800: run --dir-diff tests with and without symlinks

Currently the difftool --dir-diff tests may or may not use symlinks
depending on the operating system on which they are run. In one case
this has caused a test failure to be noticed only on Windows when the
test also fails on Linux when difftool is invoked with --no-symlinks.

Rewrite these tests so that they do not depend on the environment but
run explicitly with both --symlinks and --no-symlinks, protecting the
--symlinks version with a SYMLINKS prerequisite.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7800: fix tests when difftool uses --no-symlinksJohn Keeping Fri, 29 Mar 2013 11:28:35 +0000 (11:28 +0000)

t7800: fix tests when difftool uses --no-symlinks

When 'git difftool --dir-diff' is using --no-symlinks (either explicitly
or implicitly because it's running on Windows), any working tree files
that have been copied to the temporary directory are copied back after
the difftool completes.

Because an earlier test uses "git add .", the "output" file used by
tests is tracked by Git and the following sequence occurs during some
tests:

1) the shell opens "output" to redirect the difftool output
2) difftool copies the empty "output" to the temporary directory
3) difftool runs "ls" which writes to "output"
4) difftool copies the empty "output" file back over the output of the
command
5) the output file doesn't contain the expected output, causing the
test to fail

Instead of adding all changes, explicitly add only the files that the
test is using, allowing later tests to write their result files into the
working tree.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7800: don't hide grep outputJohn Keeping Fri, 29 Mar 2013 11:28:34 +0000 (11:28 +0000)

t7800: don't hide grep output

Remove the stdin_contains and stdin_doesnt_contain helper functions
which add nothing but hide the output of grep, hurting debugging.

Suggested-by: Johannes Sixt <j.sixt@viscovery.net>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

difftool: don't overwrite modified filesJohn Keeping Fri, 29 Mar 2013 22:07:39 +0000 (22:07 +0000)

difftool: don't overwrite modified files

After running the user's diff tool, git-difftool will copy any files
that differ between the working tree and the temporary tree. This is
useful when the user edits the file in their diff tool but is wrong if
they edit the working tree file while examining the diff.

Instead of copying unconditionally when the files differ, create and
index from the working tree files and only copy the temporary file back
if it was modified and the working tree file was not. If both files
have been modified, print a warning and exit with an error.

Note that we cannot use an existing index in git-difftool since those
contain the modified files that need to be checked out but here we are
looking at those files which are copied from the working tree and not
checked out. These are precisely the files which are not in the
existing indices.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1300: document some aesthetic failures of the config... Jeff King Fri, 29 Mar 2013 19:51:55 +0000 (15:51 -0400)

t1300: document some aesthetic failures of the config editor

The config-editing code used by "git config var value" is
built around the regular config callback parser, whose only
triggerable item is an actual key. As a result, it does not
know anything about section headers, which can result in
unnecessarily ugly output:

1. When we delete the last key in a section, we should be
able to delete the section header.

2. When we add a key into a section, we should be able to
reuse the same section header, even if that section did
not have any keys in it already.

Unfortunately, fixing these is not trivial with the current
code. It would involve the config parser recording and
passing back information on each item it finds, including
headers, keys, and even comments (or even better, generating
an actual in-memory parse-tree).

Since these behaviors do not cause any functional problems
(i.e., the resulting config parses as expected, it is just
uglier than one would like), fixing them can wait until
somebody feels like substantially refactoring the parsing
code. In the meantime, let's document them as known issues
with some tests.

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

test: resurrect q_to_tabJunio C Hamano Fri, 29 Mar 2013 20:38:28 +0000 (13:38 -0700)

test: resurrect q_to_tab

New test may want to use this helper; keep it for them that do not
need to protect literal SP.

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

t7800: move '--symlinks' specific test to the endJohn Keeping Fri, 29 Mar 2013 11:28:32 +0000 (11:28 +0000)

t7800: move '--symlinks' specific test to the end

This will group the tests more logically when we introduce a helper to
run most --dir-diff tests with both --symlinks and --no-symlinks.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t: check that a pattern without trailing slash matches... Jeff King Thu, 28 Mar 2013 21:50:04 +0000 (17:50 -0400)

t: check that a pattern without trailing slash matches a directory

Prior to v1.8.1.1, with:

git init
echo content >foo &&
mkdir subdir &&
echo content >subdir/bar &&
echo "subdir export-ignore" >.gitattributes
git add . &&
git commit -m one &&
git archive HEAD | tar tf -

the resulting archive would contain only "foo" and ".gitattributes",
not subdir. This was broken with a recent change that intended to
allow "subdir/ export-ignore" to also exclude the directory, but
instead ended up _requiring_ the trailing slash by mistake.

A pattern "subdir" should match any path "subdir", whether it is a
directory or a non-directory. A pattern "subdir/" insists that a
path "subdir" must be a directory for it to match.

This patch adds test not just for this simple case, but also for
deeper cross-directory cases, as well as cases with wildcards.

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

dir.c::match_pathname(): pay attention to the length... Jeff King Thu, 28 Mar 2013 21:48:21 +0000 (17:48 -0400)

dir.c::match_pathname(): pay attention to the length of string parameters

This function takes two counted strings: a <pattern, patternlen> pair
and a <pathname, pathlen> pair. But we end up feeding the result to
fnmatch, which expects NUL-terminated strings.

We can fix this by calling the fnmatch_icase_mem function, which
handles re-allocating into a NUL-terminated string if necessary.

While we're at it, we can avoid even calling fnmatch in some cases. In
addition to patternlen, we get "prefix", the size of the pattern that
contains no wildcard characters. We do a straight match of the prefix
part first, and then use fnmatch to cover the rest. But if there are
no wildcards in the pattern at all, we do not even need to call
fnmatch; we would simply be comparing two empty strings.

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

dir.c::match_pathname(): adjust patternlen when shiftin... Jeff King Thu, 28 Mar 2013 21:47:47 +0000 (17:47 -0400)

dir.c::match_pathname(): adjust patternlen when shifting pattern

If we receive a pattern that starts with "/", we shift it
forward to avoid looking at the "/" part. Since the prefix
and patternlen parameters are counts of what is in the
pattern, we must decrement them as we increment the pointer.

We remembered to handle prefix, but not patternlen. This
didn't cause any bugs, though, because the patternlen
parameter is not actually used. Since it will be used in
future patches, let's correct this oversight.

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

dir.c::match_basename(): pay attention to the length... Junio C Hamano Thu, 28 Mar 2013 21:47:28 +0000 (17:47 -0400)

dir.c::match_basename(): pay attention to the length of string parameters

The function takes two counted strings (<basename, basenamelen> and
<pattern, patternlen>) as parameters, together with prefix (the
length of the prefix in pattern that is to be matched literally
without globbing against the basename) and EXC_* flags that tells it
how to match the pattern against the basename.

However, it did not pay attention to the length of these counted
strings. Update them to do the following:

* When the entire pattern is to be matched literally, the pattern
matches the basename only when the lengths of them are the same,
and they match up to that length.

* When the pattern is "*" followed by a string to be matched
literally, make sure that the basenamelen is equal or longer than
the "literal" part of the pattern, and the tail of the basename
string matches that literal part.

* Otherwise, use the new fnmatch_icase_mem helper to make
sure we only lookmake sure we use only look at the
counted part of the strings. Because these counted strings are
full strings most of the time, we check for termination
to avoid unnecessary allocation.

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

attr.c::path_matches(): special case paths that end... Junio C Hamano Thu, 28 Mar 2013 21:49:13 +0000 (17:49 -0400)

attr.c::path_matches(): special case paths that end with a slash

The function is given a string that ends with a slash to signal that
the path is a directory to make sure that a pattern that ends with a
slash (i.e. MUSTBEDIR) can tell directories and non-directories
apart. However, the pattern itself (pat->pattern and
pat->patternlen) that came from such a MUSTBEDIR pattern is
represented as a string that ends with a slash, but patternlen does
not count that trailing slash. A MUSTBEDIR pattern "element/" is
represented as a counted string <"element/", 7> and this must match
match pathname "element/".

Because match_basename() and match_pathname() want to see pathname
"element" to match against the pattern <"element/", 7>, reduce the
length of the path to exclude the trailing slash when calling
these functions.

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

Merge branch 'yd/use-test-config-unconfig'Junio C Hamano Thu, 28 Mar 2013 21:38:27 +0000 (14:38 -0700)

Merge branch 'yd/use-test-config-unconfig'

Bulk-update of the test suite.

* yd/use-test-config-unconfig:
t5520: use test_config to set/unset git config variables (leftover bits)
t7600: use test_config to set/unset git config variables
t7502: remove clear_config
t7502: use test_config to set/unset git config variables
t9500: use test_config to set/unset git config variables
t7508: use test_config to set/unset git config variables
t7500: use test_config to set/unset git config variables
t5541: use test_config to set/unset git config variables
t5520: use test_config to set/unset git config variables
t4202: use test_config/test_unconfig to set/unset git config variables
t4034: use test_config/test_unconfig to set/unset git config variables
t4304: use test_config to set/unset git config variables
t3400: use test_config to set/unset git config variables

Merge branch 'kk/revwalk-slop-too-many-commit-within... Junio C Hamano Thu, 28 Mar 2013 21:38:25 +0000 (14:38 -0700)

Merge branch 'kk/revwalk-slop-too-many-commit-within-a-second'

Allow the revision "slop" code to look deeper while commits with
exactly the same timestamps come next to each other (which can
often happen after a large "am" and "rebase" session).

* kk/revwalk-slop-too-many-commit-within-a-second:
Fix revision walk for commits with the same dates

Merge branch 'rr/tests-dedup-test-config'Junio C Hamano Thu, 28 Mar 2013 21:38:23 +0000 (14:38 -0700)

Merge branch 'rr/tests-dedup-test-config'

* rr/tests-dedup-test-config:
t4018,7810,7811: remove test_config() redefinition

Merge branch 'yd/doc-is-in-asciidoc'Junio C Hamano Thu, 28 Mar 2013 21:38:20 +0000 (14:38 -0700)

Merge branch 'yd/doc-is-in-asciidoc'

* yd/doc-is-in-asciidoc:
CodingGuidelines: our documents are in AsciiDoc

Merge branch 'yd/doc-merge-annotated-tag'Junio C Hamano Thu, 28 Mar 2013 21:38:17 +0000 (14:38 -0700)

Merge branch 'yd/doc-merge-annotated-tag'

Document the 1.7.9 feature to merge a signed tag and keep that in
the mergetag header in the resulting commit better.

* yd/doc-merge-annotated-tag:
Documentation: merging a tag is a special case

Merge branch 'jc/remove-treesame-parent-in-simplify... Junio C Hamano Thu, 28 Mar 2013 21:37:53 +0000 (14:37 -0700)

Merge branch 'jc/remove-treesame-parent-in-simplify-merges'

The --simplify-merges logic did not cull irrelevant parents from a
merge that is otherwise not interesting with respect to the paths
we are following.

This touches a fairly core part of the revision traversal
infrastructure; even though I think this change is correct, please
report immediately if you find any unintended side effect.

* jc/remove-treesame-parent-in-simplify-merges:
simplify-merges: drop merge from irrelevant side branch

Merge branch 'jk/checkout-attribute-lookup'Junio C Hamano Thu, 28 Mar 2013 21:37:46 +0000 (14:37 -0700)

Merge branch 'jk/checkout-attribute-lookup'

Codepath to stream blob object contents directly from the object
store to filesystem did not use the correct path to find conversion
filters when writing to temporary files.

* jk/checkout-attribute-lookup:
t2003: work around path mangling issue on Windows
entry: fix filter lookup
t2003: modernize style

Merge branch 'jk/difftool-dir-diff-edit-fix'Junio C Hamano Thu, 28 Mar 2013 21:37:22 +0000 (14:37 -0700)

Merge branch 'jk/difftool-dir-diff-edit-fix'

"git difftool --dir-diff" made symlinks to working tree files when
preparing a temporary directory structure, so that accidental edits
of these files in the difftool are reflected back to the working
tree, but the logic to decide when to do so was not quite right.

* jk/difftool-dir-diff-edit-fix:
difftool --dir-diff: symlink all files matching the working tree
difftool: avoid double slashes in symlink targets
git-difftool(1): fix formatting of --symlink description

Merge branch 'maint'Junio C Hamano Thu, 28 Mar 2013 21:34:55 +0000 (14:34 -0700)

Merge branch 'maint'

* maint:
git help config: s/insn/instruction/

Merge branch 'maint-1.8.1' into maintJunio C Hamano Thu, 28 Mar 2013 21:34:07 +0000 (14:34 -0700)

Merge branch 'maint-1.8.1' into maint

* maint-1.8.1:
git help config: s/insn/instruction/

git help config: s/insn/instruction/Matthias Krüger Wed, 27 Mar 2013 22:53:50 +0000 (23:53 +0100)

git help config: s/insn/instruction/

"insn" appears to be an in-code abbreviation and should not appear
in manual/help pages.

Signed-off-by: Matthias Krüger <matthias.krueger@famsik.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5520: use test_config to set/unset git config variable... Ramkumar Ramachandra Thu, 28 Mar 2013 12:40:19 +0000 (18:10 +0530)

t5520: use test_config to set/unset git config variables (leftover bits)

Configuration from test_config does not last beyond the end of the
current test assertion, making each test easier to think about in
isolation.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Avoid loading commits twice in log with diffsThomas Rast Thu, 28 Mar 2013 08:19:34 +0000 (09:19 +0100)

Avoid loading commits twice in log with diffs

If you run a log with diffs (such as -p, --raw, --stat etc.) the
current code ends up loading many objects twice. For example, for
'log -3000 -p' my instrumentation said the objects loaded more than
once are distributed as follows:

2008 blob
2103 commit
2678 tree

Fixing blobs and trees will be harder, because those are really used
within the diff engine and need some form of caching.

However, fixing the commits is easy at least at the band-aid level.
They are triggered by log_tree_diff() invoking diff_tree_sha1() on
commits, which duly loads the specified object to dereference it to a
tree. Since log_tree_diff() knows that it works with commits and they
must have trees, we can simply pass through the trees.

We add some parse_commit() calls. The ones for the parents are
required; we do not know at this stage if they have been looked at.
The one for the commit itself is pure paranoia, but has about the same
cost as an assertion on commit->object.parsed.

This has a quite dramatic effect on log --raw, though only a
negligible impact on log -p:

Test this tree HEAD
--------------------------------------------------------------------
4000.2: log --raw -3000 0.50(0.43+0.06) 0.54(0.46+0.06) +7.0%***
4000.3: log -p -3000 2.34(2.20+0.13) 2.37(2.22+0.13) +1.2%
--------------------------------------------------------------------
Significance hints: '.' 0.1 '*' 0.05 '**' 0.01 '***' 0.001

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

log: read gpg settings for signed commit verificationJacob Sarvis Wed, 27 Mar 2013 15:13:39 +0000 (10:13 -0500)

log: read gpg settings for signed commit verification

"show --show-signature" and "log --show-signature" do not read the
gpg.program setting from git config, even though, commit signing,
tag signing, and tag verification honor it.

Signed-off-by: Jacob Sarvis <jsarvis@openspan.com>
Signed-off-by: Hans Brigman <hbrigman@openspan.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clone: run check_everything_connectedJeff King Mon, 25 Mar 2013 20:26:27 +0000 (16:26 -0400)

clone: run check_everything_connected

When we fetch from a remote, we do a revision walk to make
sure that what we received is connected to our existing
history. We do not do the same check for clone, which should
be able to check that we received an intact history graph.

The upside of this patch is that it will make clone more
resilient against propagating repository corruption. The
downside is that we will now traverse "rev-list --objects
--all" down to the roots, which may take some time (it is
especially noticeable for a "--local --bare" clone).

Note that we need to adjust t5710, which tries to make such
a bogus clone. Rather than checking after the fact that our
clone is bogus, we can simplify it to just make sure "git
clone" reports failure.

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

clone: die on errors from unpack_treesJeff King Mon, 25 Mar 2013 20:23:59 +0000 (16:23 -0400)

clone: die on errors from unpack_trees

When clone is populating the working tree, it ignores the
return status from unpack_trees; this means we may report a
successful clone, even when the checkout fails.

When checkout fails, we may want to leave the $GIT_DIR in
place, as it might be possible to recover the data through
further use of "git checkout" (e.g., if the checkout failed
due to a transient error, disk full, etc). However, we
already die on a number of other checkout-related errors, so
this patch follows that pattern.

In addition to marking a now-passing test, we need to adjust
t5710, which blindly assumed it could make bogus clones of
very deep alternates hierarchies. By using "--bare", we can
avoid it actually touching any objects.

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

add tests for cloning corrupted repositoriesJeff King Mon, 25 Mar 2013 20:22:29 +0000 (16:22 -0400)

add tests for cloning corrupted repositories

We try not to let corruption pass unnoticed over fetches and
clones. For the most part, this works, but there are some
broken corner cases, including:

1. We do not detect missing objects over git-aware
transports. This is a little hard to test, because the
sending side will actually complain about the missing
object.

To fool it, we corrupt a repository such that we have a
"misnamed" object: it claims to be sha1 X, but is
really Y. This lets the sender blindly transmit it, but
it is the receiver's responsibility to verify that what
it got is sane (and it does not).

2. We do not detect missing or misnamed blobs during the
checkout phase of clone.

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

streaming_write_entry: propagate streaming errorsJeff King Mon, 25 Mar 2013 21:49:36 +0000 (17:49 -0400)

streaming_write_entry: propagate streaming errors

When we are streaming an index blob to disk, we store the
error from stream_blob_to_fd in the "result" variable, and
then immediately overwrite that with the return value of
"close". That means we catch errors on close (e.g., problems
committing the file to disk), but miss anything which
happened before then.

We can fix this by using bitwise-OR to accumulate errors in
our result variable.

While we're here, we can also simplify the error handling
with an early return, which makes it easier to see under
which circumstances we need to clean up.

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

add test for streaming corrupt blobsJeff King Mon, 25 Mar 2013 20:21:34 +0000 (16:21 -0400)

add test for streaming corrupt blobs

We do not have many tests for handling corrupt objects. This
new test at least checks that we detect a byte error in a
corrupt blob object while streaming it out with cat-file.

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

avoid infinite loop in read_istream_looseJeff King Mon, 25 Mar 2013 20:21:14 +0000 (16:21 -0400)

avoid infinite loop in read_istream_loose

The read_istream_loose function loops on inflating a chunk of data
from an mmap'd loose object. We end the loop when we run out
of space in our output buffer, or if we see a zlib error.

We need to treat Z_BUF_ERROR specially, though, as it is not
fatal; it is just zlib's way of telling us that we need to
either feed it more input or give it more output space. It
is perfectly normal for us to hit this when we are at the
end of our buffer.

However, we may also get Z_BUF_ERROR because we have run out
of input. In a well-formed object, this should not happen,
because we have fed the whole mmap'd contents to zlib. But
if the object is truncated or corrupt, we will loop forever,
never giving zlib any more data, but continuing to ask it to
inflate.

We can fix this by considering it an error when zlib returns
Z_BUF_ERROR but we still have output space left (which means
it must want more input, which we know is a truncation
error). It would not be sufficient to just check whether
zlib had consumed all the input at the start of the loop, as
it might still want to generate output from what is in its
internal state.

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

read_istream_filtered: propagate read error from upstreamJeff King Mon, 25 Mar 2013 20:18:16 +0000 (16:18 -0400)

read_istream_filtered: propagate read error from upstream

The filter istream pulls data from an "upstream" stream,
running it through a filter function. However, we did not
properly notice when the upstream filter yielded an error,
and just returned what we had read. Instead, we should
propagate the error.

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

check_sha1_signature: check return value from read_istreamJeff King Mon, 25 Mar 2013 20:17:17 +0000 (16:17 -0400)

check_sha1_signature: check return value from read_istream

It's possible for read_istream to return an error, in which
case we just end up in an infinite loop (aside from EOF, we
do not even look at the result, but just feed it straight
into our running hash).

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

stream_blob_to_fd: detect errors reading from streamJeff King Mon, 25 Mar 2013 20:16:50 +0000 (16:16 -0400)

stream_blob_to_fd: detect errors reading from stream

We call read_istream, but never check its return value for
errors. This can lead to us looping infinitely, as we just
keep trying to write "-1" bytes (and we do not notice the
error, as we simply check that write_in_full reports the
same number of bytes we fed it, which of course is also -1).

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

Merge branch 'maint'Junio C Hamano Wed, 27 Mar 2013 17:58:07 +0000 (10:58 -0700)

Merge branch 'maint'

* maint:
More fixes for 1.8.2.1
merge-tree: fix typo in merge-tree.c::unresolved
git-commit doc: describe use of multiple `-m` options
git-pull doc: fix grammo ("conflicts" is plural)

More fixes for 1.8.2.1Junio C Hamano Wed, 27 Mar 2013 17:57:57 +0000 (10:57 -0700)

More fixes for 1.8.2.1

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

Merge branch 'maint-1.8.1' into maintJunio C Hamano Wed, 27 Mar 2013 17:51:10 +0000 (10:51 -0700)

Merge branch 'maint-1.8.1' into maint

* maint-1.8.1:
merge-tree: fix typo in merge-tree.c::unresolved
git-commit doc: describe use of multiple `-m` options
git-pull doc: fix grammo ("conflicts" is plural)

merge-tree: fix typo in merge-tree.c::unresolvedJohn Keeping Wed, 27 Mar 2013 15:58:50 +0000 (15:58 +0000)

merge-tree: fix typo in merge-tree.c::unresolved

When calculating whether there is a d/f conflict, the calculation of
whether both sides are directories generates an incorrect references
mask because it does not use the loop index to set the correct bit.
Fix this typo.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-commit doc: describe use of multiple `-m` optionsChristian Helmuth Wed, 27 Mar 2013 14:19:35 +0000 (15:19 +0100)

git-commit doc: describe use of multiple `-m` options

The text is copied from Documentation/git-tag.txt.

Signed-off-by: Christian Helmuth <christian.helmuth@genode-labs.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-pull doc: fix grammo ("conflicts" is plural)Mihai Capotă Wed, 27 Mar 2013 11:04:51 +0000 (12:04 +0100)

git-pull doc: fix grammo ("conflicts" is plural)

Signed-off-by: Mihai Capotă <mihai@mihaic.ro>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'master' of git://git.bogomips.org/git-svnJunio C Hamano Wed, 27 Mar 2013 16:29:05 +0000 (09:29 -0700)

Merge branch 'master' of git://git.bogomips.org/git-svn

* 'master' of git://git.bogomips.org/git-svn:
git-svn: Support custom tunnel schemes instead of SSH only

Merge branch 'rs/archive-zip-raw-compression'Junio C Hamano Wed, 27 Mar 2013 16:28:53 +0000 (09:28 -0700)

Merge branch 'rs/archive-zip-raw-compression'

* rs/archive-zip-raw-compression:
archive-zip: use deflateInit2() to ask for raw compressed data

Merge branch 'ap/combine-diff-ignore-whitespace'Junio C Hamano Wed, 27 Mar 2013 16:28:50 +0000 (09:28 -0700)

Merge branch 'ap/combine-diff-ignore-whitespace'

Teach "diff --cc" output to honor options to ignore various forms
of whitespace changes.

* ap/combine-diff-ignore-whitespace:
Allow combined diff to ignore white-spaces

checkout: avoid unnecessary match_pathspec callsNguyễn Thái Ngọc Duy Wed, 27 Mar 2013 05:58:21 +0000 (12:58 +0700)

checkout: avoid unnecessary match_pathspec calls

In checkout_paths() we do this

- for all updated items, call match_pathspec
- for all items, call match_pathspec (inside unmerge_cache)
- for all items, call match_pathspec (for showing "path .. is unmerged)
- for updated items, call match_pathspec and update paths

That's a lot of duplicate match_pathspec(s) and the function is not
exactly cheap to be called so many times, especially on large indexes.
This patch makes it call match_pathspec once per updated index entry,
save the result in ce_flags and reuse the results in the following
loops.

The changes in 0a1283b (checkout $tree $path: do not clobber local
changes in $path not in $tree - 2011-09-30) limit the affected paths
to ones we read from $tree. We do not do anything to other modified
entries in this case, so the "for all items" above could be modified
to "for all updated items". But..

The command's behavior now is modified slightly: unmerged entries that
match $path, but not updated by $tree, are now NOT touched. Although
this should be considered a bug fix, not a regression. A new test is
added for this change.

And while at there, free ps_matched after use.

The following command is tested on webkit, 215k entries. The pattern
is chosen mainly to make match_pathspec sweat:

git checkout -- "*[a-zA-Z]*[a-zA-Z]*[a-zA-Z]*"

before after
real 0m3.493s 0m2.737s
user 0m2.239s 0m1.586s
sys 0m1.252s 0m1.151s

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: Support custom tunnel schemes instead of SSH... Sebastian Schuberth Tue, 26 Mar 2013 21:24:38 +0000 (22:24 +0100)

git-svn: Support custom tunnel schemes instead of SSH only

This originates from an msysgit pull request, see:

https://github.com/msysgit/git/pull/58

Signed-off-by: Eric Wieser <wieser.eric@gmail.com>
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>

safe_create_leading_directories: fix race that could... Steven Walter Sun, 17 Mar 2013 14:09:27 +0000 (10:09 -0400)

safe_create_leading_directories: fix race that could give a false negative

If two processes are racing to create the same directory tree, they
will both see that the directory doesn't exist, both try to mkdir(),
and one of them will fail. This is okay, as we only care that the
directory gets created. So, we add a check for EEXIST from mkdir,
and continue when the directory exists, taking the same codepath as
the case where the earlier stat() succeeds and finds a directory.

Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

More topics from the second batch for 1.8.3Junio C Hamano Tue, 26 Mar 2013 20:01:27 +0000 (13:01 -0700)

More topics from the second batch for 1.8.3

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

Merge branch 'jc/reflog-reverse-walk'Junio C Hamano Tue, 26 Mar 2013 20:15:56 +0000 (13:15 -0700)

Merge branch 'jc/reflog-reverse-walk'

An internal function used to implement "git checkout @{-1}" was
hard to use correctly.

* jc/reflog-reverse-walk:
refs.c: fix fread error handling
reflog: add for_each_reflog_ent_reverse() API
for_each_recent_reflog_ent(): simplify opening of a reflog file
for_each_reflog_ent(): extract a helper to process a single entry