gitweb.git
Merge branch 'jk/prune-with-corrupt-refs'Junio C Hamano Wed, 25 Mar 2015 19:54:26 +0000 (12:54 -0700)

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

"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

Merge branch 'tg/fix-check-order-with-split-index'Junio C Hamano Wed, 25 Mar 2015 19:54:26 +0000 (12:54 -0700)

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

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/fetch-pack'Junio C Hamano Wed, 25 Mar 2015 19:54:25 +0000 (12:54 -0700)

Merge branch 'jk/fetch-pack'

"git fetch" that fetches a commit using the allow-tip-sha1-in-want
extension could have failed to fetch all the requested refs.

* jk/fetch-pack:
fetch-pack: remove dead assignment to ref->new_sha1
fetch_refs_via_pack: free extra copy of refs
filter_ref: make a copy of extra "sought" entries
filter_ref: avoid overwriting ref->old_sha1 with garbage

Merge branch 'jk/cleanup-failed-clone'Junio C Hamano Wed, 25 Mar 2015 19:54:24 +0000 (12:54 -0700)

Merge branch 'jk/cleanup-failed-clone'

An failure early in the "git clone" that started creating the
working tree and repository could have resulted in some directories
and files left without getting cleaned up.

* jk/cleanup-failed-clone:
clone: drop period from end of die_errno message
clone: initialize atexit cleanup handler earlier

Merge branch 'jc/submitting-patches-mention-send-email'Junio C Hamano Wed, 25 Mar 2015 19:54:23 +0000 (12:54 -0700)

Merge branch 'jc/submitting-patches-mention-send-email'

Recommend format-patch and send-email for those who want to submit
patches to this project.

* jc/submitting-patches-mention-send-email:
SubmittingPatches: encourage users to use format-patch and send-email

Merge branch 'dj/log-graph-with-no-walk'Junio C Hamano Wed, 25 Mar 2015 19:54:22 +0000 (12:54 -0700)

Merge branch 'dj/log-graph-with-no-walk'

"git log --graph --no-walk A B..." is a otcnflicting request that
asks nonsense; no-walk tells us show discrete points in the
history, while graph asks to draw connections between these
discrete points. Forbid the combination.

* dj/log-graph-with-no-walk:
revision: forbid combining --graph and --no-walk

Merge branch 'kd/rev-list-bisect-first-parent'Junio C Hamano Wed, 25 Mar 2015 19:54:21 +0000 (12:54 -0700)

Merge branch 'kd/rev-list-bisect-first-parent'

"git rev-list --bisect --first-parent" does not work (yet) and can
even cause SEGV; forbid it. "git log --bisect --first-parent"
would not be useful until "git bisect --first-parent" materializes,
so it is also forbidden for now.

* kd/rev-list-bisect-first-parent:
rev-list: refuse --first-parent combined with --bisect

Merge branch 'ws/grep-quiet-no-pager'Junio C Hamano Wed, 25 Mar 2015 19:54:20 +0000 (12:54 -0700)

Merge branch 'ws/grep-quiet-no-pager'

Even though "git grep --quiet" is run merely to ask for the exit
status, we spawned the pager regardless. Stop doing that.

* ws/grep-quiet-no-pager:
grep: fix "--quiet" overwriting current output

Merge branch 'jk/simplify-csum-file-sha1fd-check'Junio C Hamano Wed, 25 Mar 2015 19:54:19 +0000 (12:54 -0700)

Merge branch 'jk/simplify-csum-file-sha1fd-check'

Code simplification.

* jk/simplify-csum-file-sha1fd-check:
sha1fd_check: die when we cannot open the file

Merge branch 'ct/prompt-untracked-fix'Junio C Hamano Wed, 25 Mar 2015 19:54:18 +0000 (12:54 -0700)

Merge branch 'ct/prompt-untracked-fix'

The prompt script (in contrib/) did not show the untracked sign
when working in a subdirectory without any untracked files.

* ct/prompt-untracked-fix:
git prompt: use toplevel to find untracked files

Merge branch 'master' of git://ozlabs.org/~paulus/gitkJunio C Hamano Tue, 24 Mar 2015 23:10:37 +0000 (16:10 -0700)

