gitweb.git
Merge branch 'tg/fix-check-order-with-split-index'... Junio C Hamano Sat, 28 Mar 2015 16:33:07 +0000 (09:33 -0700)

Merge branch 'tg/fix-check-order-with-split-index' into maint

The split-index mode introduced at v2.3.0-rc0~41 was broken in the
codepath to protect us against a broken reimplementation of Git
that writes an invalid index with duplicated index entries, etc.

* tg/fix-check-order-with-split-index:
read-cache: fix reading of split index

Merge branch 'jk/prune-with-corrupt-refs' into maintJunio C Hamano Sat, 28 Mar 2015 16:33:06 +0000 (09:33 -0700)

Merge branch 'jk/prune-with-corrupt-refs' into maint

"git prune" used to largely ignore broken refs when deciding which
objects are still being used, which could spread an existing small
damage and make it a larger one.

* jk/prune-with-corrupt-refs:
refs.c: drop curate_packed_refs
repack: turn on "ref paranoia" when doing a destructive repack
prune: turn on ref_paranoia flag
refs: introduce a "ref paranoia" flag
t5312: test object deletion code paths in a corrupted repository

2.3.2 release notes: typofixThomas Ackermann Thu, 26 Mar 2015 20:29:47 +0000 (21:29 +0100)

2.3.2 release notes: typofix

Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jk/tag-h-column-is-a-listing-option'... Junio C Hamano Fri, 27 Mar 2015 20:00:23 +0000 (13:00 -0700)

Merge branch 'jk/tag-h-column-is-a-listing-option' into maint

"git tag -h" used to show the "--column" and "--sort" options
that are about listing in a wrong section.

* jk/tag-h-column-is-a-listing-option:
tag: fix some mis-organized options in "-h" listing

Merge branch 'jk/smart-http-hide-refs' into maintJunio C Hamano Fri, 27 Mar 2015 20:00:20 +0000 (13:00 -0700)

Merge branch 'jk/smart-http-hide-refs' into maint

The transfer.hiderefs support did not quite work for smart-http
transport.

* jk/smart-http-hide-refs:
upload-pack: do not check NULL return of lookup_unknown_object
upload-pack: fix transfer.hiderefs over smart-http

Merge branch 'js/completion-ctags-pattern-substitution... Junio C Hamano Fri, 27 Mar 2015 20:00:17 +0000 (13:00 -0700)

Merge branch 'js/completion-ctags-pattern-substitution-fix' into maint

The code that reads from the ctags file in the completion script
(in contrib/) did not spell ${param/pattern/string} substitution
correctly, which happened to work with bash but not with zsh.

* js/completion-ctags-pattern-substitution-fix:
contrib/completion: escape the forward slash in __git_match_ctag

Update mailmap to spell out "Alexander Kuleshov"Junio C Hamano Fri, 27 Mar 2015 19:58:04 +0000 (12:58 -0700)

Update mailmap to spell out "Alexander Kuleshov"

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

Git 2.3.4 v2.3.4Junio C Hamano Mon, 23 Mar 2015 18:27:27 +0000 (11:27 -0700)

Git 2.3.4

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

Merge branch 'rs/use-isxdigit' into maintJunio C Hamano Mon, 23 Mar 2015 18:23:41 +0000 (11:23 -0700)

Merge branch 'rs/use-isxdigit' into maint

Code cleanup.

* rs/use-isxdigit:
use isxdigit() for checking if a character is a hexadecimal digit

Merge branch 'rs/deflate-init-cleanup' into maintJunio C Hamano Mon, 23 Mar 2015 18:23:37 +0000 (11:23 -0700)

Merge branch 'rs/deflate-init-cleanup' into maint

Code simplification.

* rs/deflate-init-cleanup:
zlib: initialize git_zstream in git_deflate_init{,_gzip,_raw}

Merge branch 'ak/git-done-help-cleanup' into maintJunio C Hamano Mon, 23 Mar 2015 18:23:35 +0000 (11:23 -0700)

Merge branch 'ak/git-done-help-cleanup' into maint

Code simplification.

* ak/git-done-help-cleanup:
git: make was_alias and done_help non-static

Merge branch 'sg/completion-remote' into maintJunio C Hamano Mon, 23 Mar 2015 18:23:33 +0000 (11:23 -0700)

Merge branch 'sg/completion-remote' into maint

Code simplification.

* sg/completion-remote:
completion: simplify __git_remotes()
completion: add a test for __git_remotes() helper function

Merge branch 'mg/doc-status-color-slot' into maintJunio C Hamano Mon, 23 Mar 2015 18:23:30 +0000 (11:23 -0700)

Merge branch 'mg/doc-status-color-slot' into maint

Documentation fixes.

* mg/doc-status-color-slot:
config,completion: add color.status.unmerged

Merge branch 'jc/decorate-leaky-separator-color' into... Junio C Hamano Mon, 23 Mar 2015 18:23:28 +0000 (11:23 -0700)

Merge branch 'jc/decorate-leaky-separator-color' into maint

"git log --decorate" did not reset colors correctly around the
branch names.

* jc/decorate-leaky-separator-color:
log --decorate: do not leak "commit" color into the next item
Documentation/config.txt: simplify boolean description in the syntax section
Documentation/config.txt: describe 'color' value type in the "Values" section
Documentation/config.txt: have a separate "Values" section
Documentation/config.txt: describe the structure first and then meaning
Documentation/config.txt: explain multi-valued variables once
Documentation/config.txt: avoid unnecessary negation

Merge branch 'kn/git-cd-to-empty' into maintJunio C Hamano Mon, 23 Mar 2015 18:23:25 +0000 (11:23 -0700)

Merge branch 'kn/git-cd-to-empty' into maint

"git -C '' subcmd" refused to work in the current directory, unlike
"cd ''" which silently behaves as a no-op.

* kn/git-cd-to-empty:
git: treat "git -C '<path>'" as a no-op when <path> is empty

Merge branch 'km/imap-send-libcurl-options' into maintJunio C Hamano Mon, 23 Mar 2015 18:23:22 +0000 (11:23 -0700)

Merge branch 'km/imap-send-libcurl-options' into maint

"git imap-send" learned to optionally talk with an IMAP server via
libcURL; because there is no other option when Git is built with
NO_OPENSSL option, use that codepath by default under such
configuration.

* km/imap-send-libcurl-options:
imap-send: use cURL automatically when NO_OPENSSL defined

Merge branch 'mg/verify-commit' into maintJunio C Hamano Mon, 23 Mar 2015 18:23:19 +0000 (11:23 -0700)

Merge branch 'mg/verify-commit' into maint

Workarounds for certain build of GPG that triggered false breakage
in a test.

