gitweb.git
Merge branch 'sb/merge-recursive-copy-paste-fix'Junio C Hamano Tue, 30 Sep 2014 05:17:21 +0000 (22:17 -0700)

Merge branch 'sb/merge-recursive-copy-paste-fix'

"git merge-recursive" had a small bug that could have made it
mishandle "one side deleted, the other side did not touch it" in a
rare corner case, where the other side actually did touch to cause
the blob object names to be different but both blobs before and
after the change normalize to the same (e.g. correcting mistake to
check in a blob with CRLF line endings by replacing it with another
blob that records the same contents with LF line endings).

* sb/merge-recursive-copy-paste-fix:
merge-recursive: remove stale commented debugging code
merge-recursive: fix copy-paste mistake

Merge branch 'pr/use-default-sigpipe-setting'Junio C Hamano Tue, 30 Sep 2014 05:17:20 +0000 (22:17 -0700)

Merge branch 'pr/use-default-sigpipe-setting'

We used to get confused when a process called us with SIGPIPE
ignored; we do want to die with SIGPIPE when the output is not
read by default, and do ignore the signal when appropriate.

* pr/use-default-sigpipe-setting:
mingw.h: add dummy functions for sigset_t operations
unblock and unignore SIGPIPE

Update draft release notes to 2.2Junio C Hamano Mon, 29 Sep 2014 19:44:43 +0000 (12:44 -0700)

Update draft release notes to 2.2

Merge branch 'jk/mbox-from-line'Junio C Hamano Mon, 29 Sep 2014 19:36:15 +0000 (12:36 -0700)

Merge branch 'jk/mbox-from-line'

Some MUAs mangled a line in a message that begins with "From " to
">From " when writing to a mailbox file and feeding such an input
to "git am" used to lose such a line.

* jk/mbox-from-line:
mailinfo: work around -Wstring-plus-int warning
mailinfo: make ">From" in-body header check more robust

Merge branch 'sb/t6031-typofix'Junio C Hamano Mon, 29 Sep 2014 19:36:14 +0000 (12:36 -0700)

Merge branch 'sb/t6031-typofix'

* sb/t6031-typofix:
t6031-test-merge-recursive: do not forget to add file to be committed

Merge branch 'sb/t9300-typofix'Junio C Hamano Mon, 29 Sep 2014 19:36:13 +0000 (12:36 -0700)

Merge branch 'sb/t9300-typofix'

* sb/t9300-typofix:
t9300-fast-import: fix typo in test description

Merge branch 'rs/remote-simplify'Junio C Hamano Mon, 29 Sep 2014 19:36:12 +0000 (12:36 -0700)

Merge branch 'rs/remote-simplify'

* rs/remote-simplify:
remote: simplify match_name_with_pattern() using strbuf

Merge branch 'rs/graph-simplify'Junio C Hamano Mon, 29 Sep 2014 19:36:11 +0000 (12:36 -0700)

Merge branch 'rs/graph-simplify'

* rs/graph-simplify:
graph: simplify graph_padding_line()

Merge branch 'da/rev-parse-verify-quiet'Junio C Hamano Mon, 29 Sep 2014 19:36:10 +0000 (12:36 -0700)

Merge branch 'da/rev-parse-verify-quiet'

"rev-parse --verify --quiet $name" is meant to quietly exit with a
non-zero status when $name is not a valid object name, but still
gave error messages in some cases.

* da/rev-parse-verify-quiet:
stash: prefer --quiet over shell redirection of the standard error stream
refs: make rev-parse --quiet actually quiet
t1503: use test_must_be_empty
Documentation: a note about stdout for git rev-parse --verify --quiet

Merge branch 'hj/pretty-naked-decoration'Junio C Hamano Mon, 29 Sep 2014 19:36:08 +0000 (12:36 -0700)

Merge branch 'hj/pretty-naked-decoration'

The pretty-format specifier "%d", which expanded to " (tagname)"
for a tagged commit, gained a cousin "%D" that just gives the
"tagname" without frills.

* hj/pretty-naked-decoration:
pretty: add %D format specifier

Merge branch 'maint'Junio C Hamano Sun, 28 Sep 2014 07:03:25 +0000 (00:03 -0700)

Merge branch 'maint'

* maint:
l10n: de.po: use comma before "um"
l10n: de.po: change Email to E-Mail
po/TEAMS: add new member to German translation team

Merge branch 'maint' of git://github.com/git-l10n/git... Junio C Hamano Sun, 28 Sep 2014 07:02:57 +0000 (00:02 -0700)

Merge branch 'maint' of git://github.com/git-l10n/git-po into maint

* 'maint' of git://github.com/git-l10n/git-po:
l10n: de.po: use comma before "um"
l10n: de.po: change Email to E-Mail
po/TEAMS: add new member to German translation team

Update draft release notes to 2.2Junio C Hamano Fri, 26 Sep 2014 21:51:23 +0000 (14:51 -0700)

Update draft release notes to 2.2

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

Merge branch 'sb/help-unknown-command-sort-fix'Junio C Hamano Fri, 26 Sep 2014 21:39:46 +0000 (14:39 -0700)

Merge branch 'sb/help-unknown-command-sort-fix'

Code cleanup.

