gitweb.git
.mailmap: René Scharfe has a new email addressRené Scharfe Wed, 17 Jul 2013 19:54:25 +0000 (21:54 +0200)

.mailmap: René Scharfe has a new email address

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

show-ref: make --head always show the HEAD refDoug Bell Wed, 17 Jul 2013 00:05:14 +0000 (19:05 -0500)

show-ref: make --head always show the HEAD ref

The docs seem to say that doing

git show-ref --head --tags

would show both the HEAD ref and all the tag refs. However, doing
both --head and either of --tags or --heads would filter out the HEAD
ref.

Also update the documentation to describe the new behavior and add
tests for the show-ref command.

[jc: Doug did proofread the tests, but it was done by me and bugs in
it are mine].

Signed-off-by: Doug Bell <madcityzen@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-log.txt: capitalize section namesMatthieu Moy Tue, 16 Jul 2013 08:05:40 +0000 (10:05 +0200)

Documentation/git-log.txt: capitalize section names

This is the convention in most other files and even at the beginning of
git-log.txt

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: move description of -s, --no-patch to... Matthieu Moy Tue, 16 Jul 2013 08:05:39 +0000 (10:05 +0200)

Documentation: move description of -s, --no-patch to diff-options.txt

Technically, "-s, --no-patch" is implemented in diff.c ("git diff
--no-patch" is essentially useless, but valid). From the user point of
view, this allows the documentation to show up in "git show --help",
which is one of the most useful use of the option.

While we're there, add a sentence explaining why the option can be
useful.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-show.txt: include common diff options... Matthieu Moy Tue, 16 Jul 2013 08:05:38 +0000 (10:05 +0200)

Documentation/git-show.txt: include common diff options, like git-log.txt

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: allow --patch & cie to override -s/--no-patchMatthieu Moy Tue, 16 Jul 2013 08:05:37 +0000 (10:05 +0200)

diff: allow --patch & cie to override -s/--no-patch

All options that trigger a patch output now override --no-patch.

The case of --binary deserves extra attention: the name may suggest that
it turns a normal patch into a binary patch, but it actually already
enables patch output when normally disabled (e.g. "git log --binary"
displays a patch), hence it makes sense for "git show --no-patch
--binary" to display the binary patch.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: allow --no-patch as synonym for -sMatthieu Moy Tue, 16 Jul 2013 08:05:36 +0000 (10:05 +0200)

diff: allow --no-patch as synonym for -s

This follows the usual convention of having a --no-foo option to negate
--foo.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4000-diff-format.sh: modernize styleMatthieu Moy Tue, 16 Jul 2013 08:05:35 +0000 (10:05 +0200)

t4000-diff-format.sh: modernize style

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-log.txt: fix typesetting of example "git-log -L... Eric Sunshine Tue, 16 Jul 2013 00:10:36 +0000 (20:10 -0400)

git-log.txt: fix typesetting of example "git-log -L" invocation

All surrounding examples are typeset as monospaced text. Follow suit.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Acked-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git: ensure 0/1/2 are open in main()Thomas Rast Tue, 16 Jul 2013 09:27:37 +0000 (11:27 +0200)

git: ensure 0/1/2 are open in main()

Not having an open FD in the 0--2 range can lead to strange results,
for example, a subsequent open() may return 2 (stderr) and then a
die() would clobber this file.

git-daemon and git-shell already guarded against this, but apparently
users also manage to trip over it in other git commands. So we call
sanitize_stdfds() during main git startup.

Since these FDs are inherited, this covers all use of 'git foo ...',
and all internal C commands when called directly. It does not fix
shell/perl commands called directly.

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

daemon/shell: refactor redirection of 0/1/2 from /dev... Thomas Rast Tue, 16 Jul 2013 09:27:36 +0000 (11:27 +0200)

daemon/shell: refactor redirection of 0/1/2 from /dev/null

Both daemon.c and shell.c contain logic to open FDs 0/1/2 from
/dev/null if they are not already open. Move the function in daemon.c
to setup.c and use it in shell.c, too.

While there, remove a 'not' that inverted the meaning of the comment.
The point is indeed to *avoid* messing up.

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

request-pull: improve error message for invalid revisio... Dirk Wallenstein Wed, 17 Jul 2013 17:28:11 +0000 (19:28 +0200)

request-pull: improve error message for invalid revision args

Currently, when an invalid revision is specified, the error message is:

fatal: Needed a single revision

This is misleading because, you might think there is something wrong
with the command line as a whole.

Now the user gets a more meaningful error message, showing the invalid
revision.

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-multimail: an improved replacement for post-receive... Michael Haggerty Sun, 14 Jul 2013 08:09:02 +0000 (10:09 +0200)

git-multimail: an improved replacement for post-receive-email

Add git-multimail, a tool for generating notification emails for
pushes to a Git repository. It is largely plug-in compatible with
post-receive-email, and is proposed to eventually replace that script.
The advantages of git-multimail relative to post-receive-email are
described in README.migrate-from-post-receive-email.

git-multimail is organized in a directory contrib/hooks/multimail.
The directory contains:

* git_multimail.py -- a Python module that can generate notification
emails for pushes to a Git repository. The file can be used
directly as a post-receive script (configured via git config
settings), or it can be imported as a Python module and configured
via arbitrary Python code.

* README -- user-level documentation for configuring and using
git-multimail.

* post-receive -- an example of building a post-receive script that
imports git_multimail.py as a Python module, with an example of how
to change the email templates.

* README.migrate-from-post-receive-email -- documentation targeted at
current users of post-receive-email, explaining the differences and
how to migrate a post-receive-email configuration to git-multimail.

* migrate-mailhook-config -- a script that can migrate a user's
post-receive-email configuration options to the equivalent
git-multimail options.

* README.Git -- a short explanation of the relationship between
git-multimail and the rest of the Git project, plus the exact date
and revision when this version was taken from the upstream project.

All but the last file are taken verbatim from the upstream
git-multimail project.

git-multimail is originally derived from post-receive-email and also
incorporates suggestions from the mailing list as well as patches by
the people listed below.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Contributions-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Contributions-by: Ramkumar Ramachandra <artagnon@gmail.com>
Contributions-by: Chris Hiestand <chrishiestand@gmail.com>
Contributions-by: Michiel Holtkamp <git@elfstone.nl>
Contributions-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

upload-pack: remove a piece of dead codeMatthijs Kooijman Thu, 11 Jul 2013 11:25:52 +0000 (13:25 +0200)

upload-pack: remove a piece of dead code

Commit 682c7d2 (upload-pack: fix off-by-one depth calculation in shallow
clone) introduced a new check in get_shallow_commits to decide when to
stop traversing the history and mark the current commit as a shallow
root.

With this new check in place, the old check can no longer be true, since
the first check always fires first. This commit removes that check,
making the code a bit more simple again.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Duy Nguyen <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.8.4Junio C Hamano Mon, 15 Jul 2013 17:33:21 +0000 (10:33 -0700)

Update draft release notes to 1.8.4

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

Sync with 1.8.3.3Junio C Hamano Mon, 15 Jul 2013 17:45:02 +0000 (10:45 -0700)

Sync with 1.8.3.3

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

Git 1.8.3.3 v1.8.3.3Junio C Hamano Mon, 15 Jul 2013 17:39:43 +0000 (10:39 -0700)

Git 1.8.3.3

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

Merge branch 'tr/maint-apply-non-git-patch-parsefix... Junio C Hamano Mon, 15 Jul 2013 17:36:14 +0000 (10:36 -0700)

Merge branch 'tr/maint-apply-non-git-patch-parsefix' into maint

"git apply" parsed patches that add new files, generated by programs
other than Git, incorrectly. This is an old breakage in v1.7.11.

* tr/maint-apply-non-git-patch-parsefix:
apply: carefully strdup a possibly-NULL name

Merge branch 'bc/http-keep-memory-given-to-curl' into... Junio C Hamano Mon, 15 Jul 2013 17:36:01 +0000 (10:36 -0700)

Merge branch 'bc/http-keep-memory-given-to-curl' into maint

Older cURL wanted piece of memory we call it with to be stable, but
we updated the auth material after handing it to a call.

* bc/http-keep-memory-given-to-curl:
http.c: don't rewrite the user:passwd string multiple times

Merge branch 'jk/pull-into-dirty-unborn' into maintJunio C Hamano Mon, 15 Jul 2013 17:35:43 +0000 (10:35 -0700)

Merge branch 'jk/pull-into-dirty-unborn' into maint

"git pull" into nothing trashed "local changes" that were in the
index.

* jk/pull-into-dirty-unborn:
pull: merge into unborn by fast-forwarding from empty tree
pull: update unborn branch tip after index

Merge branch 'fg/submodule-non-ascii-path' into maintJunio C Hamano Mon, 15 Jul 2013 17:35:17 +0000 (10:35 -0700)

Merge branch 'fg/submodule-non-ascii-path' into maint

Many "git submodule" operations did not work on a submodule at a
path whose name is not in ASCII.

* fg/submodule-non-ascii-path:
t7400: test of UTF-8 submodule names pass under Mac OS
handle multibyte characters in name

Merge branch 'fc/sequencer-plug-leak' into maintJunio C Hamano Mon, 15 Jul 2013 17:35:04 +0000 (10:35 -0700)

Merge branch 'fc/sequencer-plug-leak' into maint

"cherry-pick" had a small leak in its error codepath.

* fc/sequencer-plug-leak:
sequencer: avoid leaking message buffer when refusing to create an empty commit
sequencer: remove useless indentation

Merge branch 'mt/send-email-cc-match-fix' into maintJunio C Hamano Mon, 15 Jul 2013 17:34:36 +0000 (10:34 -0700)

Merge branch 'mt/send-email-cc-match-fix' into maint

Logic used by git-send-email to suppress cc mishandled names like "A
U. Thor" <author@example.xz>, where the human readable part needs to
be quoted (the user input may not have the double quotes around the
name, and comparison was done between quoted and unquoted strings).
It also mishandled names that need RFC2047 quoting.

* mt/send-email-cc-match-fix:
send-email: sanitize author when writing From line
send-email: add test for duplicate utf8 name
test-send-email: test for pre-sanitized self name
t/send-email: test suppress-cc=self with non-ascii
t/send-email: add test with quoted sender
send-email: make --suppress-cc=self sanitize input
t/send-email: test suppress-cc=self on cccmd
send-email: fix suppress-cc=self on cccmd
t/send-email.sh: add test for suppress-cc=self

Merge branch 'bc/send-email-use-port-as-separate-param'Junio C Hamano Mon, 15 Jul 2013 17:28:50 +0000 (10:28 -0700)

Merge branch 'bc/send-email-use-port-as-separate-param'

Pass port number as a separate argument when send-email initializes
Net::SMTP, instead of as a part of the hostname, i.e. host:port.
This allows GSSAPI codepath to match with the hostname given.

* bc/send-email-use-port-as-separate-param:
send-email: provide port separately from hostname

Merge branch 'fg/submodule-clone-depth'Junio C Hamano Mon, 15 Jul 2013 17:28:48 +0000 (10:28 -0700)

Merge branch 'fg/submodule-clone-depth'

Allow shallow-cloning of submodules with "git submodule update".

* fg/submodule-clone-depth:
Add --depth to submodule update/add

Merge branch 'cp/submodule-custom-update'Junio C Hamano Mon, 15 Jul 2013 17:28:44 +0000 (10:28 -0700)

Merge branch 'cp/submodule-custom-update'

In addition to the choice from "rebase, merge, or checkout-detach",
allow a custom command to be used in "submodule update" to update
the working tree of submodules.

* cp/submodule-custom-update:
submodule update: allow custom command to update submodule working tree

Merge branch 'jk/format-patch-from'Junio C Hamano Mon, 15 Jul 2013 17:28:39 +0000 (10:28 -0700)

Merge branch 'jk/format-patch-from'

"git format-patch" learned "--from[=whom]" option, which sets the
"From: " header to the specified person (or the person who runs the
command, if "=whom" part is missing) and move the original author
information to an in-body From: header as necessary.

* jk/format-patch-from:
teach format-patch to place other authors into in-body "From"
pretty.c: drop const-ness from pretty_print_context

Merge branch 'mv/merge-ff-tristate'Junio C Hamano Mon, 15 Jul 2013 17:28:34 +0000 (10:28 -0700)

Merge branch 'mv/merge-ff-tristate'

The configuration variable "merge.ff" was cleary a tri-state to
choose one from "favor fast-forward when possible", "always create
a merge even when the history could fast-forward" and "do not
create any merge, only update when the history fast-forwards", but
the command line parser did not implement the usual convention of
"last one wins, and command line overrides the configuration"
correctly.

* mv/merge-ff-tristate:
merge: handle --ff/--no-ff/--ff-only as a tri-state option

Merge branch 'jk/fetch-pack-many-refs'Junio C Hamano Mon, 15 Jul 2013 17:28:31 +0000 (10:28 -0700)

Merge branch 'jk/fetch-pack-many-refs'

Fetching between repositories with many refs employed O(n^2)
algorithm to match up the common objects, which has been corrected.

* jk/fetch-pack-many-refs:
fetch-pack: avoid quadratic behavior in rev_list_push
commit.c: make compare_commits_by_commit_date global
fetch-pack: avoid quadratic list insertion in mark_complete

templates: spell ASCII in uppercase in pre-commit hookRichard Hartmann Sun, 14 Jul 2013 16:21:16 +0000 (18:21 +0200)

templates: spell ASCII in uppercase in pre-commit hook

The name of the encoding is ASCII, not ascii.

Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

templates: Reformat pre-commit hook's messageRichard Hartmann Sun, 14 Jul 2013 16:21:15 +0000 (18:21 +0200)

templates: Reformat pre-commit hook's message

Now that we're using heredoc, the message can span the full 80 chars.

Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

templates: Use heredoc in pre-commit hookRichard Hartmann Sun, 14 Jul 2013 16:21:14 +0000 (18:21 +0200)

templates: Use heredoc in pre-commit hook

This way, it is easier to see how the text we give the end users
would look like, and it will allow us to use (near) full width
of the source file.

Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: Do not initialize a variable, which gets reassi... Stefan Beller Sun, 14 Jul 2013 21:35:49 +0000 (23:35 +0200)

diff.c: Do not initialize a variable, which gets reassigned anyway.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit: Fix a memory leak in determine_author_infoStefan Beller Sun, 14 Jul 2013 21:35:47 +0000 (23:35 +0200)

commit: Fix a memory leak in determine_author_info

The date variable is assigned new memory via xmemdupz and 2 lines later
it is assigned new memory again via xmalloc, but the first assignment
is never freed nor used.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

daemon.c:handle: Remove unneeded check for null pointer.Stefan Beller Sun, 14 Jul 2013 21:35:46 +0000 (23:35 +0200)

daemon.c:handle: Remove unneeded check for null pointer.

addr doesn't need to be checked at that line as it it already accessed
7 lines before in the if (addr->sa_family).

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "git-clone.txt: remove the restriction on pushin... Junio C Hamano Mon, 15 Jul 2013 15:31:52 +0000 (08:31 -0700)

Revert "git-clone.txt: remove the restriction on pushing from a shallow clone"

This reverts commit dacd2bcc414e0b7aac36aaa400da0a743c4741cc.

"It fails reliably without corrupting the receiving repository when
it should fail" may be better than the situation before the receiving
end was hardened recently, but the fact that sometimes the push does
not go through still remains. It is better to advice the users that
they cannot push from a shallow repository as a limitation before
they decide to use (or not to use) a shallow clone.

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

mailmap: style fixesJunio C Hamano Mon, 15 Jul 2013 06:54:13 +0000 (02:54 -0400)

mailmap: style fixes

Wrap overlong lines and format the multi-line comments to match our
coding style.

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

mailmap: debug: avoid passing NULL to fprintf() '%s... Eric Sunshine Mon, 15 Jul 2013 06:54:12 +0000 (02:54 -0400)

mailmap: debug: avoid passing NULL to fprintf() '%s' conversion specification

POSIX does not state the behavior of '%s' conversion when passed a
NULL pointer. Some implementations interpolate literal "(null)";
others may crash.

Callers of debug_mm() often pass NULL as indication of either a
missing name or email address. Instead, let's always supply a
proper string pointer, and make it a bit more descriptive: "(none)"

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

mailmap: debug: eliminate -Wformat field precision... Eric Sunshine Mon, 15 Jul 2013 06:54:11 +0000 (02:54 -0400)

mailmap: debug: eliminate -Wformat field precision type warning

The compiler complains that '*' in fprintf() format "%.*s" should
have type int, but we pass size_t. Fix this.

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

mailmap: debug: fix malformed fprintf() format conversi... Eric Sunshine Mon, 15 Jul 2013 06:54:10 +0000 (02:54 -0400)

mailmap: debug: fix malformed fprintf() format conversion specification

Resolve segmentation fault due to size_t variable being consumed by
'%s'.

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

mailmap: debug: fix out-of-order fprintf() argumentsEric Sunshine Mon, 15 Jul 2013 06:54:09 +0000 (02:54 -0400)

mailmap: debug: fix out-of-order fprintf() arguments

Resolve segmentation fault due to arguments passed in wrong order.

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

mailmap: do not downcase mailmap entriesJunio C Hamano Mon, 15 Jul 2013 06:54:08 +0000 (02:54 -0400)

mailmap: do not downcase mailmap entries

The email addresses in the records read from the .mailmap file are
downcased very early, and then used to match against e-mail
addresses in the input. Because we do use case insensitive version
of string list to manage these entries, there is no need to do this,
and worse yet, downcasing the rewritten/canonical e-mail read from
the .mailmap file loses information.

Stop doing that, and also make the string list used to keep multiple
names for an mailmap entry case insensitive (the code that uses the
list, lookup_prefix(), expects a case insensitive match).

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

t4203: demonstrate loss of uppercase characters in... Eric Sunshine Mon, 15 Jul 2013 06:54:07 +0000 (02:54 -0400)

t4203: demonstrate loss of uppercase characters in canonical email

The email addresses read from .mailmap are downcased before being
inserted into the mailmap data structure, which undesirably loses
information. It is impossible, for instance, to map <first.last@host>
to <First.Last@host>. Demonstrate this problem.

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

mailmap: do not lose single-letter namesJunio C Hamano Mon, 15 Jul 2013 06:54:06 +0000 (02:54 -0400)

mailmap: do not lose single-letter names

In parse_name_and_email() function, there is this line:

*name = (nstart < nend ? nstart : NULL);

When the function is given a buffer "A <A@example.org> <old@x.z>",
nstart scans from the beginning of the buffer, skipping whitespaces
(there isn't any, so nstart points at the buffer), while nend starts
from one byte before the first '<' and skips whitespaces backwards
and stops at the first non-whitespace (i.e. it hits "A" at the
beginning of the buffer). nstart == nend in this case for a
single-letter name, and an off-by-one error makes it fail to pick up
the name, which makes the entry equivalent to

<A@example.org> <old@x.z>

without the name.

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

t4203: demonstrate loss of single-character name in... Eric Sunshine Mon, 15 Jul 2013 06:54:05 +0000 (02:54 -0400)

t4203: demonstrate loss of single-character name in mailmap entry

A bug in mailmap.c:parse_name_and_email() causes it to overlook the
single-character name in "A <user@host>" and parse it only as
"<user@host>". Demonstrate this problem.

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

.mailmap: Combine more (email, name) to individual... Stefan Beller Sun, 14 Jul 2013 10:14:59 +0000 (12:14 +0200)

.mailmap: Combine more (email, name) to individual persons

I got more responses from people regarding the .mailmap file.
All added persons gave permission to add them to the .mailmap file.

It's mostly email mappings again. However we also have Nick Stokoe,
who contributed as Nick Woolley. He changed his name, but kept the email.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4203: test check-mailmap command invocationEric Sunshine Sat, 13 Jul 2013 00:53:11 +0000 (20:53 -0400)

t4203: test check-mailmap command invocation

Test the command-line interface of check-mailmap.

(Actual .mailmap functionality is already covered by existing tests.)

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

builtin: add git-check-mailmap commandEric Sunshine Sat, 13 Jul 2013 00:53:10 +0000 (20:53 -0400)

builtin: add git-check-mailmap command

Introduce command check-mailmap, similar to check-attr and check-ignore,
which allows direct testing of .mailmap configuration.

As plumbing accessible to scripts and other porcelain, check-mailmap
publishes the stable, well-tested .mailmap functionality employed by
built-in Git commands. Consequently, script authors need not
re-implement .mailmap functionality manually, thus avoiding potential
quirks and behavioral differences.

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

.mailmap: Map email addresses to namesStefan Beller Fri, 12 Jul 2013 19:21:21 +0000 (21:21 +0200)

.mailmap: Map email addresses to names

People change email addresses quite often and sometimes forget to
add their entry to the mailmap file. I have contacted lots of
people, whose name occurs multiple times in the short log having
different email addresses. The entries in the mailmap of this patch
are either confirmed by them or are trivial. Trivial means
different capitalisation of the domain (@MIT.EDU and @mit.edu) or
the domain was localhost, (none) or @local.

Additionally to adding (name, email) mappings to the .mailmap file,
it has also been sorted ("LC_ALL=C /usr/bin/sort", byte-value sort).

While the most changes happen at the email addresses, we also have a
name change in here. Karl Hasselström is now known as Karl Wiberg
due to marriage. Congratulations!

To find out whom to contact I used the following small
script:

#!/bin/bash
git shortlog -sne |awk '{ NF--; $1=""; print }' |sort |uniq -d > mailmapdoubles
while read line ; do
# remove leading whitespace
trimmed=$(echo $line | sed -e 's/^ *//g' -e 's/ *$//g')
echo "git shortlog -sne | grep \""$trimmed"\""
done < mailmapdoubles > mailmapdoubles2
sh mailmapdoubles2
rm mailmapdoubles
rm mailmapdoubles2

Also interesting for similar tasks are these snippets:

# Finding out duplicates by comparing email addresses:
git shortlog -sne |awk '{ print $NF }' |sort |uniq -d

# Finding out duplicates by comparing names:
git shortlog -sne |awk '{ NF--; $1=""; print }' |sort |uniq -d

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

Update draft release notes for 1.8.4Junio C Hamano Fri, 12 Jul 2013 17:49:34 +0000 (10:49 -0700)

Update draft release notes for 1.8.4

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

Merge branch 'jc/remote-http-argv-array'Junio C Hamano Fri, 12 Jul 2013 19:04:19 +0000 (12:04 -0700)

Merge branch 'jc/remote-http-argv-array'

* jc/remote-http-argv-array:
remote-http: use argv-array

Merge branch 'rs/pickaxe-simplify'Junio C Hamano Fri, 12 Jul 2013 19:04:17 +0000 (12:04 -0700)

Merge branch 'rs/pickaxe-simplify'

* rs/pickaxe-simplify:
diffcore-pickaxe: simplify has_changes and contains

Merge branch 'tr/test-lint-no-export-assignment-in... Junio C Hamano Fri, 12 Jul 2013 19:04:16 +0000 (12:04 -0700)

Merge branch 'tr/test-lint-no-export-assignment-in-shell'

* tr/test-lint-no-export-assignment-in-shell:
test-lint: detect 'export FOO=bar'
t9902: fix 'test A == B' to use = operator

Merge branch 'rr/name-rev-stdin-doc'Junio C Hamano Fri, 12 Jul 2013 19:04:14 +0000 (12:04 -0700)

Merge branch 'rr/name-rev-stdin-doc'

* rr/name-rev-stdin-doc:
name-rev doc: rewrite --stdin paragraph

Merge branch 'ft/diff-rename-default-score-is-half'Junio C Hamano Fri, 12 Jul 2013 19:04:12 +0000 (12:04 -0700)

Merge branch 'ft/diff-rename-default-score-is-half'

* ft/diff-rename-default-score-is-half:
diff-options: document default similarity index

Merge branch 'ml/cygwin-does-not-have-fifo'Junio C Hamano Fri, 12 Jul 2013 19:04:10 +0000 (12:04 -0700)

Merge branch 'ml/cygwin-does-not-have-fifo'

* ml/cygwin-does-not-have-fifo:
test-lib.sh - cygwin does not have usable FIFOs

Merge branch 'tf/gitweb-extra-breadcrumbs'Junio C Hamano Fri, 12 Jul 2013 19:04:09 +0000 (12:04 -0700)

Merge branch 'tf/gitweb-extra-breadcrumbs'

An Gitweb installation that is a part of larger site can optionally
show extra links that point at the levels higher than the Gitweb
pages itself in the link hierarchy of pages.

* tf/gitweb-extra-breadcrumbs:
gitweb: allow extra breadcrumbs to prefix the trail

Merge branch 'ms/remote-tracking-branches-in-doc'Junio C Hamano Fri, 12 Jul 2013 19:04:07 +0000 (12:04 -0700)

Merge branch 'ms/remote-tracking-branches-in-doc'

* ms/remote-tracking-branches-in-doc:
Change "remote tracking" to "remote-tracking"

Merge branch 'jk/pull-to-integrate'Junio C Hamano Fri, 12 Jul 2013 19:04:06 +0000 (12:04 -0700)

Merge branch 'jk/pull-to-integrate'

* jk/pull-to-integrate:
pull: change the description to "integrate" changes
push: avoid suggesting "merging" remote changes

Merge branch 'jk/maint-config-multi-order'Junio C Hamano Fri, 12 Jul 2013 19:04:04 +0000 (12:04 -0700)

Merge branch 'jk/maint-config-multi-order'

* jk/maint-config-multi-order:
git-config(1): clarify precedence of multiple values

Merge branch 'as/log-output-encoding-in-user-format'Junio C Hamano Fri, 12 Jul 2013 19:04:01 +0000 (12:04 -0700)

Merge branch 'as/log-output-encoding-in-user-format'

"log --format=" did not honor i18n.logoutputencoding configuration
and this attempts to fix it.

* as/log-output-encoding-in-user-format:
t4205 (log-pretty-formats): avoid using `sed`
t6006 (rev-list-format): add tests for "%b" and "%s" for the case i18n.commitEncoding is not set
t4205, t6006, t7102: make functions better readable
t4205 (log-pretty-formats): revert back single quotes
t4041, t4205, t6006, t7102: use iso8859-1 rather than iso-8859-1
t4205: replace .\+ with ..* in sed commands
pretty: --format output should honor logOutputEncoding
pretty: Add failing tests: --format output should honor logOutputEncoding
t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs
t7102 (reset): don't hardcode SHA-1 in expected outputs
t6006 (rev-list-format): don't hardcode SHA-1 in expected outputs

git-clone.txt: remove the restriction on pushing from... Nguyễn Thái Ngọc Duy Fri, 12 Jul 2013 05:37:42 +0000 (12:37 +0700)

git-clone.txt: remove the restriction on pushing from a shallow clone

The document says one cannot push from a shallow clone. But that is
not true (maybe it was at some point in the past). The client does not
stop such a push nor does it give any indication to the receiver that
this is a shallow push. If the receiver accepts it, it's in.

Since 52fed6e (receive-pack: check connectivity before concluding "git
push" - 2011-09-02), receive-pack is prepared to deal with broken
push, a shallow push can't cause any corruption. Update the document
to reflect that.

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

run-command: dup_devnull(): guard against syscalls... Thomas Rast Fri, 12 Jul 2013 08:58:36 +0000 (10:58 +0200)

run-command: dup_devnull(): guard against syscalls failing

dup_devnull() did not check the return values of open() and dup2().
Fix this omission.

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

git_mkstemps: correctly test return value of open()Dale R. Worley Fri, 12 Jul 2013 08:58:35 +0000 (10:58 +0200)

git_mkstemps: correctly test return value of open()

open() returns -1 on failure, and indeed 0 is a possible success value
if the user closed stdin in our process. Fix the test.

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

sha1_object_info_extended: pass object_info to helpersJeff King Fri, 12 Jul 2013 06:37:53 +0000 (02:37 -0400)

sha1_object_info_extended: pass object_info to helpers

We take in a "struct object_info" which contains pointers to
storage for items the caller cares about. But then rather
than pass the whole object to the low-level loose/packed
helper functions, we pass the individual pointers.

Let's pass the whole struct instead, which will make adding
more items later easier.

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

sha1_object_info_extended: make type calculation optionalJeff King Fri, 12 Jul 2013 06:34:57 +0000 (02:34 -0400)

sha1_object_info_extended: make type calculation optional

Each caller of sha1_object_info_extended sets up an
object_info struct to tell the function which elements of
the object it wants to get. Until now, getting the type of
the object has always been required (and it is returned via
the return type rather than a pointer in object_info).

This can involve actually opening a loose object file to
determine its type, or following delta chains to determine a
packed file's base type. These effects produce a measurable
slow-down when doing a "cat-file --batch-check" that does
not include %(objecttype).

This patch adds a "typep" query to struct object_info, so
that it can be optionally queried just like size and
disk_size. As a result, the return type of the function is
no longer the object type, but rather 0/-1 for success/error.

As there are only three callers total, we just fix up each
caller rather than keep a compatibility wrapper:

1. The simpler sha1_object_info wrapper continues to
always ask for and return the type field.

2. The istream_source function wants to know the type, and
so always asks for it.

3. The cat-file batch code asks for the type only when
%(objecttype) is part of the format string.

On linux.git, the best-of-five for running:

$ git rev-list --objects --all >objects
$ time git cat-file --batch-check='%(objectsize:disk)'

on a fully packed repository goes from:

real 0m8.680s
user 0m8.160s
sys 0m0.512s

to:

real 0m7.205s
user 0m6.580s
sys 0m0.608s

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

packed_object_info: make type lookup optionalJeff King Fri, 12 Jul 2013 06:32:25 +0000 (02:32 -0400)

packed_object_info: make type lookup optional

Currently, packed_object_info can save some work by not
calculating the size or disk_size of the object if the
caller is not interested. However, it always calculates the
true object type, whether the caller cares or not, and only
optionally returns the easy-to-get "representation type".

Let's swap these types. The function will now return the
representation type (or OBJ_BAD on failure), and will only
optionally fill in the true type.

There should be no behavior change yet, as the only caller,
sha1_object_info_extended, will always feed it a type
pointer.

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

packed_object_info: hoist delta type resolution to... Jeff King Fri, 12 Jul 2013 06:31:57 +0000 (02:31 -0400)

packed_object_info: hoist delta type resolution to helper

To calculate the type of a packed object, we must walk down
its delta chain until we hit a true base object with a real
type. Most of the code in packed_object_info is for handling
this case.

Let's hoist it out into a separate helper function, which
will make it easier to make the type-lookup optional in the
future (and keep our indentation level sane).

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

sha1_loose_object_info: make type lookup optionalJeff King Fri, 12 Jul 2013 06:30:48 +0000 (02:30 -0400)

sha1_loose_object_info: make type lookup optional

Until recently, the only items to request from
sha1_object_info_extended were type and size. This meant
that we always had to open a loose object file to determine
one or the other. But with the addition of the disk_size
query, it's possible that we can fulfill the query without
even opening the object file at all. However, since the
function interface always returns the type, we have no way
of knowing whether the caller cares about it or not.

This patch only modified sha1_loose_object_info to make type
lookup optional using an out-parameter, similar to the way
the size is handled (and the return value is "0" or "-1" for
success or error, respectively).

There should be no functional change yet, though, as
sha1_object_info_extended, the only caller, will always ask
for a type.

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

sha1_object_info_extended: rename "status" to "type"Jeff King Fri, 12 Jul 2013 06:21:22 +0000 (02:21 -0400)

sha1_object_info_extended: rename "status" to "type"

The value we get from each low-level object_info function
(e.g., loose, packed) is actually the object type (or -1 for
error). Let's explicitly call it "type", which will make
further refactorings easier to read.

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

cat-file: disable object/refname ambiguity check for... Jeff King Fri, 12 Jul 2013 06:20:05 +0000 (02:20 -0400)

cat-file: disable object/refname ambiguity check for batch mode

A common use of "cat-file --batch-check" is to feed a list
of objects from "rev-list --objects" or a similar command.
In this instance, all of our input objects are 40-byte sha1
ids. However, cat-file has always allowed arbitrary revision
specifiers, and feeds the result to get_sha1().

Fortunately, get_sha1() recognizes a 40-byte sha1 before
doing any hard work trying to look up refs, meaning this
scenario should end up spending very little time converting
the input into an object sha1. However, since 798c35f
(get_sha1: warn about full or short object names that look
like refs, 2013-05-29), when we encounter this case, we
spend the extra effort to do a refname lookup anyway, just
to print a warning. This is further exacerbated by ca91993
(get_packed_ref_cache: reload packed-refs file when it
changes, 2013-06-20), which makes individual ref lookup more
expensive by requiring a stat() of the packed-refs file for
each missing ref.

With no patches, this is the time it takes to run:

$ git rev-list --objects --all >objects
$ time git cat-file --batch-check='%(objectname)' <objects

on the linux.git repository:

real 1m13.494s
user 0m25.924s
sys 0m47.532s

If we revert ca91993, the packed-refs up-to-date check, it
gets a little better:

real 0m54.697s
user 0m21.692s
sys 0m32.916s

but we are still spending quite a bit of time on ref lookup
(and we would not want to revert that patch, anyway, which
has correctness issues). If we revert 798c35f, disabling
the warning entirely, we get a much more reasonable time:

real 0m7.452s
user 0m6.836s
sys 0m0.608s

This patch does the moral equivalent of this final case (and
gets similar speedups). We introduce a global flag that
callers of get_sha1() can use to avoid paying the price for
the warning.

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

Merge branch 'nd/warn-ambiguous-object-name' into jk... Junio C Hamano Fri, 12 Jul 2013 17:09:50 +0000 (10:09 -0700)

Merge branch 'nd/warn-ambiguous-object-name' into jk/cat-file-batch-optim

* nd/warn-ambiguous-object-name:
get_sha1: warn about full or short object names that look like refs

do not die when error in config parsing of buf occursHeiko Voigt Thu, 11 Jul 2013 22:48:30 +0000 (00:48 +0200)

do not die when error in config parsing of buf occurs

If a config parsing error in a file occurs we can die and let the user
fix the issue. This is different for the buf parsing function since it
can be used to parse blobs of .gitmodules files. If a parsing error
occurs here we should proceed since otherwise a database containing such
an error in a single revision could be rendered unusable.

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

teach config --blob option to parse config from databaseHeiko Voigt Thu, 11 Jul 2013 22:46:47 +0000 (00:46 +0200)

teach config --blob option to parse config from database

This can be used to read configuration values directly from git's
database. For example it is useful for reading to be checked out
.gitmodules files directly from the database.

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

config: make parsing stack struct independent from... Heiko Voigt Thu, 11 Jul 2013 22:44:39 +0000 (00:44 +0200)

config: make parsing stack struct independent from actual data source

To simplify adding other sources we extract all functions needed for
parsing into a list of callbacks. We implement those callbacks for the
current file parsing. A new source can implement its own set of callbacks.

Instead of storing the concrete FILE pointer for parsing we store a void
pointer. A new source can use this to store its custom data.

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

config: drop cf validity check in get_next_char()Heiko Voigt Sat, 11 May 2013 13:19:29 +0000 (15:19 +0200)

config: drop cf validity check in get_next_char()

The global variable cf is set with an initialized value in all codepaths before
calling this function.

The complete call graph looks like this:

git_config_from_file
-> do_config_from
-> git_parse_file
-> get_next_char
-> get_value
-> get_next_char
-> parse_value
-> get_next_char
-> get_base_var
-> get_next_char
-> get_extended_base_var
-> get_next_char

The variable is initialized in do_config_from.

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

config: factor out config file stack managementHeiko Voigt Sat, 11 May 2013 13:18:52 +0000 (15:18 +0200)

config: factor out config file stack management

Because a config callback may start parsing a new file, the
global context regarding the current config file is stored
as a stack. Currently we only need to manage that stack from
git_config_from_file. Let's factor it out to allow new
sources of config data.

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

t0008: avoid SIGPIPE race condition on fifoJeff King Fri, 12 Jul 2013 10:35:23 +0000 (06:35 -0400)

t0008: avoid SIGPIPE race condition on fifo

To test check-ignore's --stdin feature, we use two fifos to
send and receive data. We carefully keep a descriptor to its
input open so that it does not receive EOF between input
lines. However, we do not do the same for its output. That
means there is a potential race condition in which
check-ignore has opened the output pipe once (when we read
the first line), and then writes the second line before we
have re-opened the pipe.

In that case, check-ignore gets a SIGPIPE and dies. The
outer shell then tries to open the output fifo but blocks
indefinitely, because there is no writer. We can fix it by
keeping a descriptor open through the whole procedure.

This should also help if check-ignore dies for any other
reason (we would already have opened the fifo and would
therefore not block, but just get EOF on read).

However, we are technically still susceptible to
check-ignore dying early, before we have opened the fifo.
This is an unlikely race and shouldn't generally happen in
practice, though, so we can hopefully ignore it.

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

pack-revindex: radix-sort the revindexJeff King Thu, 11 Jul 2013 12:16:00 +0000 (08:16 -0400)

pack-revindex: radix-sort the revindex

The pack revindex stores the offsets of the objects in the
pack in sorted order, allowing us to easily find the on-disk
size of each object. To compute it, we populate an array
with the offsets from the sha1-sorted idx file, and then use
qsort to order it by offsets.

That does O(n log n) offset comparisons, and profiling shows
that we spend most of our time in cmp_offset. However, since
we are sorting on a simple off_t, we can use numeric sorts
that perform better. A radix sort can run in O(k*n), where k
is the number of "digits" in our number. For a 64-bit off_t,
using 16-bit "digits" gives us k=4.

On the linux.git repo, with about 3M objects to sort, this
yields a 400% speedup. Here are the best-of-five numbers for
running

echo HEAD | git cat-file --batch-check="%(objectsize:disk)

on a fully packed repository, which is dominated by time
spent building the pack revindex:

before after
real 0m0.834s 0m0.204s
user 0m0.788s 0m0.164s
sys 0m0.040s 0m0.036s

This matches our algorithmic expectations. log(3M) is ~21.5,
so a traditional sort is ~21.5n. Our radix sort runs in k*n,
where k is the number of radix digits. In the worst case,
this is k=4 for a 64-bit off_t, but we can quit early when
the largest value to be sorted is smaller. For any
repository under 4G, k=2. Our algorithm makes two passes
over the list per radix digit, so we end up with 4n. That
should yield ~5.3x speedup. We see 4x here; the difference
is probably due to the extra bucket book-keeping the radix
sort has to do.

On a smaller repo, the difference is less impressive, as
log(n) is smaller. For git.git, with 173K objects (but still
k=2), we see a 2.7x improvement:

before after
real 0m0.046s 0m0.017s
user 0m0.036s 0m0.012s
sys 0m0.008s 0m0.000s

On even tinier repos (e.g., a few hundred objects), the
speedup goes away entirely, as the small advantage of the
radix sort gets erased by the book-keeping costs (and at
those sizes, the cost to generate the the rev-index gets
lost in the noise anyway).

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-revindex: use unsigned to store number of objectsJeff King Wed, 10 Jul 2013 11:50:26 +0000 (07:50 -0400)

pack-revindex: use unsigned to store number of objects

A packfile may have up to 2^32-1 objects in it, so the
"right" data type to use is uint32_t. We currently use a
signed int, which means that we may behave incorrectly for
packfiles with more than 2^31-1 objects on 32-bit systems.

Nobody has noticed because having 2^31 objects is pretty
insane. The linux.git repo has on the order of 2^22 objects,
which is hundreds of times smaller than necessary to trigger
the bug.

Let's bump this up to an "unsigned". On 32-bit systems, this
gives us the correct data-type, and on 64-bit systems, it is
probably more efficient to use the native "unsigned" than a
true uint32_t.

While we're at it, we can fix the binary search not to
overflow in such a case if our unsigned is 32 bits.

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

cat-file: split --batch input lines on whitespaceJeff King Thu, 11 Jul 2013 20:45:59 +0000 (16:45 -0400)

cat-file: split --batch input lines on whitespace

If we get an input line to --batch or --batch-check that
looks like "HEAD foo bar", we will currently feed the whole
thing to get_sha1(). This means that to use --batch-check
with `rev-list --objects`, one must pre-process the input,
like:

git rev-list --objects HEAD |
cut -d' ' -f1 |
git cat-file --batch-check

Besides being more typing and slightly less efficient to
invoke `cut`, the result loses information: we no longer
know which path each object was found at.

This patch teaches cat-file to split input lines at the
first whitespace. Everything to the left of the whitespace
is considered an object name, and everything to the right is
made available as the %(reset) atom. So you can now do:

git rev-list --objects HEAD |
git cat-file --batch-check='%(objectsize) %(rest)'

to collect object sizes at particular paths.

Even if %(rest) is not used, we always do the whitespace
split (which means you can simply eliminate the `cut`
command from the first example above).

This whitespace split is backwards compatible for any
reasonable input. Object names cannot contain spaces, so any
input with spaces would have resulted in a "missing" line.
The only input hurt is if somebody really expected input of
the form "HEAD is a fine-looking ref!" to fail; it will now
parse HEAD, and make "is a fine-looking ref!" available as
%(rest).

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

cat-file: add %(objectsize:disk) format atomJeff King Wed, 10 Jul 2013 11:46:25 +0000 (07:46 -0400)

cat-file: add %(objectsize:disk) format atom

This atom is just like %(objectsize), except that it shows
the on-disk size of the object rather than the object's true
size. In other words, it makes the "disk_size" query of
sha1_object_info_extended available via the command-line.

This can be used for rough attribution of disk usage to
particular refs, though see the caveats in the
documentation.

This patch does not include any tests, as the exact numbers
returned are volatile and subject to zlib and packing
decisions. We cannot even reliably guarantee that the
on-disk size is smaller than the object content (though in
general this should be the case for non-trivial objects).

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

cat-file: add --batch-check=<format>Jeff King Wed, 10 Jul 2013 11:45:47 +0000 (07:45 -0400)

cat-file: add --batch-check=<format>

The `cat-file --batch-check` command can be used to quickly
get information about a large number of objects. However, it
provides a fixed set of information.

This patch adds an optional <format> option to --batch-check
to allow a caller to specify which items they are interested
in, and in which order to output them. This is not very
exciting for now, since we provide the same limited set that
you could already get. However, it opens the door to adding
new format items in the future without breaking backwards
compatibility (or forcing callers to pay the cost to
calculate uninteresting items).

Since the --batch option shares code with --batch-check, it
receives the same feature, though it is less likely to be of
interest there.

The format atom names are chosen to match their counterparts
in for-each-ref. Though we do not (yet) share any code with
for-each-ref's formatter, this keeps the interface as
consistent as possible, and may help later on if the
implementations are unified.

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

Update draft release notes to 1.8.4Junio C Hamano Thu, 11 Jul 2013 20:25:18 +0000 (13:25 -0700)

Update draft release notes to 1.8.4

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

Merge branch 'jc/t1512-fix'Junio C Hamano Thu, 11 Jul 2013 20:06:11 +0000 (13:06 -0700)

Merge branch 'jc/t1512-fix'

A test that should have failed but didn't revealed a bug that needs
to be corrected.

* jc/t1512-fix:
get_short_sha1(): correctly disambiguate type-limited abbreviation
t1512: correct leftover constants from earlier edition

Merge branch 'tr/test-v-and-v-subtest-only'Junio C Hamano Thu, 11 Jul 2013 20:06:02 +0000 (13:06 -0700)

Merge branch 'tr/test-v-and-v-subtest-only'

Finishing touches to a topic that is already in master for the
upcoming release.

* tr/test-v-and-v-subtest-only:
t0000: do not use export X=Y

Merge branch 'af/rebase-i-merge-options'Junio C Hamano Thu, 11 Jul 2013 20:05:58 +0000 (13:05 -0700)

Merge branch 'af/rebase-i-merge-options'

"git rebase -i" now honors --strategy and -X options.

* af/rebase-i-merge-options:
Do not ignore merge options in interactive rebase

Merge branch 'pb/stash-refuse-to-kill'Junio C Hamano Thu, 11 Jul 2013 20:05:52 +0000 (13:05 -0700)

Merge branch 'pb/stash-refuse-to-kill'

"git stash save" is not just about "saving" the local changes, but
also is to restore the working tree state to that of HEAD. If you
changed a non-directory into a directory in the local change, you
may have untracked files in that directory, which have to be killed
while doing so, unless you run it with --include-untracked. Teach
the command to detect and error out before spreading the damage.

This needed a small fix to "ls-files --killed".

* pb/stash-refuse-to-kill:
git stash: avoid data loss when "git stash save" kills a directory
treat_directory(): do not declare submodules to be untracked

Merge branch 'jc/maint-diff-core-safecrlf'Junio C Hamano Thu, 11 Jul 2013 20:05:45 +0000 (13:05 -0700)

Merge branch 'jc/maint-diff-core-safecrlf'

"git diff" refused to even show difference when core.safecrlf is
set to true (i.e. error out) and there are offending lines in the
working tree files.

* jc/maint-diff-core-safecrlf:
diff: demote core.safecrlf=true to core.safecrlf=warn

Merge branch 'jg/status-config'Junio C Hamano Thu, 11 Jul 2013 20:05:34 +0000 (13:05 -0700)

Merge branch 'jg/status-config'

"git status" learned status.branch and status.short configuration
variables to use --branch and --short options by default (override
with --no-branch and --no-short options from the command line).

* jg/status-config:
status/commit: make sure --porcelain is not affected by user-facing config
commit: make it work with status.short
status: introduce status.branch to enable --branch by default
status: introduce status.short to enable --short by default

Merge branch 'jk/bash-completion'Junio C Hamano Thu, 11 Jul 2013 20:05:28 +0000 (13:05 -0700)

Merge branch 'jk/bash-completion'

* jk/bash-completion:
completion: learn about --man-path
completion: handle unstuck form of base git options

Merge branch 'rr/rebase-checkout-reflog'Junio C Hamano Thu, 11 Jul 2013 20:04:33 +0000 (13:04 -0700)

Merge branch 'rr/rebase-checkout-reflog'

Invocations of "git checkout" used internally by "git rebase" were
counted as "checkout", and affected later "git checkout -" to the
the user to an unexpected place.

* rr/rebase-checkout-reflog:
checkout: respect GIT_REFLOG_ACTION
status: do not depend on rebase reflog messages
t/t2021-checkout-last: "checkout -" should work after a rebase finishes
wt-status: remove unused field in grab_1st_switch_cbdata
t7512: test "detached from" as well

Merge branch 'jc/triangle-push-fixup'Junio C Hamano Thu, 11 Jul 2013 20:03:21 +0000 (13:03 -0700)

Merge branch 'jc/triangle-push-fixup'

Earlier remote.pushdefault (and per-branch branch.*.pushremote)
were introduced as an additional mechanism to choose what
repository to push into when "git push" did not say it from the
command line, to help people who push to a repository that is
different from where they fetch from. This attempts to finish that
topic by teaching the default mechanism to choose branch in the
remote repository to be updated by such a push.

The 'current', 'matching' and 'nothing' modes (specified by the
push.default configuration variable) extend to such a "triangular"
workflow naturally, but 'upstream' and 'simple' have to be updated.

. 'upstream' is about pushing back to update the branch in the
remote repository that the current branch fetches from and
integrates with, it errors out in a triangular workflow.

. 'simple' is meant to help new people by avoiding mistakes, and
will be the safe default in Git 2.0.

In a non-triangular workflow, it will continue to act as a cross
between 'upstream' and 'current' in that it pushes to the current
branch's @{upstream} only when it is set to the same name as the
current branch (e.g. your 'master' forks from the 'master' from
the central repository).

In a triangular workflow, this series tentatively defines it as
the same as 'current', but we may have to tighten it to avoid
surprises in some way.

* jc/triangle-push-fixup:
t/t5528-push-default: test pushdefault workflows
t/t5528-push-default: generalize test_push_*
push: change `simple` to accommodate triangular workflows
config doc: rewrite push.default section
t/t5528-push-default: remove redundant test_config lines

Merge branch 'mh/maint-lockfile-overflow'Junio C Hamano Thu, 11 Jul 2013 20:03:16 +0000 (13:03 -0700)

Merge branch 'mh/maint-lockfile-overflow'

* mh/maint-lockfile-overflow:
lockfile: fix buffer overflow in path handling

cat-file: refactor --batch option parsingJeff King Wed, 10 Jul 2013 11:38:58 +0000 (07:38 -0400)

cat-file: refactor --batch option parsing

We currently use an int to tell us whether --batch parsing
is on, and if so, whether we should print the full object
contents. Let's instead factor this into a struct, filled in
by callback, which will make further batch-related options
easy to add.

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

cat-file: teach --batch to stream blob objectsJeff King Wed, 10 Jul 2013 11:38:24 +0000 (07:38 -0400)

cat-file: teach --batch to stream blob objects

The regular "git cat-file -p" and "git cat-file blob" code
paths already learned to stream large blobs. Let's do the
same here.

Note that this means we look up the type and size before
making a decision of whether to load the object into memory
or stream (just like the "-p" code path does). That can lead
to extra work, but it should be dwarfed by the cost of
actually accessing the object itself. In my measurements,
there was a 1-2% slowdown when using "--batch" on a large
number of objects.

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

t1006: modernize output comparisonsJeff King Wed, 10 Jul 2013 11:36:43 +0000 (07:36 -0400)

t1006: modernize output comparisons

In modern tests, we typically put output into a file and
compare it with test_cmp. This is nicer than just comparing
via "test", and much shorter than comparing via "test" and
printing a custom message.

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

wt-status: use "format" function attribute for status_p... Jeff King Wed, 10 Jul 2013 00:23:28 +0000 (20:23 -0400)

wt-status: use "format" function attribute for status_printf

These functions could benefit from the added compile-time
safety of having the compiler check printf arguments.

Unfortunately, we also sometimes pass an empty format string,
which will cause false positives with -Wformat-zero-length.
In this case, that warning is wrong because our function is
not a no-op with an empty format: it may be printing
colorized output along with a trailing newline.

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

use "sentinel" function attribute for variadic listsJeff King Wed, 10 Jul 2013 00:19:12 +0000 (20:19 -0400)

use "sentinel" function attribute for variadic lists

This attribute can help gcc notice when callers forget to
add a NULL sentinel to the end of the function. This is our
first use of the sentinel attribute, but we shouldn't need
to #ifdef for other compilers, as __attribute__ is already a
no-op on non-gcc-compatible compilers.

Suggested-by: Bert Wesarg <bert.wesarg@googlemail.com>
More-Spots-Found-By: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add missing "format" function attributesJeff King Wed, 10 Jul 2013 00:18:40 +0000 (20:18 -0400)

add missing "format" function attributes

For most of our functions that take printf-like formats, we
use gcc's __attribute__((format)) to get compiler warnings
when the functions are misused. Let's give a few more
functions the same protection.

In most cases, the annotations do not uncover any actual
bugs; the only code change needed is that we passed a size_t
to transfer_debug, which expected an int. Since we expect
the passed-in value to be a relatively small buffer size
(and cast a similar value to int directly below), we can
just cast away the problem.

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