* mg/verify-commit:
t7510: do not fail when gpg warns about insecure memory

Merge branch 'es/rebase-i-count-todo' into maintJunio C Hamano Mon, 23 Mar 2015 18:23:17 +0000 (11:23 -0700)

Merge branch 'es/rebase-i-count-todo' into maint

"git rebase -i" recently started to include the number of
commits in the insn sheet to be processed, but on a platform
that prepends leading whitespaces to "wc -l" output, the numbers
are shown with extra whitespaces that aren't necessary.

* es/rebase-i-count-todo:
rebase-interactive: re-word "item count" comment
rebase-interactive: suppress whitespace preceding item count

Merge branch 'tb/connect-ipv6-parse-fix' into maintJunio C Hamano Mon, 23 Mar 2015 18:23:12 +0000 (11:23 -0700)

Merge branch 'tb/connect-ipv6-parse-fix' into maint

We did not parse username followed by literal IPv6 address in SSH
transport URLs, e.g. ssh://user@[2001:db8::1]:22/repo.git
correctly.

* tb/connect-ipv6-parse-fix:
t5500: show user name and host in diag-url
t5601: add more test cases for IPV6
connect.c: allow ssh://user@[2001:db8::1]/repo.git

read-cache: fix reading of split indexThomas Gummerer Fri, 20 Mar 2015 21:43:14 +0000 (22:43 +0100)

read-cache: fix reading of split index

The split index extension uses ewah bitmaps to mark index entries as
deleted, instead of removing them from the index directly. This can
result in an on-disk index, in which entries of stage #0 and higher
stages appear, which are removed later when the index bases are merged.

15999d0 read_index_from(): catch out of order entries when reading an
index file introduces a check which checks if the entries are in order
after each index entry is read in do_read_index. This check may however
fail when a split index is read.

Fix this by moving checking the index after we know there is no split
index or after the split index bases are successfully merged instead.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: drop curate_packed_refsJeff King Fri, 20 Mar 2015 18:43:17 +0000 (14:43 -0400)

refs.c: drop curate_packed_refs

When we delete a ref, we have to rewrite the entire
packed-refs file. We take this opportunity to "curate" the
packed-refs file and drop any entries that are crufty or
broken.

Dropping broken entries (e.g., with bogus names, or ones
that point to missing objects) is actively a bad idea, as it
means that we lose any notion that the data was there in the
first place. Aside from the general hackiness that we might
lose any information about ref "foo" while deleting an
unrelated ref "bar", this may seriously hamper any attempts
by the user at recovering from the corruption in "foo".

They will lose the sha1 and name of "foo"; the exact pointer
may still be useful even if they recover missing objects
from a different copy of the repository. But worse, once the
ref is gone, there is no trace of the corruption. A
follow-up "git prune" may delete objects, even though it
would otherwise bail when seeing corruption.

We could just drop the "broken" bits from
curate_packed_refs, and continue to drop the "crufty" bits:
refs whose loose counterpart exists in the filesystem. This
is not wrong to do, and it does have the advantage that we
may write out a slightly smaller packed-refs file. But it
has two disadvantages:

1. It is a potential source of races or mistakes with
respect to these refs that are otherwise unrelated to
the operation. To my knowledge, there aren't any active
problems in this area, but it seems like an unnecessary
risk.

2. We have to spend time looking up the matching loose
refs for every item in the packed-refs file. If you
have a large number of packed refs that do not change,
that outweighs the benefit from writing out a smaller
packed-refs file (it doesn't get smaller, and you do a
bunch of directory traversal to find that out).

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

repack: turn on "ref paranoia" when doing a destructive... Jeff King Fri, 20 Mar 2015 18:43:13 +0000 (14:43 -0400)

repack: turn on "ref paranoia" when doing a destructive repack

If we are repacking with "-ad", we will drop any unreachable
objects. Likewise, using "-Ad --unpack-unreachable=<time>"
will drop any old, unreachable objects. In these cases, we
want to make sure the reachability we compute with "--all"
is complete. We can do this by passing GIT_REF_PARANOIA=1 in
the environment to pack-objects.

Note that "-Ad" is safe already, because it only loosens
unreachable objects. It is up to "git prune" to avoid
deleting them.

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

prune: turn on ref_paranoia flagJeff King Fri, 20 Mar 2015 18:43:09 +0000 (14:43 -0400)

prune: turn on ref_paranoia flag

Prune should know about broken objects at the tips of refs,
so that we can feed them to our traversal rather than
ignoring them. It's better for us to abort the operation on
the broken object than it is to start deleting objects with
an incomplete view of the reachability namespace.

Note that for missing objects, aborting is the best we can
do. For a badly-named ref, we technically could use its sha1
as a reachability tip. However, the iteration code just
feeds us a null sha1, so there would be a reasonable amount
of code involved to pass down our wishes. It's not really
worth trying to do better, because this is a case that
should happen extremely rarely, and the message we provide:

fatal: unable to parse object: refs/heads/bogus:name

is probably enough to point the user in the right direction.

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

refs: introduce a "ref paranoia" flagJeff King Fri, 20 Mar 2015 18:43:06 +0000 (14:43 -0400)

refs: introduce a "ref paranoia" flag

Most operations that iterate over refs are happy to ignore
broken cruft. However, some operations should be performed
with knowledge of these broken refs, because it is better
for the operation to choke on a missing object than it is to
silently pretend that the ref did not exist (e.g., if we are
computing the set of reachable tips in order to prune
objects).

These processes could just call for_each_rawref, except that
ref iteration is often hidden behind other interfaces. For
instance, for a destructive "repack -ad", we would have to
inform "pack-objects" that we are destructive, and then it
would in turn have to tell the revision code that our
"--all" should include broken refs.

It's much simpler to just set a global for "dangerous"
operations that includes broken refs in all iterations.

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

t5312: test object deletion code paths in a corrupted... Jeff King Fri, 20 Mar 2015 18:43:02 +0000 (14:43 -0400)

t5312: test object deletion code paths in a corrupted repository

When we are doing a destructive operation like "git prune",
we want to be extra careful that the set of reachable tips
we compute is valid. If there is any corruption or oddity,
we are better off aborting the operation and letting the
user figure things out rather than plowing ahead and
possibly deleting some data that cannot be recovered.

The tests here include:

1. Pruning objects mentioned only be refs with invalid
names. This used to abort prior to d0f810f (refs.c:
allow listing and deleting badly named refs,
2014-09-03), but since then we silently ignore the tip.

Likewise, we test repacking that can drop objects
(either "-ad", which drops anything unreachable,
or "-Ad --unpack-unreachable=<time>", which tries to
optimize out a loose object write that would be
directly pruned).