* sb/help-unknown-command-sort-fix:
help: fix the size passed to qsort

Merge branch 'jk/branch-verbose-merged'Junio C Hamano Fri, 26 Sep 2014 21:39:45 +0000 (14:39 -0700)

Merge branch 'jk/branch-verbose-merged'

The "--verbose" option no longer breaks "git branch --merged $it".

* jk/branch-verbose-merged:
branch: clean up commit flags after merge-filter walk

Merge branch 'rs/realloc-array'Junio C Hamano Fri, 26 Sep 2014 21:39:45 +0000 (14:39 -0700)

Merge branch 'rs/realloc-array'

Code cleanup.

* rs/realloc-array:
use REALLOC_ARRAY for changing the allocation size of arrays
add macro REALLOC_ARRAY

Merge branch 'jk/close-stderr-of-credential-cache-deamon'Junio C Hamano Fri, 26 Sep 2014 21:39:45 +0000 (14:39 -0700)

Merge branch 'jk/close-stderr-of-credential-cache-deamon'

Plug fd leaks.

* jk/close-stderr-of-credential-cache-deamon:
credential-cache: close stderr in daemon process

Merge branch 'jc/ignore-sigpipe-while-running-hooks'Junio C Hamano Fri, 26 Sep 2014 21:39:44 +0000 (14:39 -0700)

Merge branch 'jc/ignore-sigpipe-while-running-hooks'

pre- and post-receive hooks are no longer required to read all
their inputs.

* jc/ignore-sigpipe-while-running-hooks:
receive-pack: allow hooks to ignore its standard input stream

Merge branch 'jk/prune-packed-server-info'Junio C Hamano Fri, 26 Sep 2014 21:39:44 +0000 (14:39 -0700)

Merge branch 'jk/prune-packed-server-info'

Code cleanup.

* jk/prune-packed-server-info:
repack: call prune_packed_objects() and update_server_info() directly
server-info: clean up after writing info/packs
make update-server-info more robust
prune-packed: fix minor memory leak

Merge branch 'jc/hash-object-fsck-tag'Junio C Hamano Fri, 26 Sep 2014 21:39:44 +0000 (14:39 -0700)

Merge branch 'jc/hash-object-fsck-tag'

Using "hash-object --literally", test one of the new breakages
js/fsck-tag-validation topic teaches "fsck" to catch is caught.

* jc/hash-object-fsck-tag:
t1450: make sure fsck detects a malformed tagger line

Merge branch 'jc/hash-object'Junio C Hamano Fri, 26 Sep 2014 21:39:43 +0000 (14:39 -0700)

Merge branch 'jc/hash-object'

"hash-object" learned a new "--literally" option to hash any random
garbage into a loose object, to allow us to create a test data for
mechanisms to catch corrupt objects.

* jc/hash-object:
hash-object: add --literally option
hash-object: pass 'write_object' as a flag
hash-object: reduce file-scope statics

Merge branch 'js/fsck-tag-validation'Junio C Hamano Fri, 26 Sep 2014 21:39:43 +0000 (14:39 -0700)

Merge branch 'js/fsck-tag-validation'

Teach "git fsck" to inspect the contents of annotated tag objects.

* js/fsck-tag-validation:
Make sure that index-pack --strict checks tag objects
Add regression tests for stricter tag fsck'ing
fsck: check tag objects' headers
Make sure fsck_commit_buffer() does not run out of the buffer
fsck_object(): allow passing object data separately from the object itself
Refactor type_from_string() to allow continuing after detecting an error

Merge branch 'jk/faster-name-conflicts'Junio C Hamano Fri, 26 Sep 2014 21:39:43 +0000 (14:39 -0700)

Merge branch 'jk/faster-name-conflicts'

Optimize the check to see if a ref $F can be created by making sure
no existing ref has $F/ as its prefix, which especially matters in
a repository with a large number of existing refs.

* jk/faster-name-conflicts:
refs: speed up is_refname_available

Merge branch 'jk/write-packed-refs-via-stdio'Junio C Hamano Fri, 26 Sep 2014 21:39:42 +0000 (14:39 -0700)

Merge branch 'jk/write-packed-refs-via-stdio'

Optimize the code path to write out the packed-refs file, which
especially matters in a repository with a large number of refs.

* jk/write-packed-refs-via-stdio:
refs: write packed_refs file using stdio

l10n: de.po: use comma before "um"Phillip Sz Tue, 23 Sep 2014 12:00:52 +0000 (14:00 +0200)

l10n: de.po: use comma before "um"

This patch adds a comma before the "um". See:
http://www.duden.de/sprachwissen/rechtschreibregeln/komma#K117

Signed-off-by: Phillip Sz <phillip.szelat@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

l10n: de.po: change Email to E-MailPhillip Sz Sat, 20 Sep 2014 15:51:53 +0000 (17:51 +0200)

l10n: de.po: change Email to E-Mail

Change all Email to E-Mail, as this is the correct form in German.

Signed-off-by: Phillip Sz <phillip.szelat@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

po/TEAMS: add new member to German translation teamRalf Thielow Fri, 5 Sep 2014 16:30:49 +0000 (18:30 +0200)

po/TEAMS: add new member to German translation team

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

