gitweb.git
Git 1.9-rc0 v1.9-rc0Junio C Hamano Fri, 17 Jan 2014 20:30:14 +0000 (12:30 -0800)

Git 1.9-rc0

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

Merge branch 'maint'Junio C Hamano Fri, 17 Jan 2014 20:21:39 +0000 (12:21 -0800)

Merge branch 'maint'

* maint:
git-svn: workaround for a bug in svn serf backend

Merge branch 'fp/submodule-checkout-mode'Junio C Hamano Fri, 17 Jan 2014 20:21:20 +0000 (12:21 -0800)

Merge branch 'fp/submodule-checkout-mode'

"submodule.*.update=checkout", when propagated from .gitmodules to
.git/config, turned into a "submodule.*.update=none", which did not
make much sense.

* fp/submodule-checkout-mode:
git-submodule.sh: 'checkout' is a valid update mode

Merge branch 'nd/shallow-clone'Junio C Hamano Fri, 17 Jan 2014 20:21:14 +0000 (12:21 -0800)

Merge branch 'nd/shallow-clone'

Fetching from a shallow-cloned repository used to be forbidden,
primarily because the codepaths involved were not carefully vetted
and we did not bother supporting such usage. This attempts to allow
object transfer out of a shallow-cloned repository in a controlled
way (i.e. the receiver become a shallow repository with truncated
history).

* nd/shallow-clone: (31 commits)
t5537: fix incorrect expectation in test case 10
shallow: remove unused code
send-pack.c: mark a file-local function static
git-clone.txt: remove shallow clone limitations
prune: clean .git/shallow after pruning objects
clone: use git protocol for cloning shallow repo locally
send-pack: support pushing from a shallow clone via http
receive-pack: support pushing to a shallow clone via http
smart-http: support shallow fetch/clone
remote-curl: pass ref SHA-1 to fetch-pack as well
send-pack: support pushing to a shallow clone
receive-pack: allow pushes that update .git/shallow
connected.c: add new variant that runs with --shallow-file
add GIT_SHALLOW_FILE to propagate --shallow-file to subprocesses
receive/send-pack: support pushing from a shallow clone
receive-pack: reorder some code in unpack()
fetch: add --update-shallow to accept refs that update .git/shallow
upload-pack: make sure deepening preserves shallow roots
fetch: support fetching from a shallow repository
clone: support remote shallow repository
...

mingw: remove mingw_writeErik Faye-Lund Fri, 17 Jan 2014 14:17:10 +0000 (15:17 +0100)

mingw: remove mingw_write

Since 0b6806b9 ("xread, xwrite: limit size of IO to 8MB"), this
wrapper is no longer needed, as read and write are already split
into small chunks.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

prefer xwrite instead of writeErik Faye-Lund Fri, 17 Jan 2014 14:17:09 +0000 (15:17 +0100)

prefer xwrite instead of write

Our xwrite wrapper already deals with a few potential hazards, and
are as such more robust. Prefer it instead of write to get the
robustness benefits everywhere.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-and-improved-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jk/pull-rebase-using-fork-point'Junio C Hamano Fri, 17 Jan 2014 20:04:29 +0000 (12:04 -0800)

Merge branch 'jk/pull-rebase-using-fork-point'

Finishing touches so that an expected error message will not leak to
the UI.

* jk/pull-rebase-using-fork-point:
pull: suppress error when no remoteref is found

pull: suppress error when no remoteref is foundJohn Keeping Fri, 17 Jan 2014 20:00:20 +0000 (20:00 +0000)

pull: suppress error when no remoteref is found

Commit 48059e4 (pull: use merge-base --fork-point when appropriate,
2013-12-08) incorrectly assumes that get_remote_merge_branch will either
yield a non-empty string or return an error, but there are circumstances
where it will yield an empty string.

The previous code then invoked git-rev-list with no arguments, which
results in an error suppressed by redirecting stderr to /dev/null. Now
we invoke git-merge-base with an empty branch name, which also results
in an error. Suppress this in the same way.

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

git-svn: workaround for a bug in svn serf backendRoman Kagan Fri, 27 Dec 2013 08:05:15 +0000 (12:05 +0400)

git-svn: workaround for a bug in svn serf backend

Subversion serf backend in versions 1.8.5 and below has a bug(*) that the
function creating the descriptor of a file change -- add_file() --
doesn't make a copy of its third argument when storing it on the
returned descriptor. As a result, by the time this field is used (in
transactions of file copying or renaming) it may well be released, and
the memory reused.

One of its possible manifestations is the svn assertion triggering on an
invalid path, with a message