2. Pruning objects when some refs point to missing
objects. We don't know whether any dangling objects
would have been reachable from the missing objects. We
are better to keep them around, as they are better than
nothing for helping the user recover history.

3. Packed refs that point to missing objects can sometimes
be dropped. By itself, this is more of an annoyance
(you do not have the object anyway; even if you can
recover it from elsewhere, all you are losing is a
placeholder for your state at the time of corruption).
But coupled with (2), if we drop the ref and then go
on to prune, we may lose unrecoverable objects.

Note that we use test_might_fail for some of the operations.
In some cases, it would be appropriate to abort the
operation, and in others, it might be acceptable to continue
but taking the information into account. The tests don't
care either way, and check only for data loss.

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

contrib/completion: escape the forward slash in __git_m... John Szakmeister Sat, 14 Mar 2015 13:40:39 +0000 (09:40 -0400)

contrib/completion: escape the forward slash in __git_match_ctag

The current definition results in an incorrect expansion of the term under zsh.
For instance "/^${1////\\/}/" under zsh with the argument "hi" results in:
/^/\/h/\/i/

This results in an output similar to this when trying to complete `git grep
chartab` under zsh:

:: git grep chartabawk: cmd. line:1: /^/\/c/\/h/\/a/\/r/\/t/\/a/\/b/ { print $1 }
awk: cmd. line:1: ^ backslash not last character on line
awk: cmd. line:1: /^/\/c/\/h/\/a/\/r/\/t/\/a/\/b/ { print $1 }
awk: cmd. line:1: ^ syntax error

Leaving the prompt in a goofy state until the user hits a key.

Escaping the literal / in the parameter expansion (using "/^${1//\//\\/}/")
results in:
/^chartab/

allowing the completion to work correctly.

This formulation also works under bash.

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

Git 2.3.3 v2.3.3Junio C Hamano Sat, 14 Mar 2015 05:57:25 +0000 (22:57 -0700)

Git 2.3.3

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

Merge branch 'mr/doc-clean-f-f' into maintJunio C Hamano Sat, 14 Mar 2015 05:56:12 +0000 (22:56 -0700)

Merge branch 'mr/doc-clean-f-f' into maint

Documentation update.

* mr/doc-clean-f-f:
Documentation/git-clean.txt: document that -f may need to be given twice

Merge branch 'ak/t5516-typofix' into maintJunio C Hamano Sat, 14 Mar 2015 05:56:11 +0000 (22:56 -0700)

Merge branch 'ak/t5516-typofix' into maint

* ak/t5516-typofix:
t5516: correct misspelled pushInsteadOf

Merge branch 'jc/diff-test-updates' into maintJunio C Hamano Sat, 14 Mar 2015 05:56:09 +0000 (22:56 -0700)

Merge branch 'jc/diff-test-updates' into maint

Test clean-up.

* jc/diff-test-updates:
test_ln_s_add: refresh stat info of fake symbolic links
t4008: modernise style
t/diff-lib: check exact object names in compare_diff_raw
tests: do not borrow from COPYING and README from the real source
t4010: correct expected object names
t9300: correct expected object names
t4008: correct stale comments

Merge branch 'jk/diffcore-rename-duplicate' into maintJunio C Hamano Sat, 14 Mar 2015 05:56:08 +0000 (22:56 -0700)

Merge branch 'jk/diffcore-rename-duplicate' into maint

A corrupt input to "git diff -M" can cause us to segfault.

* jk/diffcore-rename-duplicate:
diffcore-rename: avoid processing duplicate destinations
diffcore-rename: split locate_rename_dst into two functions

Merge branch 'bw/kwset-use-unsigned' into maintJunio C Hamano Sat, 14 Mar 2015 05:56:07 +0000 (22:56 -0700)

Merge branch 'bw/kwset-use-unsigned' into maint

The borrowed code in kwset API did not follow our usual convention
to use "unsigned char" to store values that range from 0-255.

* bw/kwset-use-unsigned:
kwset: use unsigned char to store values with high-bit set

Merge branch 'nd/grep-exclude-standard-help-fix' into... Junio C Hamano Sat, 14 Mar 2015 05:56:06 +0000 (22:56 -0700)

Merge branch 'nd/grep-exclude-standard-help-fix' into maint

Description given by "grep -h" for its --exclude-standard option
was phrased poorly.

* nd/grep-exclude-standard-help-fix:
grep: correct help string for --exclude-standard

Merge branch 'mg/doc-remote-tags-or-not' into maintJunio C Hamano Sat, 14 Mar 2015 05:56:05 +0000 (22:56 -0700)

Merge branch 'mg/doc-remote-tags-or-not' into maint

"git remote add" mentioned "--tags" and "--no-tags" and was not
clear that fetch from the remote in the future will use the default
behaviour when neither is given to override it.

* mg/doc-remote-tags-or-not:
git-remote.txt: describe behavior without --tags and --no-tags

Merge branch 'mk/diff-shortstat-dirstat-fix' into maintJunio C Hamano Sat, 14 Mar 2015 05:56:04 +0000 (22:56 -0700)

Merge branch 'mk/diff-shortstat-dirstat-fix' into maint

"git diff --shortstat --dirstat=changes" showed a dirstat based on
lines that was never asked by the end user in addition to the
dirstat that the user asked for.

* mk/diff-shortstat-dirstat-fix:
diff --shortstat --dirstat: remove duplicate output

Merge branch 'ms/submodule-update-config-doc' into... Junio C Hamano Sat, 14 Mar 2015 05:56:03 +0000 (22:56 -0700)

Merge branch 'ms/submodule-update-config-doc' into maint

The interaction between "git submodule update" and the
submodule.*.update configuration was not clearly documented.

* ms/submodule-update-config-doc:
submodule: improve documentation of update subcommand

Merge branch 'jc/apply-beyond-symlink' into maintJunio C Hamano Sat, 14 Mar 2015 05:56:02 +0000 (22:56 -0700)

Merge branch 'jc/apply-beyond-symlink' into maint

"git apply" was not very careful about reading from, removing,
updating and creating paths outside the working tree (under
--index/--cached) or the current directory (when used as a
replacement for GNU patch).

* jc/apply-beyond-symlink:
apply: do not touch a file beyond a symbolic link
apply: do not read from beyond a symbolic link
apply: do not read from the filesystem under --index
apply: reject input that touches outside the working area

Merge branch 'rs/daemon-interpolate' into maintJunio C Hamano Sat, 14 Mar 2015 05:56:00 +0000 (22:56 -0700)

Merge branch 'rs/daemon-interpolate' into maint