Merge branch 'master' of git://ozlabs.org/~paulus/gitk

* 'master' of git://ozlabs.org/~paulus/gitk:
gitk: Update .po files
gitk: l10n: Add Catalan translation
gitk: Fix typo in Russian translation
gitk: Remove tcl-format flag from a message that shouldn't have it
gitk: Pass --invert-grep option down to "git log"
gitk: Synchronize config file writes
gitk: Report errors in saving config file
gitk: Only write changed configuration variables
gitk: Enable mouse horizontal scrolling in diff pane
gitk: Default wrcomcmd to use --pretty=email

Sync with v2.3.4Junio C Hamano Mon, 23 Mar 2015 18:37:49 +0000 (11:37 -0700)

Sync with v2.3.4

Post 2.3 cycle (batch #12)Junio C Hamano Mon, 23 Mar 2015 18:36:01 +0000 (11:36 -0700)

Post 2.3 cycle (batch #12)

Hopefully with another batch or two, we would be ready for -rc0
to close this cycle.

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

Merge branch 'js/completion-ctags-pattern-substitution... Junio C Hamano Mon, 23 Mar 2015 18:28:16 +0000 (11:28 -0700)

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

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

Merge branch 'jk/push-config'Junio C Hamano Mon, 23 Mar 2015 18:28:13 +0000 (11:28 -0700)

Merge branch 'jk/push-config'

Restructure "git push" codepath to make it easier to add new
configuration bits and then add push.followTags configuration that
turns --follow-tags option on by default.

* jk/push-config:
push: allow --follow-tags to be set by config push.followTags
cmd_push: pass "flags" pointer to config callback
cmd_push: set "atomic" bit directly
git_push_config: drop cargo-culted wt_status pointer

Merge branch 'nd/config-doc-camelCase'Junio C Hamano Mon, 23 Mar 2015 18:28:12 +0000 (11:28 -0700)

Merge branch 'nd/config-doc-camelCase'

Documentation updates.

* nd/config-doc-camelCase:
*config.txt: stick to camelCase naming convention

Merge branch 'jk/test-annoyances'Junio C Hamano Mon, 23 Mar 2015 18:28:10 +0000 (11:28 -0700)

Merge branch 'jk/test-annoyances'

Test fixes.

* jk/test-annoyances:
t5551: make EXPENSIVE test cheaper
t5541: move run_with_cmdline_limit to test-lib.sh
t: pass GIT_TRACE through Apache
t: redirect stderr GIT_TRACE to descriptor 4
t: translate SIGINT to an exit

Merge branch 'jk/smart-http-hide-refs'Junio C Hamano Mon, 23 Mar 2015 18:28:08 +0000 (11:28 -0700)

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

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 'jk/tag-h-column-is-a-listing-option'Junio C Hamano Mon, 23 Mar 2015 18:28:02 +0000 (11:28 -0700)

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

"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

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>

Post 2.3 cycle (batch #11)Junio C Hamano Fri, 20 Mar 2015 20:31:53 +0000 (13:31 -0700)

Post 2.3 cycle (batch #11)

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

Merge branch 'mg/log-decorate-HEAD'Junio C Hamano Fri, 20 Mar 2015 20:51:24 +0000 (13:51 -0700)

Merge branch 'mg/log-decorate-HEAD'

Output from "git log --decorate" mentions HEAD when it points at a
tip of an branch differently from a detached HEAD.

This is a potentially backward-incompatible change.

* mg/log-decorate-HEAD:
log: decorate HEAD with branch name

Merge branch 'jc/decorate-leaky-separator-color'Junio C Hamano Fri, 20 Mar 2015 20:50:51 +0000 (13:50 -0700)

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

"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 'sb/leaks'Junio C Hamano Fri, 20 Mar 2015 20:11:53 +0000 (13:11 -0700)

Merge branch 'sb/leaks'

Code cleanup.

* sb/leaks:
builtin/help.c: fix memory leak
bundle.c: fix memory leak
connect.c: do not leak "conn" after showing diagnosis

Merge branch 'rs/use-isxdigit'Junio C Hamano Fri, 20 Mar 2015 20:11:52 +0000 (13:11 -0700)

Merge branch 'rs/use-isxdigit'

Code cleanup.

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

Merge branch 'mg/verify-commit'Junio C Hamano Fri, 20 Mar 2015 20:11:51 +0000 (13:11 -0700)

Merge branch 'mg/verify-commit'

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 'km/imap-send-libcurl-options'Junio C Hamano Fri, 20 Mar 2015 20:11:50 +0000 (13:11 -0700)

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

"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 'km/bsd-sysctl'Junio C Hamano Fri, 20 Mar 2015 20:11:49 +0000 (13:11 -0700)

Merge branch 'km/bsd-sysctl'

We now detect number of CPUs on older BSD-derived systems.

* km/bsd-sysctl:
thread-utils.c: detect CPU count on older BSD-like systems
configure: support HAVE_BSD_SYSCTL option

Merge branch 'km/bsd-shells'Junio C Hamano Fri, 20 Mar 2015 20:11:48 +0000 (13:11 -0700)

Merge branch 'km/bsd-shells'

Portability fixes and workarounds for shell scripts have been added
to help BSD-derived systems.

* km/bsd-shells:
t5528: do not fail with FreeBSD shell
help.c: use SHELL_PATH instead of hard-coded "/bin/sh"
git-compat-util.h: move SHELL_PATH default into header
git-instaweb: use @SHELL_PATH@ instead of /bin/sh
git-instaweb: allow running in a working tree subdirectory

Merge branch 'rs/daemon-hostname-in-strbuf'Junio C Hamano Fri, 20 Mar 2015 20:11:47 +0000 (13:11 -0700)

Merge branch 'rs/daemon-hostname-in-strbuf'

Code in "git daemon" to parse out and hold hostnames used in
request interpolation has been simplified.

* rs/daemon-hostname-in-strbuf:
daemon: deglobalize hostname information
daemon: use strbuf for hostname info

Merge branch 'mg/detached-head-report'Junio C Hamano Fri, 20 Mar 2015 20:11:46 +0000 (13:11 -0700)

Merge branch 'mg/detached-head-report'

"git branch" on a detached HEAD always said "(detached from xyz)",
even when "git status" would report "detached at xyz". The HEAD is
actually at xyz and haven't been moved since it was detached in
such a case, but the user cannot read what the current value of
HEAD is when "detached from" is used.

* mg/detached-head-report:
branch: name detached HEAD analogous to status
wt-status: refactor detached HEAD analysis

Merge branch 'kn/git-cd-to-empty'Junio C Hamano Fri, 20 Mar 2015 20:11:46 +0000 (13:11 -0700)

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

"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 'nd/versioncmp-prereleases'Junio C Hamano Fri, 20 Mar 2015 20:11:45 +0000 (13:11 -0700)

Merge branch 'nd/versioncmp-prereleases'

The versionsort.prerelease configuration variable can be used to
specify that v1.0-pre1 comes before v1.0.

* nd/versioncmp-prereleases:
config.txt: update versioncmp.prereleaseSuffix
versionsort: support reorder prerelease suffixes

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>

rev-list: refuse --first-parent combined with --bisectKevin Daudt Thu, 19 Mar 2015 22:14:08 +0000 (23:14 +0100)

rev-list: refuse --first-parent combined with --bisect

rev-list --bisect is used by git bisect, but never together with
--first-parent. Because rev-list --bisect together with --first-parent
is not handled currently, and even leads to segfaults, refuse to use
both options together.

Because this is not supported, it makes little sense to use git log
--bisect --first parent either, because refs/heads/bad is not limited to
the first parent chain.

Helped-by: Junio C. Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Kevin Daudt <me@ikke.info>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch-pack: remove dead assignment to ref->new_sha1Jeff King Thu, 19 Mar 2015 20:39:36 +0000 (16:39 -0400)

fetch-pack: remove dead assignment to ref->new_sha1

In everything_local(), we used to assign the current ref's value
found in ref->old_sha1 to ref->new_sha1 when we already have all the
necessary objects to complete the history leading to that
commit. This copying was broken at 49bb805e (Do not ask for
objects known to be complete., 2005-10-19) and ever since we
instead stuffed a random bytes in ref->new_sha1 here. No
code complained or failed due to this breakage.

It turns out that no code path that comes after this
assignment even looks at ref->new_sha1 at all.

- The only caller of everything_local(), do_fetch_pack(),
returns this list of refs, whose element has bogus
new_sha1 values, to its caller. It does not look at the
elements itself, but does pass them to find_common, which
looks only at the name and old_sha1 fields.

- The only caller of do_fetch_pack(), fetch_pack(), returns this
list to its caller. It does not look at the elements nor act on
them.

- One of the two callers of fetch_pack() is cmd_fetch_pack(), the
top-level that implements "git fetch-pack". The only thing it
looks at in the elements of the returned ref list is the old_sha1
and name fields.

- The other caller of fetch_pack() is fetch_refs_via_pack() in the
transport layer, which is a helper that implements "git fetch".
It only cares about whether the returned list is empty (i.e.
failed to fetch anything).

Just drop the bogus assignment, that is not even necessary. The
remote-tracking refs are updated based on a different list and not
using the ref list being manipulated by this code path; the caller
do_fetch_pack() created a copy of that real ref list and passed the
copy down to this function, and modifying the elements here does not
affect anything.

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

fetch_refs_via_pack: free extra copy of refsJeff King Thu, 19 Mar 2015 20:38:35 +0000 (16:38 -0400)

fetch_refs_via_pack: free extra copy of refs

When fetch_refs_via_pack calls fetch_pack(), we pass a
list of refs to fetch, and the function returns either a
copy of that list, with the fetched items filled in, or
NULL. We check the return value to see whether the fetch was
successful, but do not otherwise look at the copy, and
simply leak it at the end of the function.

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

filter_ref: make a copy of extra "sought" entriesJeff King Thu, 19 Mar 2015 20:37:09 +0000 (16:37 -0400)

filter_ref: make a copy of extra "sought" entries

If the server supports allow_tip_sha1_in_want, we add any
unmatched raw-sha1 entries in our "sought" list of refs to
the list of refs we will ask the other side for. We do so by
inserting the original "struct ref" directly into our list,
rather than making a copy. This has several problems.

The most minor problem is that one cannot ever free the
resulting list; it contains structs that are copies of the
remote refs (made earlier by fetch_pack) along with sought
refs that are referenced elsewhere.

But more importantly that we set the ref->next pointer to
NULL, chopping off the remainder of any existing list that
the ref was a part of. We get the set of "sought" refs in
an array rather than a linked list, but that array is often
in turn generated from a list. The test modification in
t5516 demonstrates this. Rather than fetching just an exact
sha1, we fetch that sha1 plus another ref:

- we build a linked list of refs to fetch when do_fetch
calls get_ref_map; the exact sha1 is first, followed by
the named ref ("refs/heads/extra" in this case).

- we pass that linked list to transport_fetch_ref, which
squashes it into an array of pointers

- that array goes to fetch_pack, which calls filter_ref.
There we generate the want list from a mix of what the
remote side has advertised, and the "sought" entry for
the exact sha1. We set the sought entry's "next" pointer
to NULL.

- after we return from transport_fetch_refs, we then try
to update the refs by following the linked list. But our
list is now truncated, and we do not update
refs/heads/extra at all.

We can fix this by making a copy of the ref. There's nothing
that fetch_pack does to it that must be reflected in the
original "sought" list (and indeed, if that were the case we
would have a serious bug, because it is only exact-sha1
entries which are treated this way).

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

filter_ref: avoid overwriting ref->old_sha1 with garbageJeff King Thu, 19 Mar 2015 20:34:51 +0000 (16:34 -0400)

filter_ref: avoid overwriting ref->old_sha1 with garbage

If the server supports allow_tip_sha1_in_want, then
fetch-pack's filter_refs function tries to check whether a
ref is a request for a straight sha1 by running:

if (get_sha1_hex(ref->name, ref->old_sha1))
...

I.e., we are using get_sha1_hex to ask "is this ref name a
sha1?". If it is true, then the contents of ref->old_sha1
will end up unchanged. But if it is false, then get_sha1_hex
makes no guarantees about what it has written. With a ref
name like "abcdefoo", we would overwrite 3 bytes of
ref->old_sha1 before realizing that it was not a sha1.

This is likely not a problem in practice, as anything in
refs->name (besides a sha1) will start with "refs/", meaning
that we would notice on the first character that there is a
problem. Still, we are making assumptions about the state
left in the output when get_sha1_hex returns an error (e.g.,
it could start from the end of the string, or error check
the values only once they were placed in the output). It's
better to be defensive.

We could just check that we have exactly 40 characters of
sha1. But let's be even more careful and make sure that we
have a 40-char hex refname that matches what is in old_sha1.
This is perhaps overly defensive, but spells out our
assumptions clearly.

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

clone: drop period from end of die_errno messageJeff King Wed, 18 Mar 2015 19:02:01 +0000 (15:02 -0400)

clone: drop period from end of die_errno message

We do not usually end our errors with a full stop, but it
looks especially bad when you use die_errno, which adds a
colon, like:

fatal: could not create work tree dir 'foo'.: No such file or directory

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

clone: initialize atexit cleanup handler earlierJeff King Wed, 18 Mar 2015 18:55:32 +0000 (14:55 -0400)

clone: initialize atexit cleanup handler earlier

If clone fails, we generally try to clean up any directories
we've created. We do this by installing an atexit handler,
so that we don't have to manually trigger cleanup. However,
since we install this after touching the filesystem, any
errors between our initial mkdir() and our atexit() call
will result in us leaving a crufty directory around.

We can fix this by moving our atexit() call earlier. It's OK
to do it before the junk_work_tree variable is set, because
remove_junk makes sure the variable is initialized. This
means we "activate" the handler by assigning to the
junk_work_tree variable, which we now bump down to just
after we call mkdir(). We probably do not want to do it
before, because a plausible reason for mkdir() to fail is
EEXIST (i.e., we are racing with another "git init"), and we
would not want to remove their work.

OTOH, this is probably not that big a deal; we will allow
cloning into an empty directory (and skip the mkdir), which
is already racy (i.e., one clone may see the other's empty
dir and start writing into it). Still, it does not hurt to
err on the side of caution here.

Note that writing into junk_work_tree and junk_git_dir after
installing the handler is also technically racy, as we call
our handler on an async signal. Depending on the platform,
we could see a sheared write to the variables. Traditionally
we have not worried about this, and indeed we already do
this later in the function. If we want to address that, it
can come as a separate topic.

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

sha1fd_check: die when we cannot open the fileJeff King Wed, 18 Mar 2015 06:30:12 +0000 (02:30 -0400)

sha1fd_check: die when we cannot open the file

Right now we return a NULL "struct sha1file" if we encounter
an error. However, the sole caller (write_idx_file) does not
check the return value, and will segfault if we hit this
case.

One option would be to handle the error in the caller.
However, there's really nothing for it to do but die. This
code path is hit during "git index-pack --verify"; after we
verify the packfile, we check that the ".idx" we would
generate from it is byte-wise identical to what is on disk.
We hit the error (and segfault) if we can't open the .idx
file (a likely cause of this is that somebody else ran "git
repack -ad" while we were verifying). Since we can't
complete the requested verification, we really have no
choice but to die.

Furthermore, the rest of the sha1fd_* functions simply die
on errors. So if were to open the file successfully, for
example, and then hit a read error, sha1write would call
die() for us. So pushing the die() down into sha1fd_check
keeps the interface consistent.

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

grep: fix "--quiet" overwriting current outputWilhelm Schuermann Wed, 18 Mar 2015 18:00:13 +0000 (19:00 +0100)

grep: fix "--quiet" overwriting current output

When grep is called with the --quiet option, the pager is initialized
despite not being used. When the pager is "less", anything output by
previous commands and not ended with a newline is overwritten:

$ echo -n aaa; echo bbb
aaabbb
$ echo -n aaa; git grep -q foo; echo bbb
bbb

This can be worked around, for example, by making sure STDOUT is not a
TTY or more directly by setting git's pager to "cat":

$ echo -n aaa; git grep -q foo > /dev/null; echo bbb
aaabbb
$ echo -n aaa; PAGER=cat git grep -q foo; echo bbb
aaabbb

But prevent calling the pager in the first place, which would also
save an unnecessary fork().

Signed-off-by: Wilhelm Schuermann <wimschuermann@googlemail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

revision: forbid combining --graph and --no-walkDongcan Jiang Wed, 11 Mar 2015 02:13:02 +0000 (10:13 +0800)

revision: forbid combining --graph and --no-walk

Because "--graph" is about connected history while --no-walk is
about discrete points, it does not make sense to allow these two
options at the same time. [1]

This change makes a few calls to "show --graph" fail in t4052, but
asking to show one commit with graph is a nonsensical thing to do.
Thus, tests on "show --graph" in t4052 have been removed [2,3].
Same tests on "show" without --graph option have already been tested
in 4052.

3 testcases have been added to test this patch.

[1]: http://article.gmane.org/gmane.comp.version-control.git/216083
[2]: http://article.gmane.org/gmane.comp.version-control.git/264950
[3]: http://article.gmane.org/gmane.comp.version-control.git/265107

Helped-By: Eric Sunshine <sunshine@sunshineco.com>
Helped-By: René Scharfe <l.s.r@web.de>
Helped-By: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Dongcan Jiang <dongcan.jiang@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Post 2.3 cyce (batch #10)Junio C Hamano Tue, 17 Mar 2015 23:05:12 +0000 (16:05 -0700)

Post 2.3 cyce (batch #10)

Also declare that the next one will be called v2.4 ;-)

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

Merge branch 'mg/doc-status-color-slot'Junio C Hamano Tue, 17 Mar 2015 23:01:34 +0000 (16:01 -0700)

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

Documentation fixes.

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

Merge branch 'mg/status-v-v'Junio C Hamano Tue, 17 Mar 2015 23:01:33 +0000 (16:01 -0700)

Merge branch 'mg/status-v-v'

"git status" now allows the "-v" to be given twice to show the
differences that are left in the working tree not to be committed.

* mg/status-v-v:
commit/status: show the index-worktree diff with -v -v
t7508: test git status -v
t7508: .gitignore 'expect' and 'output' files

Merge branch 'mg/sequencer-commit-messages-always-verbatim'Junio C Hamano Tue, 17 Mar 2015 23:01:31 +0000 (16:01 -0700)

Merge branch 'mg/sequencer-commit-messages-always-verbatim'

"git cherry-pick" used to clean-up the log message even when it is
merely replaying an existing commit. It now replays the message
verbatim unless you are editing the message of resulting commits.

* mg/sequencer-commit-messages-always-verbatim:
sequencer: preserve commit messages

Merge branch 'sg/completion-remote'Junio C Hamano Tue, 17 Mar 2015 23:01:30 +0000 (16:01 -0700)

Merge branch 'sg/completion-remote'

Code simplification.

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

Merge branch 'es/rebase-i-count-todo'Junio C Hamano Tue, 17 Mar 2015 23:01:29 +0000 (16:01 -0700)

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

"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 'ak/git-done-help-cleanup'Junio C Hamano Tue, 17 Mar 2015 23:01:28 +0000 (16:01 -0700)

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

Code simplification.

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

Merge branch 'rs/zip-text'Junio C Hamano Tue, 17 Mar 2015 23:01:27 +0000 (16:01 -0700)

Merge branch 'rs/zip-text'

"git archive" can now be told to set the 'text' attribute in the
resulting zip archive.

* rs/zip-text:
archive-zip: mark text files in archives

Merge branch 'rs/deflate-init-cleanup'Junio C Hamano Tue, 17 Mar 2015 23:01:26 +0000 (16:01 -0700)

Merge branch 'rs/deflate-init-cleanup'

Code simplification.

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

SubmittingPatches: encourage users to use format-patch... Junio C Hamano Fri, 13 Mar 2015 07:02:15 +0000 (00:02 -0700)

SubmittingPatches: encourage users to use format-patch and send-email

In step "(4) Sending your patches", we instruct users to do an
inline patch, avoid breaking whitespaces, avoid attachments, use
[PATCH v2] for second round, etc., all of which format-patch and
send-email combo know how to do well.

The need was identified by, and the text is based on the work by
Cody Taylor.

Suggested-by: Cody Taylor <cody.taylor@maternityneighborhood.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git prompt: use toplevel to find untracked filesCody A Taylor Fri, 13 Mar 2015 02:24:50 +0000 (19:24 -0700)

git prompt: use toplevel to find untracked files

The __git_ps1() prompt function would not show an untracked state
when all the untracked files are outside the current working
directory.

Signed-off-by: Cody A Taylor <codemister99@yahoo.com>
Helped-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitk: Update .po filesPaul Mackerras Sun, 15 Mar 2015 06:25:02 +0000 (17:25 +1100)

gitk: Update .po files

Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: l10n: Add Catalan translationAlex Henrie Mon, 2 Feb 2015 05:53:32 +0000 (22:53 -0700)

gitk: l10n: Add Catalan translation

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Fix typo in Russian translation0xAX Fri, 14 Nov 2014 11:05:28 +0000 (17:05 +0600)

gitk: Fix typo in Russian translation

Signed-off-by: 0xAX <kuleshovmail@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Remove tcl-format flag from a message that should... Alex Henrie Thu, 22 Jan 2015 08:19:39 +0000 (01:19 -0700)

gitk: Remove tcl-format flag from a message that shouldn't have it

xgettext sees "% o" and interprets it as a placeholder for an octal
number preceded by a space. However, in this case it's not actually a
placeholder, and most translations will replace the "% o" sequence with
something else. Removing the tcl-format flag from this string prevents
tools like Poedit from freaking out when "% o" doesn't appear in the
translated string.

The corrected flag will appear in each translation's po file the next time
the translation is updated with `make update-po`.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Pass --invert-grep option down to "git log"Christoph Junghans Tue, 13 Jan 2015 01:33:32 +0000 (18:33 -0700)

gitk: Pass --invert-grep option down to "git log"

"git log --grep=<string>" shows only commits with messages that
match the given string, but sometimes it is useful to be able to
show only commits that do *not* have certain messages (e.g. "show
me ones that are not FIXUP commits").

Now the underlying "git log" learned the "--invert-grep" option.
The option syntactically behaves similar to "--all-match" that
requires that all of the grep strings to match and semantically
behaves the opposite---it requires that none of the grep strings to
match.

Teach "gitk" to allow users to pass it down to underlying "git log"
command by adding it to the known_view_options array.

Signed-off-by: Christoph Junghans <ottxor@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Synchronize config file writesMax Kirillov Wed, 4 Mar 2015 03:58:18 +0000 (05:58 +0200)

gitk: Synchronize config file writes

If several gitk instances are closed simultaneously, the savestuff
procedure can run at the same time, resulting in a conflict which may
cause losing of some of the instance's changes, failing the saving
operation or even corrupting the configuration file. This can happen,
for example, at user session closing, or at group closing of all
instances of an application which is possible in some desktop
environments.

To avoid this, make sure that only one saving operation is in
progress. It is guarded by existence of the $config_file_tmp
file. Creating the file and moving it to $config_file are both atomic
operations, so it should be reliable.

Reading does not need to be syncronized, because moving is an atomic
operation, and the $config_file always refers to a full and correct file.
But, if there is a stale $config_file_tmp file, report it at gitk start.
If such file is detected when saving, just report it abort the save, as
for other errors in saving.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Report errors in saving config fileMax Kirillov Wed, 4 Mar 2015 03:58:17 +0000 (05:58 +0200)

gitk: Report errors in saving config file

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Only write changed configuration variablesMax Kirillov Wed, 4 Mar 2015 03:58:16 +0000 (05:58 +0200)

gitk: Only write changed configuration variables

When gitk contains some changed parameter, and there is an existing
instance of gitk where the parameter is still old, it is reverted to
that old value when that instance exits.

Instead, store a parameter in config only if it has been modified in
the exiting instance. Otherwise, preserve the value which currently is in
file. This allows editing the configuration when several instances are
running, without rollback of the modification if some other
instance where the configuration was not edited is closed last.

For scalar variables, use trace(3tcl) to detect their change. Since
`trace` can send bogus events, doublecheck if the value has really
been changed, but once it is marked as changed, do not reset it back
to unchanged ever, because if user has restored the original value,
it's the decision which should be stored as well as modified value.

Treat view list especially: instead of rewriting the whole list, merge
individual views. Place old and updated views in their old places,
add new ones to the end of list. Collect modified views explicitly, in
newviewok{} and delview{}.

Do not merge geometry values. They are almost always changing because
user moves and resises windows, and there is no way to find which one of
the geometries is most desired. Just overwrite them unconditionally,
like earlier.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>

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>

push: allow --follow-tags to be set by config push... Dave Olszewski Mon, 16 Feb 2015 06:16:19 +0000 (01:16 -0500)

push: allow --follow-tags to be set by config push.followTags

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

Sync with 2.3.3Junio C Hamano Sat, 14 Mar 2015 06:11:50 +0000 (23:11 -0700)

Sync with 2.3.3

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

*config.txt: stick to camelCase naming conventionNguyễn Thái Ngọc Duy Wed, 11 Mar 2015 20:32:45 +0000 (16:32 -0400)

*config.txt: stick to camelCase naming convention

This should improve readability. Compare "thislongname" and
"thisLongName". The following keys are left in unchanged. We can
decide what to do with them later.

- am.keepcr
- core.autocrlf .safecrlf .trustctime
- diff.dirstat .noprefix
- gitcvs.usecrlfattr
- gui.blamehistoryctx .trustmtime
- pull.twohead
- receive.autogc
- sendemail.signedoffbycc .smtpsslcertpath .suppresscc

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

t5551: make EXPENSIVE test cheaperJeff King Fri, 13 Mar 2015 04:57:05 +0000 (00:57 -0400)

t5551: make EXPENSIVE test cheaper

We create 50,000 tags to check that we don't overflow the
command-line of fetch-pack. But by using run_with_cmdline_limit,
we can get the same effect with a much smaller number of
tags. This makes the test fast enough that we can drop the
EXPENSIVE prereq, which means people will actually run it.

It was not documented to do so, but this test was also the
only test of a clone-over-http that requires multiple POSTs
during the conversation. We can continue to test that by
dropping http.postbuffer to its minimum size, and checking
that we get two POSTs.

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

t5541: move run_with_cmdline_limit to test-lib.shJeff King Fri, 13 Mar 2015 04:53:07 +0000 (00:53 -0400)

t5541: move run_with_cmdline_limit to test-lib.sh

We use this to test http pushing with a restricted
commandline. Other scripts (like t5551, which does http
fetching) will want to use it, too.

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

t: pass GIT_TRACE through ApacheJeff King Fri, 13 Mar 2015 04:51:15 +0000 (00:51 -0400)

t: pass GIT_TRACE through Apache

Apache removes GIT_TRACE from the environment before running
git-http-backend. This can make it hard to debug the server
side of an http session. Let's let it through.

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

t: redirect stderr GIT_TRACE to descriptor 4Jeff King Fri, 13 Mar 2015 04:50:56 +0000 (00:50 -0400)

t: redirect stderr GIT_TRACE to descriptor 4

If you run a test script like:

GIT_TRACE=1 ./t0061-run-command.sh

you may get test failures, because some tests capture and
check the stderr output from git commands (and with
GIT_TRACE set to 1, the trace output will be included
there).

When we see GIT_TRACE set like this, we print a warning to
the user. However, we can do even better than that by just
pointing it to descriptor 4, which all tests leave connected
to the test script's stderr. That's likely what the user
intended (and any scripts that do want to see GIT_TRACE
output will set GIT_TRACE themselves).

Not only does this avoid false negatives in the tests, but
it means the user will actually see trace output for git
calls that redirect their stderr (whereas before, it was
sometimes confusingly buried in a file).

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