merge-recursive: remove stale commented debugging codeStefan Beller Tue, 23 Sep 2014 14:55:50 +0000 (16:55 +0200)

merge-recursive: remove stale commented debugging code

Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: fix copy-paste mistakeStefan Beller Sun, 21 Sep 2014 20:49:46 +0000 (22:49 +0200)

merge-recursive: fix copy-paste mistake

The following issue was found by scan.coverity.com (ID: 1049510),
and claimed to be likely a copy-paste mistake.

Introduced in 331a1838b (2010-07-02, Try normalizing files
to avoid delete/modify conflicts when merging), which is
quite a long time ago, so I'm rather unsure if it's of any impact
or just went unnoticed.

The line after the changed line has a comparison of 'o.len' to 'a.len',
so we should assume the lengths may be different.

I'd be happy to have a test for this bug(?) attached to
t6031-merge-recursive.sh, but I did not manage to
come up with a test in a reasonable amount of time.

Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mailinfo: work around -Wstring-plus-int warningEric Sunshine Sun, 21 Sep 2014 09:13:58 +0000 (05:13 -0400)

mailinfo: work around -Wstring-plus-int warning

The just-released Apple Xcode 6.0.1 has -Wstring-plus-int enabled by
default which complains about pointer arithmetic applied to a string
literal:

builtin/mailinfo.c:303:24: warning:
adding 'long' to a string does not append to the string
return !memcmp(SAMPLE + (cp - line), cp, strlen(SAMPLE) ...
~~~~~~~^~~~~~~~~~~~~

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw.h: add dummy functions for sigset_t operationsJohannes Sixt Mon, 22 Sep 2014 18:24:34 +0000 (20:24 +0200)

mingw.h: add dummy functions for sigset_t operations

Windows does not have POSIX-like signals, and so we ignore all
operations on the non-existent signal mask machinery.

Do not turn sigemptyset into a function, but leave it a macro that
erases the code in the argument because it is used to set sa_mask
of a struct sigaction, but our dummy in mingw.h does not have that
member.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6031-test-merge-recursive: do not forget to add file... Stefan Beller Sun, 21 Sep 2014 20:38:17 +0000 (22:38 +0200)

t6031-test-merge-recursive: do not forget to add file to be committed

Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9300-fast-import: fix typo in test descriptionStefan Beller Sun, 21 Sep 2014 15:02:57 +0000 (17:02 +0200)

t9300-fast-import: fix typo in test description

Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote: simplify match_name_with_pattern() using strbufRené Scharfe Sun, 21 Sep 2014 08:23:37 +0000 (10:23 +0200)

remote: simplify match_name_with_pattern() using strbuf

Make the code simpler and shorter by avoiding repetitive use of
string length variables and leaving memory allocation to strbuf
functions.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

graph: simplify graph_padding_line()René Scharfe Sat, 20 Sep 2014 18:29:53 +0000 (20:29 +0200)

graph: simplify graph_padding_line()

Deduplicate code common to both branches of if statements.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 2.2Junio C Hamano Fri, 19 Sep 2014 18:51:14 +0000 (11:51 -0700)

Update draft release notes to 2.2

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

Sync with Git 2.1.1Junio C Hamano Fri, 19 Sep 2014 21:22:34 +0000 (14:22 -0700)

Sync with Git 2.1.1

Git 2.1.1 v2.1.1Junio C Hamano Fri, 19 Sep 2014 21:21:31 +0000 (14:21 -0700)

Git 2.1.1

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

Merge branch 'et/spell-poll-infinite-with-minus-one... Junio C Hamano Fri, 19 Sep 2014 21:05:13 +0000 (14:05 -0700)

Merge branch 'et/spell-poll-infinite-with-minus-one-only' into maint

* et/spell-poll-infinite-with-minus-one-only:
upload-pack: keep poll(2)'s timeout to -1

Merge branch 'nd/fetch-pass-quiet-to-gc-child-process... Junio C Hamano Fri, 19 Sep 2014 21:05:12 +0000 (14:05 -0700)

Merge branch 'nd/fetch-pass-quiet-to-gc-child-process' into maint

* nd/fetch-pass-quiet-to-gc-child-process:
fetch: silence git-gc if --quiet is given
fetch: convert argv_gc_auto to struct argv_array

Merge branch 'jk/prune-top-level-refs-after-packing... Junio C Hamano Fri, 19 Sep 2014 21:05:12 +0000 (14:05 -0700)

Merge branch 'jk/prune-top-level-refs-after-packing' into maint

* jk/prune-top-level-refs-after-packing:
pack-refs: prune top-level refs like "refs/foo"

Merge branch 'jk/fast-import-fixes' into maintJunio C Hamano Fri, 19 Sep 2014 21:05:12 +0000 (14:05 -0700)

Merge branch 'jk/fast-import-fixes' into maint

* jk/fast-import-fixes:
fast-import: fix buffer overflow in dump_tags
fast-import: clean up pack_data pointer in end_packfile

Merge branch 'jn/unpack-trees-checkout-m-carry-deletion... Junio C Hamano Fri, 19 Sep 2014 21:05:12 +0000 (14:05 -0700)

Merge branch 'jn/unpack-trees-checkout-m-carry-deletion' into maint

* jn/unpack-trees-checkout-m-carry-deletion:
checkout -m: attempt merge when deletion of path was staged
unpack-trees: use 'cuddled' style for if-else cascade
unpack-trees: simplify 'all other failures' case

Merge branch 'sp/pack-protocol-doc-on-shallow' into... Junio C Hamano Fri, 19 Sep 2014 21:05:11 +0000 (14:05 -0700)

Merge branch 'sp/pack-protocol-doc-on-shallow' into maint

* sp/pack-protocol-doc-on-shallow:
Document LF appearing in shallow command during send-pack/receive-pack

Merge branch 'jk/prompt-stash-could-be-packed' into... Junio C Hamano Fri, 19 Sep 2014 21:05:11 +0000 (14:05 -0700)

Merge branch 'jk/prompt-stash-could-be-packed' into maint

* jk/prompt-stash-could-be-packed:
git-prompt: do not look for refs/stash in $GIT_DIR

Merge branch 'rs/refresh-beyond-symlink' into maintJunio C Hamano Fri, 19 Sep 2014 21:05:11 +0000 (14:05 -0700)

Merge branch 'rs/refresh-beyond-symlink' into maint

* rs/refresh-beyond-symlink:
read-cache: check for leading symlinks when refreshing index

Merge branch 'lf/bundle-exclusion' into maintJunio C Hamano Fri, 19 Sep 2014 21:05:11 +0000 (14:05 -0700)

Merge branch 'lf/bundle-exclusion' into maint

* lf/bundle-exclusion:
bundle: fix exclusion of annotated tags

Merge branch 'jc/apply-ws-prefix' into maintJunio C Hamano Fri, 19 Sep 2014 21:05:10 +0000 (14:05 -0700)

Merge branch 'jc/apply-ws-prefix' into maint

* jc/apply-ws-prefix:
apply: omit ws check for excluded paths
apply: hoist use_patch() helper for path exclusion up
apply: use the right attribute for paths in non-Git patches

Conflicts:
builtin/apply.c

Merge branch 'jk/command-line-config-empty-string'... Junio C Hamano Fri, 19 Sep 2014 21:05:10 +0000 (14:05 -0700)

Merge branch 'jk/command-line-config-empty-string' into maint

* jk/command-line-config-empty-string:
config: teach "git -c" to recognize an empty string

Conflicts:
config.c

Merge branch 'jk/pretty-empty-format' into maintJunio C Hamano Fri, 19 Sep 2014 21:05:09 +0000 (14:05 -0700)

Merge branch 'jk/pretty-empty-format' into maint

* jk/pretty-empty-format:
pretty: make empty userformats truly empty
pretty: treat "--format=" as an empty userformat
revision: drop useless string offset when parsing "--pretty"

Merge branch 'jk/fsck-exit-code-fix'Junio C Hamano Fri, 19 Sep 2014 18:38:42 +0000 (11:38 -0700)

Merge branch 'jk/fsck-exit-code-fix'

"git fsck" failed to report that it found corrupt objects via its
exit status in some cases.

* jk/fsck-exit-code-fix:
fsck: return non-zero status on missing ref tips
fsck: exit with non-zero status upon error from fsck_obj()

Merge branch 'so/rebase-doc'Junio C Hamano Fri, 19 Sep 2014 18:38:42 +0000 (11:38 -0700)

Merge branch 'so/rebase-doc'

* so/rebase-doc:
Documentation/git-rebase.txt: <upstream> must be given to specify <branch>

Merge branch 'ir/makefile-typofix'Junio C Hamano Fri, 19 Sep 2014 18:38:41 +0000 (11:38 -0700)

Merge branch 'ir/makefile-typofix'

* ir/makefile-typofix:
Makefile: fix some typos in the preamble

Merge branch 'wk/pre-push-sample-hook'Junio C Hamano Fri, 19 Sep 2014 18:38:41 +0000 (11:38 -0700)

Merge branch 'wk/pre-push-sample-hook'

* wk/pre-push-sample-hook:
pre-push.sample: Write error message to stderr

Merge branch 'ss/compat-default-source-for-newer-gnu'Junio C Hamano Fri, 19 Sep 2014 18:38:41 +0000 (11:38 -0700)

Merge branch 'ss/compat-default-source-for-newer-gnu'

* ss/compat-default-source-for-newer-gnu:
compat-util: add _DEFAULT_SOURCE define

Merge branch 'mr/mark-i18n-log-rerere'Junio C Hamano Fri, 19 Sep 2014 18:38:40 +0000 (11:38 -0700)

Merge branch 'mr/mark-i18n-log-rerere'

* mr/mark-i18n-log-rerere:
builtin/log.c: mark strings for translation
rerere.h: mark string for translation

Merge branch 'js/no-test-cmp-for-binaries'Junio C Hamano Fri, 19 Sep 2014 18:38:40 +0000 (11:38 -0700)

Merge branch 'js/no-test-cmp-for-binaries'

* js/no-test-cmp-for-binaries:
t9300: use test_cmp_bin instead of test_cmp to compare binary files

Merge branch 'ta/config-add-to-empty-or-true-fix'Junio C Hamano Fri, 19 Sep 2014 18:38:40 +0000 (11:38 -0700)

Merge branch 'ta/config-add-to-empty-or-true-fix'

"git config --add section.var val" used to lose existing
section.var whose value was an empty string.

* ta/config-add-to-empty-or-true-fix:
config: avoid a funny sentinel value "a^"
make config --add behave correctly for empty and NULL values

Merge branch 'sp/doc-update-index-cacheinfo'Junio C Hamano Fri, 19 Sep 2014 18:38:39 +0000 (11:38 -0700)

Merge branch 'sp/doc-update-index-cacheinfo'

* sp/doc-update-index-cacheinfo:
Documentation: use single-parameter --cacheinfo in example

Merge branch 'rs/export-strbuf-addchars'Junio C Hamano Fri, 19 Sep 2014 18:38:39 +0000 (11:38 -0700)

Merge branch 'rs/export-strbuf-addchars'

Code clean-up.

* rs/export-strbuf-addchars:
strbuf: use strbuf_addchars() for adding a char multiple times
strbuf: export strbuf_addchars()

Merge branch 'kb/perf-trace'Junio C Hamano Fri, 19 Sep 2014 18:38:39 +0000 (11:38 -0700)

Merge branch 'kb/perf-trace'

Compilation fix for some compilers.

* kb/perf-trace:
trace: correct trace_strbuf() parameter type for !HAVE_VARIADIC_MACROS

Merge branch 'jc/parseopt-verify-short-name'Junio C Hamano Fri, 19 Sep 2014 18:38:38 +0000 (11:38 -0700)

Merge branch 'jc/parseopt-verify-short-name'

Add checks for a common programming mistake to assign the same
short option name to two separate options to help developers.

* jc/parseopt-verify-short-name:
parse-options: detect attempt to add a duplicate short option name

Merge branch 'mk/reachable-protect-detached-head'Junio C Hamano Fri, 19 Sep 2014 18:38:38 +0000 (11:38 -0700)

Merge branch 'mk/reachable-protect-detached-head'

* mk/reachable-protect-detached-head:
reachable.c: add HEAD to reachability starting commits

Merge branch 'tb/complete-diff-ignore-blank-lines'Junio C Hamano Fri, 19 Sep 2014 18:38:38 +0000 (11:38 -0700)

Merge branch 'tb/complete-diff-ignore-blank-lines'

* tb/complete-diff-ignore-blank-lines:
completion: Add --ignore-blank-lines for diff

Merge branch 'as/calloc-takes-nmemb-then-size'Junio C Hamano Fri, 19 Sep 2014 18:38:37 +0000 (11:38 -0700)

Merge branch 'as/calloc-takes-nmemb-then-size'

Code clean-up.

* as/calloc-takes-nmemb-then-size:
calloc() and xcalloc() takes nmemb and then size

Merge branch 'tb/crlf-tests'Junio C Hamano Fri, 19 Sep 2014 18:38:37 +0000 (11:38 -0700)

Merge branch 'tb/crlf-tests'

* tb/crlf-tests:
MinGW: update tests to handle a native eol of crlf
Makefile: propagate NATIVE_CRLF to C
t0027: Tests for core.eol=native, eol=lf, eol=crlf

Merge branch 'rs/simplify-http-walker'Junio C Hamano Fri, 19 Sep 2014 18:38:36 +0000 (11:38 -0700)

Merge branch 'rs/simplify-http-walker'

Code clean-up.

* rs/simplify-http-walker:
http-walker: simplify process_alternates_response() using strbuf

Merge branch 'rs/simplify-config-include'Junio C Hamano Fri, 19 Sep 2014 18:38:36 +0000 (11:38 -0700)

Merge branch 'rs/simplify-config-include'

Code clean-up.

* rs/simplify-config-include:
config: simplify git_config_include()

Merge branch 'rs/merge-tree-simplify'Junio C Hamano Fri, 19 Sep 2014 18:38:36 +0000 (11:38 -0700)

Merge branch 'rs/merge-tree-simplify'

Code clean-up.

* rs/merge-tree-simplify:
merge-tree: remove unused df_conflict arguments

Merge branch 'da/styles'Junio C Hamano Fri, 19 Sep 2014 18:38:35 +0000 (11:38 -0700)

Merge branch 'da/styles'

* da/styles:
stylefix: asterisks stick to the variable, not the type

Merge branch 'ah/grammofix'Junio C Hamano Fri, 19 Sep 2014 18:38:35 +0000 (11:38 -0700)

Merge branch 'ah/grammofix'

* ah/grammofix:
grammofix in user-facing messages

Merge branch 'rs/more-uses-of-skip-prefix'Junio C Hamano Fri, 19 Sep 2014 18:38:35 +0000 (11:38 -0700)

Merge branch 'rs/more-uses-of-skip-prefix'

Code clean-up.

* rs/more-uses-of-skip-prefix:
pack-write: simplify index_pack_lockfile using skip_prefix() and xstrfmt()
connect: simplify check_ref() using skip_prefix() and starts_with()

Merge branch 'mb/fast-import-delete-root'Junio C Hamano Fri, 19 Sep 2014 18:38:34 +0000 (11:38 -0700)

Merge branch 'mb/fast-import-delete-root'

An attempt to remove the entire tree in the "git fast-import" input
stream caused it to misbehave.

* mb/fast-import-delete-root:
fast-import: fix segfault in store_tree()
t9300: test filedelete command

Merge branch 'jp/index-with-corrupt-stages'Junio C Hamano Fri, 19 Sep 2014 18:38:34 +0000 (11:38 -0700)

Merge branch 'jp/index-with-corrupt-stages'

A broken reimplementation of Git could write an invalid index that
records both stage #0 and higher stage entries for the same path.
Notice and reject such an index, as there is no sensible fallback
(we do not know if the broken tool wanted to resolve and forgot to
remove higher stage entries, or if it wanted to unresolve and
forgot to remove the stage#0 entry).

* jp/index-with-corrupt-stages:
read_index_unmerged(): remove unnecessary loop index adjustment
read_index_from(): catch out of order entries when reading an index file

Merge branch 'jk/index-pack-threading-races'Junio C Hamano Fri, 19 Sep 2014 18:38:33 +0000 (11:38 -0700)

Merge branch 'jk/index-pack-threading-races'

When receiving an invalid pack stream that records the same object
twice, multiple threads got confused due to a race. We should
reject or correct such a stream upon receiving, but that will be a
larger change.

* jk/index-pack-threading-races:
index-pack: fix race condition with duplicate bases

Merge branch 'jk/commit-author-parsing'Junio C Hamano Fri, 19 Sep 2014 18:38:33 +0000 (11:38 -0700)

Merge branch 'jk/commit-author-parsing'

Code clean-up.

* jk/commit-author-parsing:
determine_author_info(): copy getenv output
determine_author_info(): reuse parsing functions
date: use strbufs in date-formatting functions
record_author_date(): use find_commit_header()
record_author_date(): fix memory leak on malformed commit
commit: provide a function to find a header in a buffer

Merge branch 'bb/date-iso-strict'Junio C Hamano Fri, 19 Sep 2014 18:38:32 +0000 (11:38 -0700)

Merge branch 'bb/date-iso-strict'

"log --date=iso" uses a slight variant of ISO 8601 format that is
made more human readable. A new "--date=iso-strict" option gives
datetime output that is more strictly conformant.

* bb/date-iso-strict:
pretty: provide a strict ISO 8601 date format

Merge branch 'mb/build-contrib-svn-fe'Junio C Hamano Fri, 19 Sep 2014 18:38:32 +0000 (11:38 -0700)

Merge branch 'mb/build-contrib-svn-fe'

* mb/build-contrib-svn-fe:
contrib/svn-fe: fix Makefile

Merge branch 'jk/fast-export-anonymize'Junio C Hamano Fri, 19 Sep 2014 18:38:31 +0000 (11:38 -0700)

Merge branch 'jk/fast-export-anonymize'

Sometimes users want to report a bug they experience on their
repository, but they are not at liberty to share the contents of
the repository. "fast-export" was taught an "--anonymize" option
to replace blob contents, names of people and paths and log
messages with bland and simple strings to help them.

* jk/fast-export-anonymize:
docs/fast-export: explain --anonymize more completely
teach fast-export an --anonymize option

Merge branch 'jk/send-pack-many-refspecs'Junio C Hamano Fri, 19 Sep 2014 18:38:31 +0000 (11:38 -0700)

Merge branch 'jk/send-pack-many-refspecs'

The number of refs that can be pushed at once over smart HTTP was
limited by the command line length. The limitation has been lifted
by passing these refs from the standard input of send-pack.

* jk/send-pack-many-refspecs:
send-pack: take refspecs over stdin

stash: prefer --quiet over shell redirection of the... David Aguilar Tue, 16 Sep 2014 03:24:10 +0000 (20:24 -0700)

stash: prefer --quiet over shell redirection of the standard error stream

Use `git rev-parse --verify --quiet` instead of redirecting
stderr to /dev/null.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: make rev-parse --quiet actually quietDavid Aguilar Fri, 19 Sep 2014 03:45:37 +0000 (20:45 -0700)

refs: make rev-parse --quiet actually quiet

When a reflog is deleted, e.g. when "git stash" clears its stashes,
"git rev-parse --verify --quiet" dies:

fatal: Log for refs/stash is empty.

The reason is that the get_sha1() code path does not allow us
to suppress this message.

Pass the flags bitfield through get_sha1_with_context() so that
read_ref_at() can suppress the message.

Use get_sha1_with_context1() instead of get_sha1() in rev-parse
so that the --quiet flag is honored.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pretty: add %D format specifierHarry Jeffery Thu, 18 Sep 2014 20:53:53 +0000 (21:53 +0100)

pretty: add %D format specifier

Add a new format specifier, '%D' that is identical in behaviour to '%d',
except that it does not include the ' (' prefix or ')' suffix provided
by '%d'.

Signed-off-by: Harry Jeffery <harry@exec64.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

unblock and unignore SIGPIPEPatrick Reynolds Thu, 18 Sep 2014 16:57:09 +0000 (11:57 -0500)

unblock and unignore SIGPIPE

Blocked and ignored signals -- but not caught signals -- are inherited
across exec. Some callers with sloppy signal-handling behavior can call
git with SIGPIPE blocked or ignored, even non-deterministically. When
SIGPIPE is blocked or ignored, several git commands can run indefinitely,
ignoring EPIPE returns from write() calls, even when the process that
called them has gone away. Our specific case involved a pipe of git
diff-tree output to a script that reads a limited amount of diff data.

In an ideal world, git would never be called with SIGPIPE blocked or
ignored. But in the real world, several real potential callers, including
Perl, Apache, and Unicorn, sometimes spawn subprocesses with SIGPIPE
ignored. It is easier and more productive to harden git against this
mistake than to clean it up in every potential parent process.

Signed-off-by: Patrick Reynolds <patrick.reynolds@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

help: fix the size passed to qsortStefan Beller Wed, 17 Sep 2014 12:14:39 +0000 (14:14 +0200)

help: fix the size passed to qsort

We actually want to have the size of one 'name' and not the size
of the pointer.

Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch: clean up commit flags after merge-filter walkJeff King Thu, 18 Sep 2014 10:49:43 +0000 (06:49 -0400)

branch: clean up commit flags after merge-filter walk

When we run `branch --merged`, we use prepare_revision_walk
with the merge-filter marked as UNINTERESTING. Any branch
tips that are marked UNINTERESTING after it returns must be
ancestors of that commit. As we iterate through the list of
refs to show, we check item->commit->object.flags to see
whether it was marked.

This interacts badly with --verbose, which will do a
separate walk to find the ahead/behind information for each
branch. There are two bad things that can happen:

1. The ahead/behind walk may get the wrong results,
because it can see a bogus UNINTERESTING flag leftover
from the merge-filter walk.

2. We may omit some branches if their tips are involved in
the ahead/behind traversal of a branch shown earlier.
The ahead/behind walk carefully cleans up its commit
flags, meaning it may also erase the UNINTERESTING
flag that we expect to check later.

We can solve this by moving the merge-filter state for each
ref into its "struct ref_item" as soon as we finish the
merge-filter walk. That fixes (2). Then we are free to clear
the commit flags we used in the walk, fixing (1).

Note that we actually do away with the matches_merge_filter
helper entirely here, and inline it between the revision
walk and the flag-clearing. This ensures that nobody
accidentally calls it at the wrong time (it is only safe to
check in that instant between the setting and clearing of
the global flag).

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

use REALLOC_ARRAY for changing the allocation size... René Scharfe Tue, 16 Sep 2014 18:56:57 +0000 (20:56 +0200)

use REALLOC_ARRAY for changing the allocation size of arrays

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add macro REALLOC_ARRAYRené Scharfe Tue, 16 Sep 2014 18:56:48 +0000 (20:56 +0200)

add macro REALLOC_ARRAY

The macro ALLOC_GROW manages several aspects of dynamic memory
allocations for arrays: It performs overprovisioning in order to avoid
reallocations in future calls, updates the allocation size variable,
multiplies the item size and thus allows users to simply specify the
item count, performs the reallocation and updates the array pointer.

Sometimes this is too much. Add the macro REALLOC_ARRAY, which only
takes care of the latter three points and allows users to specfiy the
number of items the array can store. It can increase and also decrease
the size. Using the macro avoid duplicating the variable name and
takes care of the item sizes automatically.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

receive-pack: allow hooks to ignore its standard input... Junio C Hamano Fri, 12 Sep 2014 22:48:07 +0000 (15:48 -0700)

receive-pack: allow hooks to ignore its standard input stream

The pre-receive and post-receive hooks were designed to be an
improvement over old style update and post-update hooks, which take
the update information on their command line and are limited by the
command line length limit. The same information is fed from the
standard input to pre/post-receive hooks instead to lift this
limitation. It has been mandatory for these new style hooks to
consume the update information fully from the standard input stream.
Otherwise, they would risk killing the receive-pack process via
SIGPIPE.

If a hook does not want to look at all the information, it is easy
to send its standard input to /dev/null (perhaps a niche use of hook
might need to know only the fact that a push was made, without
having to know what objects have been pushed to update which refs),
and this has already been done by existing hooks that are written
carefully.

However, because there is no good way to consistently fail hooks
that do not consume the input fully (a small push may result in a
short update record that may fit within the pipe buffer, to which
the receive-pack process may manage to write before the hook has a
chance to exit without reading anything, which will not result in a
death-by-SIGPIPE of receive-pack), it can lead to a hard to diagnose
"once in a blue moon" phantom failure.

Lift this "hooks must consume their input fully" mandate. A mandate
that is not enforced strictly is not helping us to catch mistakes in
hooks. If a hook has a good reason to decide the outcome of its
operation without reading the information we feed it, let it do so
as it pleases.

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

Documentation/git-rebase.txt: <upstream> must be given... Sergey Organov Fri, 29 Aug 2014 13:51:46 +0000 (17:51 +0400)

Documentation/git-rebase.txt: <upstream> must be given to specify <branch>

Current syntax description makes one wonder if there is any
syntactic way to distinguish between <branch> and <upstream> so that
one can specify <branch> but not <upstream>, but that is not the
case.

Make it explicit that these arguments are positional, i.e. the
earlier ones cannot be omitted if you want to give later ones.

Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1503: use test_must_be_emptyDavid Aguilar Tue, 16 Sep 2014 03:24:08 +0000 (20:24 -0700)

t1503: use test_must_be_empty

Use `test_must_be_be_empty <file>` instead of `test -z "$(cat <file>)"`.

Suggested-by: Fabian Ruch <bafain@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

credential-cache: close stderr in daemon processJeff King Sun, 14 Sep 2014 07:35:06 +0000 (03:35 -0400)

credential-cache: close stderr in daemon process

If the stderr of "git credential-cache" is redirected to a
pipe, the reader on the other end of a pipe may be surprised
that the pipe remains open long after the process exits.
This happens because we may auto-spawn a daemon which is
long-lived, and which keeps stderr open.

We can solve this by redirecting the daemon's stderr to
/dev/null once we are ready to go into our event loop. We
would not want to do so before then, because we may want to
report errors about the setup (e.g., failure to establish
the listening socket).

This does mean that we will not report errors we encounter
for specific clients. That's acceptable, as such errors
should be rare (e.g., clients sending buggy requests).
However, we also provide an escape hatch: if you want to see
these later messages, you can provide the "--debug" option
to keep stderr open.

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

mailinfo: make ">From" in-body header check more robustJeff King Sun, 14 Sep 2014 01:30:38 +0000 (21:30 -0400)

mailinfo: make ">From" in-body header check more robust

Since commit 81c5cf7 (mailinfo: skip bogus UNIX From line inside
body, 2006-05-21), we have treated lines like ">From" in the body as
headers. This makes "git am" work for people who erroneously paste
the whole output from format-patch:

From 12345abcd...fedcba543210 Mon Sep 17 00:00:00 2001
From: them
Subject: [PATCH] whatever

into their email body (assuming that an mbox writer then quotes
"From" as ">From", as otherwise we would actually mailsplit on the
in-body line).

However, this has false positives if somebody actually has a commit
body that starts with "From "; in this case we erroneously remove
the line entirely from the commit message. We can make this check
more robust by making sure the line actually looks like a real mbox
"From" line.

Inspect the line that begins with ">From " a more carefully to only
skip lines that match the expected pattern (note that the datestamp
part of the format-patch output is designed to be kept constant to
help those who write magic(5) entries).

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

Documentation: a note about stdout for git rev-parse... David Aguilar Mon, 15 Sep 2014 19:07:39 +0000 (12:07 -0700)

Documentation: a note about stdout for git rev-parse --verify --quiet

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

compat-util: add _DEFAULT_SOURCE defineSergey Senozhatsky Sun, 14 Sep 2014 05:33:35 +0000 (14:33 +0900)

compat-util: add _DEFAULT_SOURCE define

glibc has deprecated the use of _BSD_SOURCE define

warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"

To make it easier to maintain a cross platform source code, that
warning can be suppressed by _DEFAULT_SOURCE.

Define both _BSD_SOURCE and _DEFAULT_SOURCE to clean-up the build.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: fix some typos in the preambleIan Liu Rodrigues Sat, 13 Sep 2014 14:20:22 +0000 (11:20 -0300)

Makefile: fix some typos in the preamble

Signed-off-by: Ian Liu Rodrigues <ian.liu88@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

repack: call prune_packed_objects() and update_server_i... René Scharfe Sat, 13 Sep 2014 07:28:01 +0000 (09:28 +0200)

repack: call prune_packed_objects() and update_server_info() directly

Call the functions behind git prune-packed and git update-server-info
directly instead of using run_command(). This is shorter, easier and
quicker.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

server-info: clean up after writing info/packsJeff King Sat, 13 Sep 2014 20:19:38 +0000 (16:19 -0400)

server-info: clean up after writing info/packs

We allocate pack information in a static global list but
never clean it up. This leaks memory, and means that calling
update_server_info twice will generate a buggy file (it will
have duplicate entries).

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

make update-server-info more robustJeff King Sat, 13 Sep 2014 20:19:20 +0000 (16:19 -0400)

make update-server-info more robust

Since "git update-server-info" may be called automatically
as part of a push or a "gc --auto", we should be robust
against two processes trying to update it simultaneously.
However, we currently use a fixed tempfile, which means that
two simultaneous writers may step on each other's toes and
end up renaming junk into place.

Let's instead switch to using a unique tempfile via mkstemp.
We do not want to use a lockfile here, because it's OK for
two writers to simultaneously update (one will "win" the
rename race, but that's OK; they should be writing the same
information).

While we're there, let's clean up a few other things:

1. Detect write errors. Report them and abort the update
if any are found.

2. Free path memory rather than leaking it (and clean up
the tempfile when necessary).

3. Use the pathdup functions consistently rather than
static buffers or manually calculated lengths.

This last one fixes a potential overflow of "infofile" in
update_info_packs (e.g., by putting large junk into
$GIT_OBJECT_DIRECTORY). However, this overflow was probably
not an interesting attack vector for two reasons:

a. The attacker would need to control the environment to
do this, in which case it was already game-over.

b. During its setup phase, git checks that the directory
actually exists, which means it is probably shorter
than PATH_MAX anyway.

Because both update_info_refs and update_info_packs share
these same failings (and largely duplicate each other), this
patch factors out the improved error-checking version into a
helper function.

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

prune-packed: fix minor memory leakJeff King Sat, 13 Sep 2014 20:16:53 +0000 (16:16 -0400)

prune-packed: fix minor memory leak

We form all of our directories in a strbuf, but never release it.

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