"git daemon" looked up the hostname even when "%CH" and "%IP"
interpolations are not requested, which was unnecessary.

* rs/daemon-interpolate:
daemon: use callback to build interpolated path
daemon: look up client-supplied hostname lazily

Merge branch 'jk/daemon-interpolate' into maintJunio C Hamano Sat, 14 Mar 2015 05:55:59 +0000 (22:55 -0700)

Merge branch 'jk/daemon-interpolate' into maint

The "interpolated-path" option of "git daemon" inserted any string
client declared on the "host=" capability request without checking.
Sanitize and limit %H and %CH to a saner and a valid DNS name.

* jk/daemon-interpolate:
daemon: sanitize incoming virtual hostname
t5570: test git-daemon's --interpolated-path option
git_connect: let user override virtual-host we send to daemon

upload-pack: do not check NULL return of lookup_unknown... Jeff King Fri, 13 Mar 2015 04:42:25 +0000 (00:42 -0400)

upload-pack: do not check NULL return of lookup_unknown_object

We check whether the return value of lookup_unknown_object
is NULL, but some code paths dereference it before our
check. This turns out not to be capable of causing a
segfault, though. The lookup_unknown_object function will
never return NULL, since the whole point is to allocate an
object struct if it does not find an existing one. So the
code here is not wrong, it is just confusing. Let's just
drop the NULL check.

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

upload-pack: fix transfer.hiderefs over smart-httpJeff King Fri, 13 Mar 2015 04:42:12 +0000 (00:42 -0400)

upload-pack: fix transfer.hiderefs over smart-http

When upload-pack advertises the refs (either for a normal,
non-stateless request, or for the initial contact in a
stateless one), we call for_each_ref with the send_ref
function as its callback. send_ref, in turn, calls
mark_our_ref, which checks whether the ref is hidden, and
sets OUR_REF or HIDDEN_REF on the object as appropriate. If
it is hidden, mark_our_ref also returns "1" to signal
send_ref that the ref should not be advertised.

If we are not advertising refs, (i.e., the follow-up
invocation by an http client to send its "want" lines), we
use mark_our_ref directly as a callback to for_each_ref. Its
marking does the right thing, but when it then returns "1"
to for_each_ref, the latter interprets this as an error and
stops iterating. As a result, we skip marking all of the
refs that come lexicographically after it. Any "want" lines
from the client asking for those objects will fail, as they
were not properly marked with OUR_REF.

To solve this, we introduce a wrapper callback around
mark_our_ref which always returns 0 (even if the ref is
hidden, we want to keep iterating). We also tweak the
signature of mark_our_ref to exclude unnecessary parameters
that were present only to conform to the callback interface.
This should make it less likely for somebody to accidentally
use it as a callback in the future.

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

tag: fix some mis-organized options in "-h" listingJeff King Thu, 12 Mar 2015 18:15:09 +0000 (14:15 -0400)

tag: fix some mis-organized options in "-h" listing

Running "git tag -h" currently prints:

[...]
Tag creation options
[...]
--column[=<style>] show tag list in columns
--sort <type> sort tags

Tag listing options
--contains <commit> print only tags that contain the commit
--points-at <object> print only tags of the object

The "--column" and "--sort" options should go under the "Tag listing" group.

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

use isxdigit() for checking if a character is a hexadec... René Scharfe Mon, 9 Mar 2015 22:46:54 +0000 (23:46 +0100)

use isxdigit() for checking if a character is a hexadecimal digit

Use the standard function isxdigit() to make the intent clearer and
avoid using magic constants.

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

config,completion: add color.status.unmergedMichael J Gruber Tue, 10 Mar 2015 16:11:09 +0000 (17:11 +0100)

config,completion: add color.status.unmerged

Reported-by: "Mladen B." <mladen074@gmail.com>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7510: do not fail when gpg warns about insecure memoryKyle J. McKay Mon, 9 Mar 2015 20:03:01 +0000 (13:03 -0700)

t7510: do not fail when gpg warns about insecure memory

Depending on how gpg was built, it may issue the following
message to stderr when run:

Warning: using insecure memory!

When the test is collecting gpg output it is therefore not
enough to just match on a "gpg: " prefix it must also match
on a "Warning: " prefix wherever it needs to match lines
that have been produced by gpg.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Acked-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

imap-send: use cURL automatically when NO_OPENSSL definedKyle J. McKay Sun, 8 Mar 2015 05:13:55 +0000 (21:13 -0800)

imap-send: use cURL automatically when NO_OPENSSL defined

If both USE_CURL_FOR_IMAP_SEND and NO_OPENSSL are defined do
not force the user to add --curl to get a working git imap-send
command.

Instead automatically select --curl and warn and ignore the
--no-curl option. And while we're in there, correct the
warning message when --curl is requested but not supported.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git: treat "git -C '<path>'" as a no-op when <path... Karthik Nayak Fri, 6 Mar 2015 11:18:08 +0000 (16:48 +0530)

git: treat "git -C '<path>'" as a no-op when <path> is empty

'git -C ""' unhelpfully dies with error "Cannot change to ''",
whereas the shell treats `cd ""' as a no-op. Taking the shell's
behavior as a precedent, teach git to treat `-C ""' as a no-op, as
well.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.3.2 v2.3.2Junio C Hamano Fri, 6 Mar 2015 22:58:14 +0000 (14:58 -0800)

Git 2.3.2

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

Merge branch 'rj/no-xopen-source-for-cygwin' into maintJunio C Hamano Fri, 6 Mar 2015 22:57:58 +0000 (14:57 -0800)

Merge branch 'rj/no-xopen-source-for-cygwin' into maint

Code cleanups.

* rj/no-xopen-source-for-cygwin:
git-compat-util.h: remove redundant code

Merge branch 'rs/simple-cleanups' into maintJunio C Hamano Fri, 6 Mar 2015 22:57:57 +0000 (14:57 -0800)

Merge branch 'rs/simple-cleanups' into maint

Code cleanups.

* rs/simple-cleanups:
sha1_name: use strlcpy() to copy strings
pretty: use starts_with() to check for a prefix
for-each-ref: use skip_prefix() to avoid duplicate string comparison
connect: use strcmp() for string comparison

Merge branch 'mm/am-c-doc' into maintJunio C Hamano Fri, 6 Mar 2015 22:57:56 +0000 (14:57 -0800)

Merge branch 'mm/am-c-doc' into maint

The configuration variable 'mailinfo.scissors' was hard to
discover in the documentation.

* mm/am-c-doc:
Documentation/git-am.txt: mention mailinfo.scissors config variable
Documentation/config.txt: document mailinfo.scissors