svn_fspath__skip_ancestor: Assertion
`svn_fspath__is_canonical(child_fspath)' failed.

This patch works around this bug, by storing the value to be passed as
the third argument to add_file() in a local variable with the same scope
as the file change descriptor, making sure their lifetime is the same.

* [ew: fixed in Subversion r1553376 as noted by Jonathan Nieder]

Cc: Benjamin Pabst <benjamin.pabst85@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Roman Kagan <rkagan@mail.ru>

diff_filespec: use only 2 bits for is_binary flagJeff King Fri, 17 Jan 2014 01:25:40 +0000 (20:25 -0500)

diff_filespec: use only 2 bits for is_binary flag

The is_binary flag needs only three values: -1, 0, and 1.
However, we use a whole 32-bit int for it on most systems
(both 32- and 64- bit).

Instead, we can mark it to use only 2 bits. On 32-bit
systems, this lets it end up as part of the bitfield above
(saving 4 bytes). On 64-bit systems, we don't see any change
(because the savings end up as padding), but it does leave
room for another "free" 32-bit value to be added later.

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

diff_filespec: reorder is_binary fieldJeff King Fri, 17 Jan 2014 01:22:56 +0000 (20:22 -0500)

diff_filespec: reorder is_binary field

The middle of the diff_filespec struct contains a mixture of
ints, shorts, and bit-fields, followed by a pointer. On an
x86-64 system with an LP64 or LLP64 data model (i.e., most
of them), the integers and flags end up being padded out by
41 bits to put the pointer at an 8-byte boundary.

After the pointer, we have the "int is_binary" field, which
is only 32 bits. We end up wasting another 32 bits to pad
the struct size up to a multiple of 64 bits.

We can move the is_binary field before the pointer, which
lets the compiler store it where we used to have padding.
This shrinks the top padding to only 9 bits (from the
bit-fields), and eliminates the bottom padding entirely,
dropping the struct size from 88 to 80 bytes.

On a 32-bit system, there is no benefit, but nor should
there be any harm (we only need 4-byte alignment there, so
we were already using only 9 bits of padding).

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

diff_filespec: drop xfrm_flags fieldJeff King Fri, 17 Jan 2014 01:21:59 +0000 (20:21 -0500)

diff_filespec: drop xfrm_flags field

The only mention of this field in the code is by some
debugging code which prints it out (and it will always be
zero, since we never touch it otherwise). It was obsoleted
very early on by 25d5ea4 ([PATCH] Redo rename/copy detection
logic., 2005-05-24).

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

diff_filespec: drop funcname_pattern_ident fieldJeff King Fri, 17 Jan 2014 01:20:11 +0000 (20:20 -0500)

diff_filespec: drop funcname_pattern_ident field

This struct field was obsoleted by be58e70 (diff: unify
external diff and funcname parsing code, 2008-10-05), but we
forgot to remove it.

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

diff_filespec: reorder dirty_submodule macro definitionsJeff King Fri, 17 Jan 2014 01:19:46 +0000 (20:19 -0500)

diff_filespec: reorder dirty_submodule macro definitions

diff_filespec has a 2-bit "dirty_submodule" field and
defines two flags as macros. Originally these were right
next to each other, but a new field was accidentally added
in between in commit 4682d85. This patch puts the field and
its flags back together.

Using an enum like:

enum {
DIRTY_SUBMODULE_UNTRACKED = 1,
DIRTY_SUBMODULE_MODIFIED = 2
} dirty_submodule;

would be more obvious, but it bloats the structure. Limiting
the enum size like:

} dirty_submodule : 2;

might work, but it is not portable.

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

gitignore doc: add global gitignore to synopsisJonathan Nieder Thu, 16 Jan 2014 22:43:34 +0000 (14:43 -0800)

gitignore doc: add global gitignore to synopsis

The gitignore(5) manpage already documents $XDG_CONFIG_HOME/git/ignore
but it is easy to forget that it exists. Add a reminder to the
synopsis.

Noticed while looking for a place to put a list of scratch filenames
in the cwd used by one's editor of choice.

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

send-email: /etc/ssl/certs/ directory may not be usable... Ruben Kerkhof Wed, 15 Jan 2014 17:31:11 +0000 (21:31 +0400)

send-email: /etc/ssl/certs/ directory may not be usable as ca_path

When sending patches on Fedora rawhide with
git-1.8.5.2-1.fc21.x86_64 and perl-IO-Socket-SSL-1.962-1.fc21.noarch,
with the following

[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = ruben@rubenkerkhof.com
smtpserverport = 587

git-send-email fails with:

STARTTLS failed! SSL connect attempt failed with unknown error
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate
verify failed at /usr/libexec/git-core/git-send-email line 1236.

The current code detects the presence of /etc/ssl/certs directory
(it actually is a symlink to another directory, but that does not
matter) and uses SSL_ca_path to point at it when initializing the
connection with IO::Socket::SSL or Net::SMTP::SSL. However, on the
said platform, it seems that this directory is not designed to be
used as SSL_ca_path. Using a single file inside that directory
(cert.pem, which is a Mozilla CA bundle) with SSL_ca_file does work,
and also not specifying any SSL_ca_file/SSL_ca_path (and letting the
library use its own default) and asking for peer verification does
work.

By removing the code that blindly defaults $smtp_ssl_cert_path to
"/etc/ssl/certs", we can prevent the codepath that treats any
directory specified with that variable as usable for SSL_ca_path
from incorrectly triggering.

This change could introduce a regression for people on a platform
whose certificate directory is /etc/ssl/certs but its IO::Socket:SSL
somehow fails to use it as SSL_ca_path without being told. Using
/etc/ssl/certs directory as SSL_ca_path by default like the current
code does would have been hiding such a broken installation without
its user needing to do anything. These users can still work around
such a platform bug by setting the configuration variable explicitly
to point at /etc/ssl/certs.

This change should not negate what 35035bbf (send-email: be explicit
with SSL certificate verification, 2013-07-18), which was the
original change that introduced the defaulting to /etc/ssl/certs/,
attempted to do, which is to make sure we do not communicate over
insecure connection by default, triggering warning from the library.

Cf. https://bugzilla.redhat.com/show_bug.cgi?id=1043194

Tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

revision: propagate flag bits from tags to pointeesJunio C Hamano Wed, 15 Jan 2014 20:26:13 +0000 (12:26 -0800)

revision: propagate flag bits from tags to pointees

With the previous fix 895c5ba3 (revision: do not peel tags used in
range notation, 2013-09-19), handle_revision_arg() that processes
command line arguments for the "git log" family of commands no
longer directly places the object pointed by the tag in the pending
object array when it sees a tag object. We used to place pointee
there after copying the flag bits like UNINTERESTING and
SYMMETRIC_LEFT.

This change meant that any flag that is relevant to later history
traversal must now be propagated to the pointed objects (most often
these are commits) while starting the traversal, which is partly
done by handle_commit() that is called from prepare_revision_walk().
We did propagate UNINTERESTING, but did not do so for others, most
notably SYMMETRIC_LEFT. This caused "git log --left-right v1.0..."
(where "v1.0" is a tag) to start losing the "leftness" from the
commit the tag points at.

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

revision: mark contents of an uninteresting tree uninte... Junio C Hamano Wed, 15 Jan 2014 23:38:01 +0000 (15:38 -0800)

revision: mark contents of an uninteresting tree uninteresting

"git rev-list --objects ^A^{tree} B^{tree}" ought to mean "I want a
list of objects inside B's tree, but please exclude the objects that
appear inside A's tree".

we see the top-level tree marked as uninteresting (i.e. ^A^{tree} in
the above example) and call mark_tree_uninteresting() on it; this
unfortunately prevents us from recursing into the tree and marking
the objects in the tree as uninteresting.

The reason why "git log ^A A" yields an empty set of commits,
i.e. we do not have a similar issue for commits, is because we call
mark_parents_uninteresting() after seeing an uninteresting commit.
The uninteresting-ness of the commit itself does not prevent its
parents from being marked as uninteresting.

Introduce mark_tree_contents_uninteresting() and structure the code
in handle_commit() in such a way that it makes it the responsibility
of the callchain leading to this function to mark commits, trees and
blobs as uninteresting, and also make it the responsibility of the
helpers called from this function to mark objects that are reachable
from them.

Note that this is a very old bug that probably dates back to the day
when "rev-list --objects" was introduced. The line to clear
tree->object.parsed at the end of mark_tree_contents_uninteresting()
can be removed when this fix is merged to the codebase after
6e454b9a (clear parsed flag when we free tree buffers, 2013-06-05).

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

interpret_branch_name: find all possible @-marksJeff King Wed, 15 Jan 2014 08:40:46 +0000 (03:40 -0500)

interpret_branch_name: find all possible @-marks

When we parse a string like "foo@{upstream}", we look for
the first "@"-sign, and check to see if it is an upstream
mark. However, since branch names can contain an @, we may
also see "@foo@{upstream}". In this case, we check only the
first @, and ignore the second. As a result, we do not find
the upstream.

We can solve this by iterating through all @-marks in the
string, and seeing if any is a legitimate upstream or
empty-at mark.

Another strategy would be to parse from the right-hand side
of the string. However, that does not work for the
"empty_at" case, which allows "@@{upstream}". We need to
find the left-most one in this case (and we then recurse as
"HEAD@{upstream}").

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

interpret_branch_name: avoid @{upstream} past colonJeff King Wed, 15 Jan 2014 08:37:23 +0000 (03:37 -0500)

interpret_branch_name: avoid @{upstream} past colon

get_sha1() cannot currently parse a valid object name like
"HEAD:@{upstream}" (assuming that such an oddly named file
exists in the HEAD commit). It takes two passes to parse the
string:

1. It first considers the whole thing as a ref, which
results in looking for the upstream of "HEAD:".

2. It finds the colon, parses "HEAD" as a tree-ish, and then
finds the path "@{upstream}" in the tree.

For a path that looks like a normal reflog (e.g.,
"HEAD:@{yesterday}"), the first pass is a no-op. We try to
dwim_ref("HEAD:"), that returns zero refs, and we proceed
with colon-parsing.

For "HEAD:@{upstream}", though, the first pass ends up in
interpret_upstream_mark, which tries to find the branch
"HEAD:". When it sees that the branch does not exist, it
actually dies rather than returning an error to the caller.
As a result, we never make it to the second pass.

One obvious way of fixing this would be to teach
interpret_upstream_mark to simply report "no, this isn't an
upstream" in such a case. However, that would make the
error-reporting for legitimate upstream cases significantly
worse. Something like "bogus@{upstream}" would simply report
"unknown revision: bogus@{upstream}", while the current code
diagnoses a wide variety of possible misconfigurations (no
such branch, branch exists but does not have upstream, etc).

However, we can take advantage of the fact that a branch
name cannot contain a colon. Therefore even if we find an
upstream mark, any prefix with a colon must mean that
the upstream mark we found is actually a pathname, and
should be disregarded completely. This patch implements that
logic.

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

interpret_branch_name: always respect "namelen" parameterJeff King Wed, 15 Jan 2014 08:31:57 +0000 (03:31 -0500)

interpret_branch_name: always respect "namelen" parameter

interpret_branch_name gets passed a "name" buffer to parse,
along with a "namelen" parameter representing its length. If
"namelen" is zero, we fallback to the NUL-terminated
string-length of "name".

However, it does not necessarily follow that if we have
gotten a non-zero "namelen", it is the NUL-terminated
string-length of "name". E.g., when get_sha1() is parsing
"foo:bar", we will be asked to operate only on the first
three characters.

Yet in interpret_branch_name and its helpers, we use string
functions like strchr() to operate on "name", looking past
the length we were given. This can result in us mis-parsing
object names. We should instead be limiting our search to
"namelen" bytes.

There are three distinct types of object names this patch
addresses:

- The intrepret_empty_at helper uses strchr to find the
next @-expression after our potential empty-at. In an
expression like "@:foo@bar", it erroneously thinks that
the second "@" is relevant, even if we were asked only
to look at the first character. This case is easy to
trigger (and we test it in this patch).

- When finding the initial @-mark for @{upstream}, we use
strchr. This means we might treat "foo:@{upstream}" as
the upstream for "foo:", even though we were asked only
to look at "foo". We cannot test this one in practice,
because it is masked by another bug (which is fixed in
the next patch).

- The interpret_nth_prior_checkout helper did not receive
the name length at all. This turns out not to be a
problem in practice, though, because its parsing is so
limited: it always starts from the far-left of the
string, and will not tolerate a colon (which is
currently the only way to get a smaller-than-strlen
"namelen"). However, it's still worth fixing to make the
code more obviously correct, and to future-proof us
against callers with more exotic buffers.

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

interpret_branch_name: rename "cp" variable to "at"Jeff King Wed, 15 Jan 2014 08:27:32 +0000 (03:27 -0500)

interpret_branch_name: rename "cp" variable to "at"

In the original version of this function, "cp" acted as a
pointer to many different things. Since the refactoring in
the last patch, it only marks the at-sign in the string.
Let's use a more descriptive variable name.

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

interpret_branch_name: factor out upstream handlingJeff King Wed, 15 Jan 2014 08:26:33 +0000 (03:26 -0500)

interpret_branch_name: factor out upstream handling

This function checks a few different @{}-constructs. The
early part checks for and dispatches us to helpers for each
construct, but the code for handling @{upstream} is inline.

Let's factor this out into its own function. This makes
interpret_branch_name more readable, and will make it much
simpler to further refactor the function in future patches.

While we're at it, let's also break apart the refactored
code into a few helper functions. These will be useful if we
eventually implement similar @{upstream}-like constructs.

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

fetch-pack: do not filter out one-level refsJeff King Wed, 15 Jan 2014 10:46:13 +0000 (05:46 -0500)

fetch-pack: do not filter out one-level refs

Currently fetching a one-level ref like "refs/foo" does not
work consistently. The outer "git fetch" program filters the
list of refs, checking each against check_refname_format.
Then it feeds the result to do_fetch_pack to actually
negotiate the haves/wants and get the pack. The fetch-pack
code does its own filter, and it behaves differently.

The fetch-pack filter looks for refs in "refs/", and then
feeds everything _after_ the slash (i.e., just "foo") into
check_refname_format. But check_refname_format is not
designed to look at a partial refname. It complains that the
ref has only one component, thinking it is at the root
(i.e., alongside "HEAD"), when in reality we just fed it a
partial refname.

As a result, we omit a ref like "refs/foo" from the pack
request, even though "git fetch" then tries to store the
resulting ref. If we happen to get the object anyway (e.g.,
because the ref is contained in another ref we are
fetching), then the fetch succeeds. But if it is a unique
object, we fail when trying to update "refs/foo".

We can fix this by just passing the whole refname into
check_refname_format; we know the part we were omitting is
"refs/", which is acceptable in a refname. This at least
makes the checks consistent with each other.

This problem happens most commonly with "refs/stash", which
is the only one-level ref in wide use. However, our test
does not use "refs/stash", as we may later want to restrict
it specifically (not because it is one-level, but because
of the semantics of stashes).

We may also want to do away with the multiple levels of
filtering (which can cause problems when they are out of
sync), or even forbid one-level refs entirely. However,
those decisions can come later; this fixes the most
immediate problem, which is the mismatch between the two.

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

refname_match(): always use the rules in ref_rev_parse_... Michael Haggerty Tue, 14 Jan 2014 03:16:07 +0000 (04:16 +0100)

refname_match(): always use the rules in ref_rev_parse_rules

We used to use two separate rules for the normal ref resolution
dwimming and dwimming done to decide which remote ref to grab. The
third parameter to refname_match() selected which rules to use.

When these two rules were harmonized in

2011-11-04 dd621df9cd refs DWIMmery: use the same rule for both "git fetch" and others

, ref_fetch_rules was #defined to avoid potential breakages for
in-flight topics.

It is now safe to remove the backwards-compatibility code, so remove
refname_match()'s third parameter, make ref_rev_parse_rules private to
refs.c, and remove ref_fetch_rules entirely.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitattributes: document more clearly where macros are... Michael Haggerty Tue, 14 Jan 2014 02:58:49 +0000 (03:58 +0100)

gitattributes: document more clearly where macros are allowed

The old text made it sound like macros are only allowed in the
.gitattributes file at the top-level of the working tree. Make it
clear that they are also allowed in $GIT_DIR/info/attributes and in
the global and system-wide gitattributes files.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: "git pull" does not have the "-m" optionJunio C Hamano Tue, 14 Jan 2014 18:26:21 +0000 (10:26 -0800)

Documentation: "git pull" does not have the "-m" option

Even though "--[no-]edit" can be used with "git pull", the
explanation of the interaction between this option and the "-m"
option does not make sense within the context of "git pull". Use
the conditional inclusion mechanism to remove this part from "git
pull" documentation, while keeping it for "git merge".

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

Merge branch 'jc/maint-pull-docfix-for-409b8d82' into... Junio C Hamano Tue, 14 Jan 2014 18:47:09 +0000 (10:47 -0800)

Merge branch 'jc/maint-pull-docfix-for-409b8d82' into jc/maint-pull-docfix

* jc/maint-pull-docfix-for-409b8d82:
Documentation: exclude irrelevant options from "git pull"

Documentation: exclude irrelevant options from "git... Junio C Hamano Tue, 14 Jan 2014 18:26:21 +0000 (10:26 -0800)

Documentation: exclude irrelevant options from "git pull"

10eb64f5 (git pull manpage: don't include -n from fetch-options.txt,
2008-01-25) introduced a way to exclude some parts of included
source when building git-pull documentation, and later 409b8d82
(Documentation/git-pull: put verbosity options before merge/fetch
ones, 2010-02-24) attempted to use the mechanism to exclude some
parts of merge-options.txt when used from git-pull.txt.

However, the latter did not have an intended effect, because the
macro "git-pull" used to decide if the source is included in
git-pull documentation were defined a bit too late.

Define the macro before it is used to fix this.

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

subtree: fix argument validation in add/pull/pushAnthony Baire Wed, 27 Nov 2013 18:34:09 +0000 (19:34 +0100)

subtree: fix argument validation in add/pull/push

When working with a remote repository add/pull/push do not accept a
<refspec> as parameter but just a <ref>. They should accept any
well-formatted ref name.

This patch:
- relaxes the check the <ref> argument in "git subtree add <repo>"
(previous code would not accept a ref name that does not exist
locally too, new code only ensures that the ref is well formatted)

- add the same check in "git subtree pull/push" + check the number of
parameters

- update the doc to use <ref> instead of <refspec>

Signed-off-by: Anthony Baire <Anthony.Baire@irisa.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: handle --[no-]fork-point options to git... John Keeping Sat, 11 Jan 2014 14:27:13 +0000 (14:27 +0000)

completion: handle --[no-]fork-point options to git-rebase

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

completion: complete merge-base optionsJohn Keeping Sat, 11 Jan 2014 14:27:12 +0000 (14:27 +0000)

completion: complete merge-base options

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

Sync with 1.8.5.3Junio C Hamano Mon, 13 Jan 2014 19:39:38 +0000 (11:39 -0800)

Sync with 1.8.5.3

* maint:
Git 1.8.5.3
pack-heuristics.txt: mark up the file header properly

Update draft release notes to 1.9Junio C Hamano Mon, 13 Jan 2014 19:39:09 +0000 (11:39 -0800)

Update draft release notes to 1.9

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

Merge branch 'jk/t5531-prepare-to-default-to-non-matching'Junio C Hamano Mon, 13 Jan 2014 19:35:10 +0000 (11:35 -0800)

Merge branch 'jk/t5531-prepare-to-default-to-non-matching'

* jk/t5531-prepare-to-default-to-non-matching:
t5531: further "matching" fixups

Merge branch 'sb/diff-orderfile-config'Junio C Hamano Mon, 13 Jan 2014 19:34:11 +0000 (11:34 -0800)

Merge branch 'sb/diff-orderfile-config'

Finishing touches to avoid casting unnecessary detail in stone.

* sb/diff-orderfile-config:
diff test: reading a directory as a file need not error out

Merge branch 'mh/shorten-unambigous-ref'Junio C Hamano Mon, 13 Jan 2014 19:34:08 +0000 (11:34 -0800)

Merge branch 'mh/shorten-unambigous-ref'

* mh/shorten-unambigous-ref:
shorten_unambiguous_ref(): tighten up pointer arithmetic
gen_scanf_fmt(): delete function and use snprintf() instead
shorten_unambiguous_ref(): introduce a new local variable

Merge branch 'mm/mv-file-to-no-such-dir-with-slash'Junio C Hamano Mon, 13 Jan 2014 19:33:51 +0000 (11:33 -0800)

Merge branch 'mm/mv-file-to-no-such-dir-with-slash'

Finishing touches to do the same on windows.

* mm/mv-file-to-no-such-dir-with-slash:
mv: let 'git mv file no-such-dir/' error out on Windows, too

Merge branch 'jl/submodule-mv-checkout-caveat'Junio C Hamano Mon, 13 Jan 2014 19:33:47 +0000 (11:33 -0800)

Merge branch 'jl/submodule-mv-checkout-caveat'

With a submodule that was initialized in an old fashioned way
without gitlinks, switching branches in the superproject between
the one with and without the submodule may leave the submodule
working tree with its embedded repository behind, as there may be
unexpendable state there. Document and warn users about this.

* jl/submodule-mv-checkout-caveat:
rm: better document side effects when removing a submodule
mv: better document side effects when moving a submodule

Merge branch 'jk/pull-rebase-using-fork-point'Junio C Hamano Mon, 13 Jan 2014 19:33:39 +0000 (11:33 -0800)

Merge branch 'jk/pull-rebase-using-fork-point'

Finishing touches.

* jk/pull-rebase-using-fork-point:
rebase: fix fork-point with zero arguments

Merge branch 'rr/completion-format-coverletter'Junio C Hamano Mon, 13 Jan 2014 19:33:38 +0000 (11:33 -0800)

Merge branch 'rr/completion-format-coverletter'

The bash/zsh completion code did not know about format.coverLetter
among many format.* configuration variables.

* rr/completion-format-coverletter:
completion: complete format.coverLetter

Merge branch 'ow/stash-with-ifs'Junio C Hamano Mon, 13 Jan 2014 19:33:36 +0000 (11:33 -0800)

Merge branch 'ow/stash-with-ifs'

The implementation of 'git stash $cmd "stash@{...}"' did not quote
the stash argument properly and left it split at IFS whitespace.

* ow/stash-with-ifs:
stash: handle specifying stashes with $IFS

Merge branch 'jn/pager-lv-default-env'Junio C Hamano Mon, 13 Jan 2014 19:33:34 +0000 (11:33 -0800)

Merge branch 'jn/pager-lv-default-env'

Just like we give a reasonable default for "less" via the LESS
environment variable, specify a reasonable default for "lv" via the
"LV" environment variable when spawning the pager.

* jn/pager-lv-default-env:
pager: set LV=-c alongside LESS=FRSX

Merge branch 'br/sha1-name-40-hex-no-disambiguation'Junio C Hamano Mon, 13 Jan 2014 19:33:29 +0000 (11:33 -0800)

Merge branch 'br/sha1-name-40-hex-no-disambiguation'

When parsing a 40-hex string into the object name, the string is
checked to see if it can be interpreted as a ref so that a warning
can be given for ambiguity. The code kicked in even when the
core.warnambiguousrefs is set to false to squelch this warning, in
which case the cycles spent to look at the ref namespace were an
expensive no-op, as the result was discarded without being used.

* br/sha1-name-40-hex-no-disambiguation:
sha1_name: don't resolve refs when core.warnambiguousrefs is false

Git 1.8.5.3 v1.8.5.3Junio C Hamano Mon, 13 Jan 2014 19:28:26 +0000 (11:28 -0800)

Git 1.8.5.3

Merge branch 'nd/daemon-informative-errors-typofix... Junio C Hamano Mon, 13 Jan 2014 19:23:07 +0000 (11:23 -0800)

Merge branch 'nd/daemon-informative-errors-typofix' into maint

The "--[no-]informative-errors" options to "git daemon" were parsed
a bit too loosely, allowing any other string after these option
names.

* nd/daemon-informative-errors-typofix:
daemon: be strict at parsing parameters --[no-]informative-errors

Merge branch 'km/gc-eperm' into maintJunio C Hamano Mon, 13 Jan 2014 19:23:04 +0000 (11:23 -0800)

Merge branch 'km/gc-eperm' into maint

A "gc" process running as a different user should be able to stop a
new "gc" process from starting.

* km/gc-eperm:
gc: notice gc processes run by other users

Merge branch 'jk/credential-plug-leak' into maintJunio C Hamano Mon, 13 Jan 2014 19:23:01 +0000 (11:23 -0800)

Merge branch 'jk/credential-plug-leak' into maint

An earlier "clean-up" introduced an unnecessary memory leak.

* jk/credential-plug-leak:
Revert "prompt: clean up strbuf usage"

Merge branch 'mm/mv-file-to-no-such-dir-with-slash... Junio C Hamano Mon, 13 Jan 2014 19:22:48 +0000 (11:22 -0800)

Merge branch 'mm/mv-file-to-no-such-dir-with-slash' into maint

"git mv A B/", when B does not exist as a directory, should error
out, but it didn't.

* mm/mv-file-to-no-such-dir-with-slash:
mv: let 'git mv file no-such-dir/' error out on Windows, too
mv: let 'git mv file no-such-dir/' error out

Merge branch 'jk/rev-parse-double-dashes' into maintJunio C Hamano Mon, 13 Jan 2014 19:22:38 +0000 (11:22 -0800)

Merge branch 'jk/rev-parse-double-dashes' into maint

"git rev-parse <revs> -- <paths>" did not implement the usual
disambiguation rules the commands in the "git log" family used in
the same way.

* jk/rev-parse-double-dashes:
rev-parse: be more careful with munging arguments
rev-parse: correctly diagnose revision errors before "--"

Merge branch 'jk/cat-file-regression-fix' into maintJunio C Hamano Mon, 13 Jan 2014 19:22:21 +0000 (11:22 -0800)

Merge branch 'jk/cat-file-regression-fix' into maint

"git cat-file --batch=", an admittedly useless command, did not
behave very well.

* jk/cat-file-regression-fix:
cat-file: handle --batch format with missing type/size
cat-file: pass expand_data to print_object_or_die

pack-heuristics.txt: mark up the file header properlyThomas Ackermann Sat, 11 Jan 2014 16:28:25 +0000 (17:28 +0100)

pack-heuristics.txt: mark up the file header properly

AsciiDoc wants these header-lines left-aligned.

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

t5531: further "matching" fixupsJeff King Wed, 8 Jan 2014 10:47:56 +0000 (05:47 -0500)

t5531: further "matching" fixups

Commit 43eb920 switched one of the sub-repository in this
test to matching to prepare for a world where the default
becomes "simple". However, the main repository needs a
similar change.

We did not notice any test failure when merged with b2ed944
(push: switch default from "matching" to "simple", 2013-01-04)
because t5531.6 is trying to provoke a failure of "git push"
due to a submodule check. When combined with b2ed944 the
push still fails, but for the wrong reason (because our
upstream setup does not exist, not because of the submodule).

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

diff test: reading a directory as a file need not error outJonathan Nieder Fri, 10 Jan 2014 20:10:31 +0000 (12:10 -0800)

diff test: reading a directory as a file need not error out

There is no guarantee that strbuf_read_file must error out for
directories. On some operating systems (e.g., Debian GNU/kFreeBSD
wheezy), reading a directory gives its raw content:

$ head -c5 < / | cat -A
^AM-|^_^@^L$

As a result, 'git diff -O/' succeeds instead of erroring out on
these systems, causing t4056.5 "orderfile is a directory" to fail.

On some weird OS it might even make sense to pass a directory to the
-O option and this is not a common user mistake that needs catching.
Remove the test.

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

mv: let 'git mv file no-such-dir/' error out on Windows... Johannes Sixt Wed, 8 Jan 2014 16:33:44 +0000 (17:33 +0100)

mv: let 'git mv file no-such-dir/' error out on Windows, too

The previous commit c57f628 (mv: let 'git mv file no-such-dir/' error out)
relies on that rename("file", "no-such-dir/") fails if the directory does not
exist (note the trailing slash). This does not work as expected on Windows:
This rename() call does not fail, but renames "file" to "no-such-dir" (not to
"no-such-dir/file"). Insert an explicit check for this case to force an error.

This changes the error message from

$ git mv file no-such-dir/
fatal: renaming 'file' failed: Not a directory

to

$ git mv file no-such-dir/
fatal: destination directory does not exist, source=file, destination=no-such-dir/

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

Update draft release notes to 1.9Junio C Hamano Fri, 10 Jan 2014 19:25:01 +0000 (11:25 -0800)

Update draft release notes to 1.9

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

Merge branch 'ss/builtin-cleanup'Junio C Hamano Fri, 10 Jan 2014 18:33:47 +0000 (10:33 -0800)

Merge branch 'ss/builtin-cleanup'

"git help $cmd" unnecessarily enumerated potential command names
from the filesystem, even when $cmd is known to be a built-in.

Ideas for further optimization, primarily by killing the use of
is_in_cmdlist(), were suggested in the discussion, but they can
come as follow-ups on top of this series.

* ss/builtin-cleanup:
builtin/help.c: speed up is_git_command() by checking for builtin commands first
builtin/help.c: call load_command_list() only when it is needed
git.c: consistently use the term "builtin" instead of "internal command"

Merge branch 'vm/octopus-merge-bases-simplify'Junio C Hamano Fri, 10 Jan 2014 18:33:45 +0000 (10:33 -0800)

Merge branch 'vm/octopus-merge-bases-simplify'

* vm/octopus-merge-bases-simplify:
get_octopus_merge_bases(): cleanup redundant variable

Merge branch 'ta/format-user-manual-as-an-article'Junio C Hamano Fri, 10 Jan 2014 18:33:43 +0000 (10:33 -0800)

Merge branch 'ta/format-user-manual-as-an-article'

Update the way the user-manual is formatted via AsciiDoc to save
trees.

* ta/format-user-manual-as-an-article:
user-manual: improve html and pdf formatting

Merge branch 'rr/completion-branch-config'Junio C Hamano Fri, 10 Jan 2014 18:33:39 +0000 (10:33 -0800)

Merge branch 'rr/completion-branch-config'

Two-level configuration variable names in "branch.*" and "remote.*"
hierarchies whose variables are predominantly three-level where not
completed by hitting a <TAB> in bash and zsh completions.

* rr/completion-branch-config:
completion: fix remote.pushdefault
completion: fix branch.autosetup(merge|rebase)
completion: introduce __gitcomp_nl_append ()
zsh completion: find matching custom bash completion

Merge branch 'js/lift-parent-count-limit'Junio C Hamano Fri, 10 Jan 2014 18:33:36 +0000 (10:33 -0800)

Merge branch 'js/lift-parent-count-limit'

There is no reason to have a hardcoded upper limit of the number of
parents for an octopus merge, created via the graft mechanism.

* js/lift-parent-count-limit:
Remove the line length limit for graft files

Merge branch 'jk/test-framework-updates'Junio C Hamano Fri, 10 Jan 2014 18:33:34 +0000 (10:33 -0800)

Merge branch 'jk/test-framework-updates'

The basic test used to leave unnecessary trash directories in the
t/ directory.

* jk/test-framework-updates:
t0000: drop "known breakage" test
t0000: simplify HARNESS_ACTIVE hack
t0000: set TEST_OUTPUT_DIRECTORY for sub-tests

Merge branch 'bm/merge-base-octopus-dedup'Junio C Hamano Fri, 10 Jan 2014 18:33:32 +0000 (10:33 -0800)

Merge branch 'bm/merge-base-octopus-dedup'

"git merge-base --octopus" used to leave cleaning up suboptimal
result to the caller, but now it does the clean-up itself.

* bm/merge-base-octopus-dedup:
merge-base --octopus: reduce the result from get_octopus_merge_bases()
merge-base: separate "--independent" codepath into its own helper

Merge branch 'km/gc-eperm'Junio C Hamano Fri, 10 Jan 2014 18:33:30 +0000 (10:33 -0800)

Merge branch 'km/gc-eperm'

A "gc" process running as a different user should be able to stop a
new "gc" process from starting.

* km/gc-eperm:
gc: notice gc processes run by other users

Merge branch 'jk/http-auth-tests-robustify'Junio C Hamano Fri, 10 Jan 2014 18:33:18 +0000 (10:33 -0800)

Merge branch 'jk/http-auth-tests-robustify'

Using the same username and password during the tests would not
catch a potential breakage of sending one when we should be sending
the other.

* jk/http-auth-tests-robustify:
use distinct username/password for http auth tests

Merge branch 'jk/credential-plug-leak'Junio C Hamano Fri, 10 Jan 2014 18:33:16 +0000 (10:33 -0800)

Merge branch 'jk/credential-plug-leak'

An earlier "clean-up" introduced an unnecessary memory leak.

* jk/credential-plug-leak:
Revert "prompt: clean up strbuf usage"

Merge branch 'bs/mirbsd'Junio C Hamano Fri, 10 Jan 2014 18:33:14 +0000 (10:33 -0800)

Merge branch 'bs/mirbsd'

* bs/mirbsd:
Add MirBSD support to the build system.

Merge branch 'nd/commit-tree-constness'Junio C Hamano Fri, 10 Jan 2014 18:33:13 +0000 (10:33 -0800)

Merge branch 'nd/commit-tree-constness'

Code clean-up.

* nd/commit-tree-constness:
commit.c: make "tree" a const pointer in commit_tree*()

Merge branch 'jk/oi-delta-base'Junio C Hamano Fri, 10 Jan 2014 18:33:11 +0000 (10:33 -0800)

Merge branch 'jk/oi-delta-base'

Teach "cat-file --batch" to show delta-base object name for a
packed object that is represented as a delta.

* jk/oi-delta-base:
cat-file: provide %(deltabase) batch format
sha1_object_info_extended: provide delta base sha1s

Merge branch 'jk/sha1write-void'Junio C Hamano Fri, 10 Jan 2014 18:33:09 +0000 (10:33 -0800)

Merge branch 'jk/sha1write-void'

Code clean-up.

* jk/sha1write-void:
do not pretend sha1write returns errors

Merge branch 'nd/add-empty-fix'Junio C Hamano Fri, 10 Jan 2014 18:33:03 +0000 (10:33 -0800)

Merge branch 'nd/add-empty-fix'

"git add -A" (no other arguments) in a totally empty working tree
used to emit an error.

* nd/add-empty-fix:
add: don't complain when adding empty project root

Merge branch 'nd/daemon-informative-errors-typofix'Junio C Hamano Fri, 10 Jan 2014 18:32:59 +0000 (10:32 -0800)

Merge branch 'nd/daemon-informative-errors-typofix'

* nd/daemon-informative-errors-typofix:
daemon: be strict at parsing parameters --[no-]informative-errors

Merge branch 'tm/fetch-prune'Junio C Hamano Fri, 10 Jan 2014 18:32:50 +0000 (10:32 -0800)

Merge branch 'tm/fetch-prune'

Fetching 'frotz' branch with "git fetch", while having
'frotz/nitfol' remote-tracking branch from an earlier fetch, would
error out, primarily because the command has not been told to
remove anything on our side. In such a case, "git fetch --prune"
can be used to remove 'frotz/nitfol' to make room to fetch and
store 'frotz' remote-tracking branch.

* tm/fetch-prune:
fetch --prune: Run prune before fetching
fetch --prune: always print header url

Merge branch 'sb/diff-orderfile-config'Junio C Hamano Fri, 10 Jan 2014 18:32:42 +0000 (10:32 -0800)

Merge branch 'sb/diff-orderfile-config'

Allow "git diff -O<file>" to be configured with a new configuration
variable.

* sb/diff-orderfile-config:
diff: add diff.orderfile configuration variable
diff: let "git diff -O" read orderfile from any file and fail properly
t4056: add new tests for "git diff -O"

Merge branch 'bc/log-decoration'Junio C Hamano Fri, 10 Jan 2014 18:32:39 +0000 (10:32 -0800)

Merge branch 'bc/log-decoration'

"git log --decorate" did not handle a tag pointed by another tag
nicely.

* bc/log-decoration:
log: properly handle decorations with chained tags

Merge branch 'jh/rlimit-nofile-fallback'Junio C Hamano Fri, 10 Jan 2014 18:32:28 +0000 (10:32 -0800)

Merge branch 'jh/rlimit-nofile-fallback'

When we figure out how many file descriptors to allocate for
keeping packfiles open, a system with non-working getrlimit() could
cause us to die(), but because we make this call only to get a
rough estimate of how many is available and we do not even attempt
to use up all file descriptors available ourselves, it is nicer to
fall back to a reasonable low value rather than dying.

* jh/rlimit-nofile-fallback:
get_max_fd_limit(): fall back to OPEN_MAX upon getrlimit/sysconf failure

Merge branch 'rt/bfg-ad-in-filter-branch-doc'Junio C Hamano Fri, 10 Jan 2014 18:32:25 +0000 (10:32 -0800)

Merge branch 'rt/bfg-ad-in-filter-branch-doc'

* rt/bfg-ad-in-filter-branch-doc:
docs: add filter-branch notes on The BFG

Merge branch 'mh/path-max'Junio C Hamano Fri, 10 Jan 2014 18:32:21 +0000 (10:32 -0800)

Merge branch 'mh/path-max'

A few places where we relied on a fixed length buffer to hold
pathnames in these two programs have been converted to use strbuf.

* mh/path-max:
builtin/prune.c: use strbuf to avoid having to worry about PATH_MAX
prune-packed: use strbuf to avoid having to worry about PATH_MAX

Merge branch 'ap/path-max'Junio C Hamano Fri, 10 Jan 2014 18:32:18 +0000 (10:32 -0800)

Merge branch 'ap/path-max'

* ap/path-max:
Prevent buffer overflows when path is too long

Merge branch 'cc/replace-object-info'Junio C Hamano Fri, 10 Jan 2014 18:32:10 +0000 (10:32 -0800)

Merge branch 'cc/replace-object-info'

read_sha1_file() that is the workhorse to read the contents given
an object name honoured object replacements, but there is no
corresponding mechanism to sha1_object_info() that is used to
obtain the metainfo (e.g. type & size) about the object, leading
callers to weird inconsistencies.

* cc/replace-object-info:
replace info: rename 'full' to 'long' and clarify in-code symbols
Documentation/git-replace: describe --format option
builtin/replace: unset read_replace_refs
t6050: add tests for listing with --format
builtin/replace: teach listing using short, medium or full formats
sha1_file: perform object replacement in sha1_object_info_extended()
t6050: show that git cat-file --batch fails with replace objects
sha1_object_info_extended(): add an "unsigned flags" parameter
sha1_file.c: add lookup_replace_object_extended() to pass flags
replace_object: don't check read_replace_refs twice
rename READ_SHA1_FILE_REPLACE flag to LOOKUP_REPLACE_OBJECT

Merge branch 'nd/negative-pathspec'Junio C Hamano Fri, 10 Jan 2014 18:31:48 +0000 (10:31 -0800)

Merge branch 'nd/negative-pathspec'

Introduce "negative pathspec" magic, to allow "git log -- . ':!dir'" to
tell us "I am interested in everything but 'dir' directory".

* nd/negative-pathspec:
pathspec.c: support adding prefix magic to a pathspec with mnemonic magic
Support pathspec magic :(exclude) and its short form :!
glossary-content.txt: rephrase magic signature part

rebase: fix fork-point with zero argumentsJohn Keeping Thu, 9 Jan 2014 19:47:34 +0000 (19:47 +0000)

rebase: fix fork-point with zero arguments

When no arguments are specified, $switch_to is empty so we end up
passing the empty string to "git merge-base --fork-point", which causes
an error. git-rebase carries on at this point, but in fact we have
failed to apply the fork-point operation.

It turns out that the test in t3400 that was meant to test this didn't
actually need the fork-point behaviour, so enhance it to make sure that
the fork-point is applied correctly. The modified test fails without
the change to git-rebase.sh in this patch.

Reported-by: Andreas Krey <a.krey@gmx.de>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

shorten_unambiguous_ref(): tighten up pointer arithmeticMichael Haggerty Wed, 8 Jan 2014 14:43:40 +0000 (15:43 +0100)

shorten_unambiguous_ref(): tighten up pointer arithmetic

As long as we're being pathologically stingy with mallocs, we might as
well do the math right and save 6 (!) bytes.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gen_scanf_fmt(): delete function and use snprintf(... Michael Haggerty Wed, 8 Jan 2014 14:43:39 +0000 (15:43 +0100)

gen_scanf_fmt(): delete function and use snprintf() instead

To replace "%.*s" with "%s", all we have to do is use snprintf()
to interpolate "%s" into the pattern.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

shorten_unambiguous_ref(): introduce a new local variableMichael Haggerty Wed, 8 Jan 2014 14:43:38 +0000 (15:43 +0100)

shorten_unambiguous_ref(): introduce a new local variable

When filling the scanf_fmts array, use a separate variable to keep
track of the offset to avoid clobbering total_len (which we will need
in the next commit).

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5537: fix incorrect expectation in test case 10Nguyễn Thái Ngọc Duy Wed, 8 Jan 2014 12:13:19 +0000 (19:13 +0700)

t5537: fix incorrect expectation in test case 10

Commit 48d25ca adds a new commit "7" to the repo that the next test case
in commit 1609488 clones from. But the next test case does not expect
this commit. For these tests, it's the bottom that's important, not
the top. Fix the expected commit list.

While at it, fix the default http port number to 5537. Otherwise when
t5536 learns to test httpd, running test in parallel may fail.

References:

48d25ca fetch: add --update-shallow to accept... - 2013-12-05
1609488 smart-http: support shallow fetch/clone - 2013-12-05

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

rm: better document side effects when removing a submoduleJens Lehmann Tue, 7 Jan 2014 21:32:37 +0000 (22:32 +0100)

rm: better document side effects when removing a submodule

The "Submodules" section of the "git rm" documentation mentions what will
happen when a submodule with a gitfile gets removed with newer git. But it
doesn't talk about what happens when the user changes between commits
before and after the removal, which does not remove the submodule from the
work tree like using the rm command did the first time.

Explain what happens and what the user has to do manually to fix that in
the new BUGS section. Also document this behavior in a new test.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mv: better document side effects when moving a submoduleJens Lehmann Tue, 7 Jan 2014 21:31:32 +0000 (22:31 +0100)

mv: better document side effects when moving a submodule

The "Submodules" section of the "git mv" documentation mentions what will
happen when a submodule with a gitfile gets moved with newer git. But it
doesn't talk about what happens when the user changes between commits
before and after the move, which does not update the work tree like using
the mv command did the first time.

Explain what happens and what the user has to do manually to fix that in
the new BUGS section. Also document this behavior in a new test.

Reported-by: George Papanikolaou <g3orge.app@gmail.com>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stash: handle specifying stashes with $IFSØystein Walle Tue, 7 Jan 2014 08:22:15 +0000 (09:22 +0100)

stash: handle specifying stashes with $IFS

When trying to pop/apply a stash specified with an argument
containing IFS whitespace, git-stash will throw an error:

$ git stash pop 'stash@{two hours ago}'
Too many revisions specified: stash@{two hours ago}

This happens because word splitting is used to count non-option
arguments. Make use of rev-parse's --sq option to quote the arguments
for us to ensure a correct count. Add quotes where necessary.

Also add a test that verifies correct behaviour.

Helped-by: Thomas Rast <tr@thomasrast.ch>
Signed-off-by: Øystein Walle <oystwa@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: complete format.coverLetterRamkumar Ramachandra Mon, 6 Jan 2014 17:18:51 +0000 (22:48 +0530)

completion: complete format.coverLetter

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

sha1_name: don't resolve refs when core.warnambiguousre... Brodie Rao Tue, 7 Jan 2014 03:32:01 +0000 (19:32 -0800)

sha1_name: don't resolve refs when core.warnambiguousrefs is false

When seeing a full 40-hex object name, get_sha1_basic()
unconditionally checks if the string can also be interpreted as a
refname, but the result will not be used unless warn_ambiguous_refs
is in effect.

Omitting this unnecessary ref resolution provides a substantial
performance improvement, especially when passing many hashes to a
command (like "git rev-list --stdin") and core.warnambiguousrefs is
set to false. The check incurs 6 stat()s for every hash supplied,
which can be costly over NFS.

Signed-off-by: Brodie Rao <brodie@sf.io>
Acked-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pager: set LV=-c alongside LESS=FRSXJonathan Nieder Tue, 7 Jan 2014 02:14:05 +0000 (18:14 -0800)

pager: set LV=-c alongside LESS=FRSX

On systems with lv configured as the preferred pager (i.e.,
DEFAULT_PAGER=lv at build time, or PAGER=lv exported in the
environment) git commands that use color show control codes instead of
color in the pager:

$ git diff
^[[1mdiff --git a/.mailfilter b/.mailfilter^[[m
^[[1mindex aa4f0b2..17e113e 100644^[[m
^[[1m--- a/.mailfilter^[[m
^[[1m+++ b/.mailfilter^[[m
^[[36m@@ -1,11 +1,58 @@^[[m

"less" avoids this problem because git uses the LESS environment
variable to pass the -R option ('output ANSI color escapes in raw
form') by default. Use the LV environment variable to pass 'lv' the
-c option ('allow ANSI escape sequences for text decoration / color')
to fix it for lv, too.

Noticed when the default value for color.ui flipped to 'auto' in
v1.8.4-rc0~36^2~1 (2013-06-10).

Reported-by: Olaf Meeuwissen <olaf.meeuwissen@avasys.jp>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-submodule.sh: 'checkout' is a valid update modeFrancesco Pretto Sun, 5 Jan 2014 02:50:48 +0000 (03:50 +0100)

git-submodule.sh: 'checkout' is a valid update mode

'checkout' is documented as one of the valid values for the
'submodule.<name>.update' variable, and in a repository with the
variable set to 'checkout', "git submodule update" command does
update using the 'checkout' mode.

However, it has been an accident that the implementation works this
way; any unknown value would trigger the same codepath and update
using the 'checkout' mode.

Explicitly list 'checkout' as one of the known update modes, and
error out when an unknown update mode is used.

Teach the codepath that initializes the configuration variable from
an in-tree .gitmodules that 'checkout' is one of the valid values.
The code since ac1fbbda (submodule: do not copy unknown update mode
from .gitmodules, 2013-12-02) used to treat the value 'checkout' as
unknown and mapped it to 'none', which made little sense. With this
change, 'checkout' specified in .gitmodules will stay to be 'checkout'.

Signed-off-by: Francesco Pretto <ceztko@gmail.com>
Signed-off-by: Signed-off-by: Junio C Hamano <gitster@pobox.com>

user-manual: improve html and pdf formattingThomas Ackermann Sat, 4 Jan 2014 09:07:51 +0000 (10:07 +0100)

user-manual: improve html and pdf formatting

Use asciidoc style 'article' instead of 'book' and change asciidoc
title level. This removes blank first page and superfluous "Part I"
page (there is no "Part II") in pdf output. Also pdf size is
decreased by this from 77 to 67 pages. In html output this removes
unnecessary sub-tocs and chapter numbering.

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

builtin/help.c: speed up is_git_command() by checking... Sebastian Schuberth Thu, 2 Jan 2014 16:17:11 +0000 (17:17 +0100)

builtin/help.c: speed up is_git_command() by checking for builtin commands first

Since 2dce956 is_git_command() is a bit slow as it does file I/O in
the call to list_commands_in_dir(). Avoid the file I/O by adding an
early check for the builtin commands.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/help.c: call load_command_list() only when... Sebastian Schuberth Thu, 2 Jan 2014 16:16:30 +0000 (17:16 +0100)

builtin/help.c: call load_command_list() only when it is needed

This avoids list_commands_in_dir() being called when not needed which is
quite slow due to file I/O in order to list matching files in a directory.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git.c: consistently use the term "builtin" instead... Sebastian Schuberth Thu, 2 Jan 2014 16:15:44 +0000 (17:15 +0100)

git.c: consistently use the term "builtin" instead of "internal command"

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Mon, 6 Jan 2014 18:39:07 +0000 (10:39 -0800)

Merge branch 'maint'

* maint:
Documentation/gitmodules: Only 'update' and 'url' are required
l10n: de.po: fix translation of 'prefix'

safe_create_leading_directories(): add new error value... Michael Haggerty Mon, 6 Jan 2014 13:45:27 +0000 (14:45 +0100)

safe_create_leading_directories(): add new error value SCLD_VANISHED

Add a new possible error result that can be returned by
safe_create_leading_directories() and
safe_create_leading_directories_const(): SCLD_VANISHED. This value
indicates that a file or directory on the path existed at one point
(either it already existed or the function created it), but then it
disappeared. This probably indicates that another process deleted the
directory while we were working. If SCLD_VANISHED is returned, the
caller might want to retry the function call, as there is a chance
that a new attempt will succeed.

Why doesn't safe_create_leading_directories() do the retrying
internally? Because an empty directory isn't really ever safe until
it holds a file. So even if safe_create_leading_directories() were
absolutely sure that the directory existed before it returned, there
would be no guarantee that the directory still existed when the caller
tried to write something in it.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cmd_init_db(): when creating directories, handle errors... Michael Haggerty Mon, 6 Jan 2014 13:45:26 +0000 (14:45 +0100)

cmd_init_db(): when creating directories, handle errors conservatively

safe_create_leading_directories_const() returns a non-zero value on
error. The old code at this calling site recognized a couple of
particular error values, and treated all other return values as
success. Instead, be more conservative: recognize the errors we are
interested in, but treat any other nonzero values as failures. This
is more robust in case somebody adds another possible return value
without telling us.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>