Merge branch 'ew/svn-maint-fixes' into maintJunio C Hamano Fri, 6 Mar 2015 22:57:55 +0000 (14:57 -0800)

Merge branch 'ew/svn-maint-fixes' into maint

Correct a breakage to git-svn around v2.2 era that triggers
premature closing of FileHandle.

* ew/svn-maint-fixes:
Git::SVN::*: avoid premature FileHandle closure
git-svn: fix localtime=true on non-glibc environments

Merge branch 'km/send-email-getopt-long-workarounds... Junio C Hamano Fri, 6 Mar 2015 22:57:54 +0000 (14:57 -0800)

Merge branch 'km/send-email-getopt-long-workarounds' into maint

Even though we officially haven't dropped Perl 5.8 support, the
Getopt::Long package that came with it does not support "--no-"
prefix to negate a boolean option; manually add support to help
people with older Getopt::Long package.

* km/send-email-getopt-long-workarounds:
git-send-email.perl: support no- prefix with older GetOptions

completion: simplify __git_remotes()SZEDER Gábor Wed, 4 Mar 2015 14:10:29 +0000 (15:10 +0100)

completion: simplify __git_remotes()

The __git_remotes() helper function lists the remotes from the config
file by processing the output of a 'git config' query. A simple 'git
remote' produces the exact same output, so run that instead.

Remotes under '$GIT_DIR/remotes' are still listed by running 'ls -1',
because 'git remote' unfortunately ignores them.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: add a test for __git_remotes() helper functionSZEDER Gábor Wed, 4 Mar 2015 14:10:28 +0000 (15:10 +0100)

completion: add a test for __git_remotes() helper function

The test checks that both remotes under '$GIT_DIR/remotes' and remotes
in the config file are listed.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase-interactive: re-word "item count" commentEric Sunshine Wed, 4 Mar 2015 07:53:05 +0000 (02:53 -0500)

rebase-interactive: re-word "item count" comment

97f05f43 (Show number of TODO items for interactive rebase, 2014-12-10)
taught rebase-interactive to display an item count in the instruction
list comments:

# Rebase 46640c6..5568fd5 onto 46640c6 (4 TODO item(s))
#
# Commands:
# p, pick = use commit
# ...

However, with the exception of the --edit-todo option, "TODO" is a
one-off term, never presented to the user by rebase-interactive in
any other context. The item count is in fact the number of commands
("pick", "edit", etc.) remaining on the instruction sheet, and the
comment immediately following it talks about "Commands". Consequently,
replace "(# TODO item(s))" with the more accurate and meaningful
"(# command(s))".

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

rebase-interactive: suppress whitespace preceding item... Eric Sunshine Wed, 4 Mar 2015 07:53:04 +0000 (02:53 -0500)

rebase-interactive: suppress whitespace preceding item count

97f05f43 (Show number of TODO items for interactive rebase, 2014-12-10)
taught rebase-interactive to compute an item count with 'wc -l' and
display it in the instruction list comments:

# Rebase 46640c6..5568fd5 onto 46640c6 (4 TODO item(s))

On Mac OS X, however, it renders as:

# Rebase 46640c6..5568fd5 onto 46640c6 ( 4 TODO item(s))

since 'wc -l' indents its output with leading spaces. Fix this.

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

git: make was_alias and done_help non-staticAlexander Kuleshov Mon, 2 Mar 2015 12:02:37 +0000 (18:02 +0600)

git: make was_alias and done_help non-static

'was_alias' variable does not need to store it's value on each
iteration in the loop; this variable gets assigned the result
of run_argv() every time in the loop before being used.

'done_help' variable does not need to be static variable too if
we move it out the loop.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

zlib: initialize git_zstream in git_deflate_init{,_gzip... René Scharfe Thu, 5 Mar 2015 22:49:46 +0000 (23:49 +0100)

zlib: initialize git_zstream in git_deflate_init{,_gzip,_raw}

Clear the git_zstream variable at the start of git_deflate_init() etc.
so that callers don't have to do that.

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

Prepare for 2.3.2Junio C Hamano Thu, 5 Mar 2015 21:15:53 +0000 (13:15 -0800)

Prepare for 2.3.2

Merge branch 'sb/plug-leak-in-make-cache-entry' into... Junio C Hamano Thu, 5 Mar 2015 21:13:13 +0000 (13:13 -0800)

Merge branch 'sb/plug-leak-in-make-cache-entry' into maint

"update-index --refresh" used to leak when an entry cannot be
refreshed for whatever reason.

* sb/plug-leak-in-make-cache-entry:
read-cache.c: free cache entry when refreshing fails

Merge branch 'jk/fast-import-die-nicely-fix' into maintJunio C Hamano Thu, 5 Mar 2015 21:13:12 +0000 (13:13 -0800)

Merge branch 'jk/fast-import-die-nicely-fix' into maint

"git fast-import" used to crash when it could not close and
conclude the resulting packfile cleanly.

* jk/fast-import-die-nicely-fix:
fast-import: avoid running end_packfile recursively

Merge branch 'es/blame-commit-info-fix' into maintJunio C Hamano Thu, 5 Mar 2015 21:13:12 +0000 (13:13 -0800)

Merge branch 'es/blame-commit-info-fix' into maint

"git blame" died, trying to free an uninitialized piece of memory.

* es/blame-commit-info-fix:
builtin/blame: destroy initialized commit_info only

Merge branch 'ab/merge-file-prefix' into maintJunio C Hamano Thu, 5 Mar 2015 21:13:10 +0000 (13:13 -0800)

Merge branch 'ab/merge-file-prefix' into maint

"git merge-file" did not work correctly in a subdirectory.

* ab/merge-file-prefix:
merge-file: correctly open files when in a subdir

Merge branch 'ps/submodule-sanitize-path-upon-add'... Junio C Hamano Thu, 5 Mar 2015 21:13:09 +0000 (13:13 -0800)

Merge branch 'ps/submodule-sanitize-path-upon-add' into maint

"git submodule add" failed to squash "path/to/././submodule" to
"path/to/submodule".

* ps/submodule-sanitize-path-upon-add:
git-submodule.sh: fix '/././' path normalization

Merge branch 'jk/prune-mtime' into maintJunio C Hamano Thu, 5 Mar 2015 21:13:08 +0000 (13:13 -0800)

Merge branch 'jk/prune-mtime' into maint

In v2.2.0, we broke "git prune" that runs in a repository that
borrows from an alternate object store.

* jk/prune-mtime:
sha1_file: fix iterating loose alternate objects
for_each_loose_file_in_objdir: take an optional strbuf path

Merge branch 'tc/curl-vernum-output-broken-in-7.11... Junio C Hamano Thu, 5 Mar 2015 21:13:07 +0000 (13:13 -0800)

Merge branch 'tc/curl-vernum-output-broken-in-7.11' into maint

Certain older vintages of cURL give irregular output from
"curl-config --vernum", which confused our build system.

* tc/curl-vernum-output-broken-in-7.11:
Makefile: handle broken curl version number in version check

Merge branch 'es/squelch-openssl-warnings-on-macosx... Junio C Hamano Thu, 5 Mar 2015 21:13:06 +0000 (13:13 -0800)

Merge branch 'es/squelch-openssl-warnings-on-macosx' into maint

An earlier workaround to squelch unhelpful deprecation warnings
from the complier on Mac OSX unnecessarily set minimum required
version of the OS, which the user might want to raise (or lower)
for other reasons.

* es/squelch-openssl-warnings-on-macosx:
git-compat-util: do not step on MAC_OS_X_VERSION_MIN_REQUIRED

Merge branch 'jc/conf-var-doc' into maintJunio C Hamano Thu, 5 Mar 2015 21:13:05 +0000 (13:13 -0800)

Merge branch 'jc/conf-var-doc' into maint

Longstanding configuration variable naming rules has been added to
the documentation.

* jc/conf-var-doc:
CodingGuidelines: describe naming rules for configuration variables
config.txt: mark deprecated variables more prominently
config.txt: clarify that add.ignore-errors is deprecated

Merge branch 'av/wincred-with-at-in-username-fix' into... Junio C Hamano Thu, 5 Mar 2015 21:13:04 +0000 (13:13 -0800)

Merge branch 'av/wincred-with-at-in-username-fix' into maint

The credential helper for Windows (in contrib/) used to mishandle
a user name with an at-sign in it.

* av/wincred-with-at-in-username-fix:
wincred: fix get credential if username has "@"

Merge branch 'ch/new-gpg-drops-rfc-1991' into maintJunio C Hamano Thu, 5 Mar 2015 21:13:03 +0000 (13:13 -0800)

Merge branch 'ch/new-gpg-drops-rfc-1991' into maint

Older GnuPG implementations may not correctly import the keyring
material we prepare for the tests to use.

* ch/new-gpg-drops-rfc-1991:
t/lib-gpg: sanity-check that we can actually sign
t/lib-gpg: include separate public keys in keyring.gpg

Merge branch 'jc/remote-set-url-doc' into maintJunio C Hamano Thu, 5 Mar 2015 21:13:03 +0000 (13:13 -0800)

Merge branch 'jc/remote-set-url-doc' into maint

Clarify in the documentation that "remote.<nick>.pushURL" and
"remote.<nick>.URL" are there to name the same repository accessed
via different transports, not two separate repositories.

* jc/remote-set-url-doc:
Documentation/git-remote.txt: stress that set-url is not for triangular

Merge branch 'jk/pack-bitmap' into maintJunio C Hamano Thu, 5 Mar 2015 21:13:02 +0000 (13:13 -0800)

Merge branch 'jk/pack-bitmap' into maint

The pack bitmap support did not build with older versions of GCC.

* jk/pack-bitmap:
ewah: fix building with gcc < 3.4.0

Merge branch 'jk/config-no-ungetc-eof' into maintJunio C Hamano Thu, 5 Mar 2015 21:13:00 +0000 (13:13 -0800)

Merge branch 'jk/config-no-ungetc-eof' into maint

Reading configuration from a blob object, when it ends with a lone
CR, use to confuse the configuration parser.

* jk/config-no-ungetc-eof:
config_buf_ungetc: warn when pushing back a random character
config: do not ungetc EOF

Merge branch 'jk/decimal-width-for-uintmax' into maintJunio C Hamano Thu, 5 Mar 2015 21:12:59 +0000 (13:12 -0800)

Merge branch 'jk/decimal-width-for-uintmax' into maint

We didn't format an integer that wouldn't fit in "int" but in
"uintmax_t" correctly.

* jk/decimal-width-for-uintmax:
decimal_width: avoid integer overflow

Merge branch 'jc/push-cert' into maintJunio C Hamano Thu, 5 Mar 2015 21:12:58 +0000 (13:12 -0800)

Merge branch 'jc/push-cert' into maint

"git push --signed" gave an incorrectly worded error message when
the other side did not support the capability.

* jc/push-cert:
transport-helper: fix typo in error message when --signed is not supported

Merge branch 'mh/deref-symref-over-helper-transport... Junio C Hamano Thu, 5 Mar 2015 21:12:57 +0000 (13:12 -0800)

Merge branch 'mh/deref-symref-over-helper-transport' into maint

"git fetch" over a remote-helper that cannot respond to "list"
command could not fetch from a symbolic reference e.g. HEAD.

* mh/deref-symref-over-helper-transport:
transport-helper: do not request symbolic refs to remote helpers

Merge branch 'ks/rebase-i-abbrev' into maintJunio C Hamano Thu, 5 Mar 2015 21:12:56 +0000 (13:12 -0800)

Merge branch 'ks/rebase-i-abbrev' into maint

The insn sheet "git rebase -i" creates did not fully honor
core.abbrev settings.

* ks/rebase-i-abbrev:
rebase -i: use full object name internally throughout the script

Merge branch 'dp/remove-duplicated-header-inclusion... Junio C Hamano Thu, 5 Mar 2015 21:12:55 +0000 (13:12 -0800)

Merge branch 'dp/remove-duplicated-header-inclusion' into maint

Code clean-up.

* dp/remove-duplicated-header-inclusion:
do not include the same header twice

Merge branch 'sb/hex-object-name-is-at-most-41-bytes... Junio C Hamano Thu, 5 Mar 2015 21:12:54 +0000 (13:12 -0800)

Merge branch 'sb/hex-object-name-is-at-most-41-bytes-long' into maint

Code clean-up.

* sb/hex-object-name-is-at-most-41-bytes-long:
hex.c: reduce memory footprint of sha1_to_hex static buffers

Merge branch 'ak/git-pm-typofix' into maintJunio C Hamano Thu, 5 Mar 2015 21:12:53 +0000 (13:12 -0800)

Merge branch 'ak/git-pm-typofix' into maint

Typofix in comments.

* ak/git-pm-typofix:
Git.pm: two minor typo fixes

Merge branch 'jk/sanity' into maintJunio C Hamano Thu, 5 Mar 2015 21:12:52 +0000 (13:12 -0800)

Merge branch 'jk/sanity' into maint

The tests that wanted to see that file becomes unreadable after
running "chmod a-r file", and the tests that wanted to make sure it
is not run as root, we used "can we write into the / directory?" as
a cheap substitute, but on some platforms that is not a good
heuristics. The tests and their prerequisites have been updated to
check what they really require.

* jk/sanity:
test-lib.sh: set prerequisite SANITY by testing what we really need
tests: correct misuses of POSIXPERM
t/lib-httpd: switch SANITY check for NOT_ROOT

log --decorate: do not leak "commit" color into the... Junio C Hamano Wed, 4 Mar 2015 19:07:12 +0000 (11:07 -0800)

log --decorate: do not leak "commit" color into the next item

In "git log --decorate", you would see the commit header like this:

commit ... (HEAD, jc/decorate-leaky-separator-color)

where "commit ... (" is painted in color.diff.commit, "HEAD" in
color.decorate.head, ", " in color.diff.commit, the branch name in
color.decorate.branch and then closing ")" in color.diff.commit.

If you wanted to paint the HEAD and local branch name in the same
color as the body text (perhaps because cyan and green are too faint
on a black-on-white terminal to be readable), you would not want to
have to say

[color "decorate"]
head = black
branch = black

because that you would not be able to reuse same configuration on a
white-on-black terminal. You would naively expect

[color "decorate"]
head = normal
branch = normal

to work, but unfortunately it does not. It paints the string "HEAD"
and the branch name in the same color as the opening parenthesis or
comma between the decoration elements. This is because the code
forgets to reset the color after printing the "prefix" in its own
color.

It theoretically is possible that some people were expecting and
relying on that the attribute set as the "diff.commit" color, which
is used to draw these opening parenthesis and inter-item comma, is
inherited by the drawing of branch names, but it is not how the
coloring works everywhere else.

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

Documentation/config.txt: simplify boolean description... Junio C Hamano Wed, 4 Mar 2015 19:08:34 +0000 (11:08 -0800)

Documentation/config.txt: simplify boolean description in the syntax section

The 'true' short-hand doesn't deserve a separate sentence; even our own

git config --bool foo.bar yes

would not produce it.

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

Documentation/config.txt: describe 'color' value type... Junio C Hamano Wed, 4 Mar 2015 07:07:13 +0000 (23:07 -0800)

Documentation/config.txt: describe 'color' value type in the "Values" section

Instead of describing it for color.branch.<slot> and have everybody
else refer to it, explain how colors are spelled in "Values" section
upfront.

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

Documentation/config.txt: have a separate "Values"... Junio C Hamano Wed, 4 Mar 2015 18:57:43 +0000 (10:57 -0800)

Documentation/config.txt: have a separate "Values" section

The various types of values set to the configuration variables
deserve more than a brief footnote mention in the syntax section,
and it will be more so after the later steps of this clean up
effort.

Move the mention of booleans from the syntax section to this new
section, and describe how human-readble integers can be spelled with
scaling there.

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

Documentation/config.txt: describe the structure first... Junio C Hamano Wed, 4 Mar 2015 18:33:38 +0000 (10:33 -0800)

Documentation/config.txt: describe the structure first and then meaning

A line can be continued via a backquote-LF and can be chomped at a
comment character. But that is not specific to string-typed values.
It is common to all, just like unquoted leading and trailing
whitespaces are stripped and inter-word spacing are retained.

Move the description around and desribe these structural rules
first, then introduce the double-quote facility as a way to override
them, and finally mention various types of values.

Note that these structural rules only apply to the value part of the
configuration file. E.g.

[aSection] \
name \
= value

does not work, because the rules kick in only after seeing "name =".
Both the original and the updated text are phrased in an awkward way
by singling out the "value" part of the line because of this.

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

Documentation/config.txt: explain multi-valued variable... Junio C Hamano Wed, 4 Mar 2015 18:26:17 +0000 (10:26 -0800)

Documentation/config.txt: explain multi-valued variables once

The syntax section repeats what the preamble explained already.
That a variable can have multiple values is more about what a
variable is than the syntax of the file.

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

Documentation/config.txt: avoid unnecessary negationJunio C Hamano Wed, 4 Mar 2015 04:03:50 +0000 (20:03 -0800)

Documentation/config.txt: avoid unnecessary negation

Section names and variable names are both case-insensitive, but one
is described as "not case sensitive". Use "case-insensitive" for
both.

Instead of saying "... have to be escaped" without telling what that
escaping achieves, state it in a more positive way, i.e. "... can be
included by escaping".

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

t5516: correct misspelled pushInsteadOfAnders Kaseorg Sun, 1 Mar 2015 04:18:14 +0000 (23:18 -0500)

t5516: correct misspelled pushInsteadOf

A future breakage to "git push" to make it incorrectly pay attention
to pushInsteadOf when it should not will be left uncaught without
this change.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: improve documentation of update subcommandMichal Sojka Mon, 2 Mar 2015 22:57:58 +0000 (23:57 +0100)

submodule: improve documentation of update subcommand

The documentation of 'git submodule update' has several problems:

1) It mentions that value 'none' of submodule.$name.update can be
overridden by --checkout, but other combinations of configuration
values and command line options are not mentioned.

2) The documentation of submodule.$name.update is scattered across three
places, which is confusing.

3) The documentation of submodule.$name.update in gitmodules.txt is
incorrect, because the code always uses the value from .git/config
and never from .gitmodules.

4) Documentation of --force was incomplete, because it is only effective
in case of checkout method of update.

Fix all these problems by documenting submodule.*.update in
git-submodule.txt and make everybody else refer to it.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote.txt: describe behavior without --tags and... Michael J Gruber Mon, 2 Mar 2015 13:08:09 +0000 (14:08 +0100)

git-remote.txt: describe behavior without --tags and --no-tags

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

kwset: use unsigned char to store values with high... Ben Walton Mon, 2 Mar 2015 19:22:31 +0000 (19:22 +0000)

kwset: use unsigned char to store values with high-bit set

Sun Studio on Solaris issues warnings about improper initialization
values being used when defining tolower_trans_tbl[] in ctype.c. The
array wants to store values with high-bit set and treat them as
values between 128 to 255. Unlike the rest of the Git codebase
where we explicitly specify 'unsigned char' for such variables and
arrays, however, kwset code we borrowed from elsewhere uses 'char'
for this and other variables.

Fix the declarations to explicitly use 'unsigned char' where
necessary to bring it in line with the rest of the Git.

Signed-off-by: Ben Walton <bdwalton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff --shortstat --dirstat: remove duplicate outputMårten Kongstad Mon, 2 Mar 2015 15:05:39 +0000 (16:05 +0100)

diff --shortstat --dirstat: remove duplicate output

When --shortstat is used in conjunction with --dirstat=changes, git diff will
output the dirstat information twice: first as calculated by the 'lines'
algorithm, then as calculated by the 'changes' algorithm:

$ git diff --dirstat=changes,10 --shortstat v2.2.0..v2.2.1
23 files changed, 453 insertions(+), 54 deletions(-)
33.5% Documentation/RelNotes/
26.2% t/
46.6% Documentation/RelNotes/
16.6% t/

The same duplication happens for --shortstat together with --dirstat=files, but
not for --shortstat together with --dirstat=lines.

Limit output to only include one dirstat part, calculated as specified
by the --dirstat parameter. Also, add test for this.

Signed-off-by: Mårten Kongstad <marten.kongstad@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diffcore-rename: avoid processing duplicate destinationsJeff King Fri, 27 Feb 2015 01:42:27 +0000 (20:42 -0500)

diffcore-rename: avoid processing duplicate destinations

The rename code cannot handle an input where we have
duplicate destinations (i.e., more than one diff_filepair in
the queue with the same string in its pair->two->path). We
end up allocating only one slot in the rename_dst mapping.
If we fill in the diff_filepair for that slot, when we
re-queue the results, we may queue that filepair multiple
times. When the diff is finally flushed, the filepair is
processed and free()d multiple times, leading to heap
corruption.

This situation should only happen when a tree diff sees
duplicates in one of the trees (see the added test for a
detailed example). Rather than handle it, the sanest thing
is just to turn off rename detection altogether for the
diff.

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

diffcore-rename: split locate_rename_dst into two functionsJeff King Fri, 27 Feb 2015 01:39:48 +0000 (20:39 -0500)

diffcore-rename: split locate_rename_dst into two functions

This function manages the mapping of destination pathnames
to filepairs, and it handles both insertion and lookup. This
makes the return value a bit confusing, as we return a newly
created entry (even though no caller cares), and have no
room to indicate to the caller that an entry already
existed.

Instead, let's break this up into two distinct functions,
both backed by a common binary search. The binary search
will use our normal "return the index if we found something,
or negative index minus one to show where it would have
gone" semantics.

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

grep: correct help string for --exclude-standardNguyễn Thái Ngọc Duy Fri, 27 Feb 2015 14:01:58 +0000 (21:01 +0700)

grep: correct help string for --exclude-standard

The current help string is about --no-exclude-standard. But "git grep -h"
would show --exclude-standard instead. Flip the string. See 0a93fb8
(grep: teach --untracked and --exclude-standard options - 2011-09-27)
for more info about these options.

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

Git::SVN::*: avoid premature FileHandle closureKyle J. McKay Thu, 26 Feb 2015 13:49:34 +0000 (05:49 -0800)

Git::SVN::*: avoid premature FileHandle closure

Since b19138b (git-svn: Make it incrementally faster by minimizing temp
files, v1.6.0), git-svn has been using the Git.pm temp_acquire and
temp_release mechanism to avoid unnecessary temp file churn and provide
a speed boost.

However, that change introduced a call to temp_acquire inside the
Git::SVN::Fetcher::close_file function for an 'svn_hash' temp file.
Because an SVN::Pool is active at the time this function is called, if
the Git::temp_acquire function ends up actually creating a new
FileHandle for the temp file (which it will the first time it's called
with the name 'svn_hash') that FileHandle will end up in the SVN::Pool
and should that pool have SVN::Pool::clear called on it that FileHandle
will be closed out from under Git::temp_acquire.

Since the only call site to Git::temp_acquire with the name 'svn_hash'
is inside the close_file function, if an 'svn_hash' temp file is ever
created its FileHandle is guaranteed to be created in the active
SVN::Pool.

This has not been a problem in the past because the SVN::Pool was not
being cleared. However, since dfa72fdb (git-svn: reload RA every
log-window-size, v2.2.0) the pool has been getting cleared periodically
at which point the FileHandle for the 'svn_hash' temp file gets closed.
Any subsequent calls to Git::temp_acquire for 'svn_hash', however,
succeed without creating/opening a new temporary file since it still has
the now invalid FileHandle in its cache. Callers that then attempt to
use that FileHandle fail with an error.

We avoid this problem by making sure the 'svn_hash' temp file is created
in the same place the 'svn_delta_...' and 'git_blob_...' temp files are
(and then temp_release'd) so that it can be safely used inside the
close_file function without having its FileHandle end up in an SVN::Pool
that gets cleared.

Additionally the Git.pm cat_blob function creates a bidirectional pipe
FileHandle using the IPC::Open2::open2 function. If that handle is
created too late, it also gets caught up in the SVN::Pool and incorrectly
closed by the SVN::Pool::clear call. But this only seems to happen with
more recent versions of Perl and svn.

To avoid this problem we add an explicit call to _open_cat_blob_if_needed
before the first call to SVN::Pool->new_default to make sure the open2
handle does not end up in the SVN::Pool.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: fix localtime=true on non-glibc environmentsRyuichi Kokubo Wed, 25 Feb 2015 16:04:41 +0000 (01:04 +0900)

git-svn: fix localtime=true on non-glibc environments

git svn uses POSIX::strftime('%s', $sec, $min, ...) to make unix epoch time.
But lowercase %s formatting character is a GNU extention. This causes problem
in git svn fetch --localtime on non-glibc systems, such as msys or cygwin.
Using Time::Local::timelocal($sec, $min, ...) fixes it.

Signed-off-by: Ryuichi Kokubo <ryu1kkb@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Notes:
lowercase %s format character in strftime is a GNU extension and not widely supported.
POSIX::strftime affected by underlying crt's strftime because POSIX::strftime just calls crt's one.
Time::Local is good function to replace POSIX::strftime because it's a perl core module function.

Document about Time::Local.
http://perldoc.perl.org/Time/Local.html

These are specifications of strftime.

The GNU C Library Reference Manual.
http://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html

perl POSIX module's strftime document. It does not have '%s'.
http://perldoc.perl.org/POSIX.html

strftime document of Microsort Windows C Run-Time library.
https://msdn.microsoft.com/en-us/library/fe06s4ak.aspx

The Open Group's old specification does not have '%s' too.
http://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html

On my environment, following problems happened.
- msys : git svn fetch does not progress at all with perl.exe consuming CPU.
- cygwin : git svn fetch progresses but time stamp information is dropped.
Every commits have unix epoch timestamp.

I would like to thank git developer and contibutors.
git helps me so much everyday.
Thank you.

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

Documentation/git-clean.txt: document that -f may need... Mikko Rapeli Thu, 26 Feb 2015 13:16:49 +0000 (15:16 +0200)

Documentation/git-clean.txt: document that -f may need to be given twice

This is needed in build automation where the tree really needs to
be reset to known state.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>