gitweb.git
pkt-line: allow writing of LARGE_PACKET_MAX buffersJeff King Wed, 10 Dec 2014 09:47:02 +0000 (04:47 -0500)

pkt-line: allow writing of LARGE_PACKET_MAX buffers

When we send out pkt-lines with refnames, we use a static
1000-byte buffer. This means that the maximum size of a ref
over the git protocol is around 950 bytes (the exact size
depends on the protocol line being written, but figure on a sha1
plus some boilerplate).

This is enough for any sane workflow, but occasionally odd
things happen (e.g., a bug may create a ref "foo/foo/foo/..."
accidentally). With the current code, you cannot even use
"push" to delete such a ref from a remote.

Let's switch to using a strbuf, with a hard-limit of
LARGE_PACKET_MAX (which is specified by the protocol). This
matches the size of the readers, as of 74543a0 (pkt-line:
provide a LARGE_PACKET_MAX static buffer, 2013-02-20).
Versions of git older than that will complain about our
large packets, but it's really no worse than the current
behavior. Right now the sender barfs with "impossibly long
line" trying to send the packet, and afterwards the reader
will barf with "protocol error: bad line length %d", which
is arguably better anyway.

Note that we're not really _solving_ the problem here, but
just bumping the limits. In theory, the length of a ref is
unbounded, and pkt-line can only represent sizes up to
65531 bytes. So we are just bumping the limit, not removing
it. But hopefully 64K should be enough for anyone.

As a bonus, by using a strbuf for the formatting we can
eliminate an unnecessary copy in format_buf_write.

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

First batch for 2.3 cycleJunio C Hamano Fri, 5 Dec 2014 20:03:57 +0000 (12:03 -0800)

First batch for 2.3 cycle

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

Merge branch 'mh/config-flip-xbit-back-after-checking'Junio C Hamano Fri, 5 Dec 2014 19:43:10 +0000 (11:43 -0800)

Merge branch 'mh/config-flip-xbit-back-after-checking'

* mh/config-flip-xbit-back-after-checking:
create_default_files(): don't set u+x bit on $GIT_DIR/config

Merge branch 'jk/gitweb-with-newer-cgi-multi-param'Junio C Hamano Fri, 5 Dec 2014 19:42:55 +0000 (11:42 -0800)

Merge branch 'jk/gitweb-with-newer-cgi-multi-param'

* jk/gitweb-with-newer-cgi-multi-param:
gitweb: hack around CGI's list-context param() handling

Merge branch 'rs/receive-pack-use-labs'Junio C Hamano Fri, 5 Dec 2014 19:42:53 +0000 (11:42 -0800)

Merge branch 'rs/receive-pack-use-labs'

* rs/receive-pack-use-labs:
use labs() for variables of type long instead of abs()

Merge branch 'rs/maint-config-use-labs'Junio C Hamano Fri, 5 Dec 2014 19:42:50 +0000 (11:42 -0800)

Merge branch 'rs/maint-config-use-labs'

* rs/maint-config-use-labs:
use labs() for variables of type long instead of abs()

Merge branch 'js/windows-open-eisdir-error'Junio C Hamano Fri, 5 Dec 2014 19:42:35 +0000 (11:42 -0800)

Merge branch 'js/windows-open-eisdir-error'

* js/windows-open-eisdir-error:
Windows: correct detection of EISDIR in mingw_open()

Merge branch 'jh/empty-notes'Junio C Hamano Fri, 5 Dec 2014 19:42:28 +0000 (11:42 -0800)

Merge branch 'jh/empty-notes'

A request to store an empty note via "git notes" meant to remove
note from the object but with --allow-empty we will store a (surprise!)
note that is empty. In the longer run, we might want to deprecate
the somewhat unintuitive "emptying means deletion" behaviour.

* jh/empty-notes:
t3301: modernize style
notes: empty notes should be shown by 'git log'
builtin/notes: add --allow-empty, to allow storing empty notes
builtin/notes: split create_note() to clarify add vs. remove logic
builtin/notes: simplify early exit code in add()
builtin/notes: refactor note file path into struct note_data
builtin/notes: improve naming
t3301: verify that 'git notes' removes empty notes by default
builtin/notes: fix premature failure when trying to add the empty blob

Merge branch 'sv/get-builtin'Junio C Hamano Fri, 5 Dec 2014 19:42:26 +0000 (11:42 -0800)

Merge branch 'sv/get-builtin'

* sv/get-builtin:
builtin: move builtin retrieval to get_builtin()

Merge branch 'jk/checkout-from-tree'Junio C Hamano Fri, 5 Dec 2014 19:41:33 +0000 (11:41 -0800)

Merge branch 'jk/checkout-from-tree'

"git checkout $treeish $path", when $path in the index and the
working tree already matched what is in $treeish at the $path,
still overwrote the $path unnecessarily.

* jk/checkout-from-tree:
checkout $tree: do not throw away unchanged index entries

Merge branch 'tq/git-ssh-command'Junio C Hamano Fri, 5 Dec 2014 19:39:25 +0000 (11:39 -0800)

Merge branch 'tq/git-ssh-command'

Allow passing extra set of arguments when ssh is invoked to create
an encrypted & authenticated connection by introducing a new environment
variable GIT_SSH_COMMAND, whose contents is interpreted by shells.

This is not possible with existing GIT_SSH mechanism whose
invocation bypasses shells, which was designed more to match what
other programs with similar variables did, not necessarily to be
more useful.

* tq/git-ssh-command:
git_connect: set ssh shell command in GIT_SSH_COMMAND

Merge branch 'rs/env-array-in-child-process'Junio C Hamano Fri, 5 Dec 2014 19:39:21 +0000 (11:39 -0800)

Merge branch 'rs/env-array-in-child-process'

* rs/env-array-in-child-process:
use args member of struct child_process

Merge branch 'maint' of git://github.com/git-l10n/git... Junio C Hamano Fri, 5 Dec 2014 19:38:24 +0000 (11:38 -0800)

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

* 'maint' of git://github.com/git-l10n/git-po:
l10n: de.po: fix typos

Start post 2.2 cycleJunio C Hamano Fri, 5 Dec 2014 19:38:19 +0000 (11:38 -0800)

Start post 2.2 cycle

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

Merge branch 'master' of https://github.com/ralfth... Jiang Xin Sat, 29 Nov 2014 02:44:48 +0000 (10:44 +0800)

Merge branch 'master' of https://github.com/ralfth/git-po-de

* 'master' of https://github.com/ralfth/git-po-de:
l10n: de.po: fix typos

l10n: de.po: fix typosHartmut Henkel Sun, 23 Nov 2014 15:19:49 +0000 (16:19 +0100)

l10n: de.po: fix typos

Signed-off-by: Hartmut Henkel <hartmut_henkel@gmx.de>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

Git 2.2 v2.2.0Junio C Hamano Wed, 26 Nov 2014 21:18:34 +0000 (13:18 -0800)

Git 2.2

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

RelNotes: spelling & grammar tweaksMarc Branchaud Fri, 21 Nov 2014 23:10:04 +0000 (18:10 -0500)

RelNotes: spelling & grammar tweaks

Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.2.0-rc3 v2.2.0-rc3Junio C Hamano Fri, 21 Nov 2014 20:10:56 +0000 (12:10 -0800)

Git 2.2.0-rc3

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

l10n: remove a superfluous translation for push.cJiang Xin Thu, 20 Nov 2014 08:12:34 +0000 (16:12 +0800)

l10n: remove a superfluous translation for push.c

Ralf reported that '--recurse-submodules' option in push.c should not be
translated [1]. Before his commit is merged, remove superfluous
translations for push.c.

[1] http://www.spinics.net/lists/git/msg241964.html

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

l10n: de.po: translate 2 messagesRalf Thielow Thu, 20 Nov 2014 06:15:15 +0000 (07:15 +0100)

l10n: de.po: translate 2 messages

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

l10n: de.po: translate 2 new messagesRalf Thielow Tue, 18 Nov 2014 18:06:51 +0000 (19:06 +0100)

l10n: de.po: translate 2 new messages

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

l10n: batch updates for one trivial changeJiang Xin Thu, 20 Nov 2014 02:53:48 +0000 (10:53 +0800)

l10n: batch updates for one trivial change

In order to catch up with the release of Git 2.2.0 final, make a batch
l10n update for the new l10n change brought by commit d52adf1 (trailer:
display a trailer without its trailing newline).

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

l10n: git.pot: v2.2.0 round 2 (1 updated)Jiang Xin Thu, 20 Nov 2014 02:03:10 +0000 (10:03 +0800)

l10n: git.pot: v2.2.0 round 2 (1 updated)

Generate po/git.pot from v2.2.0-rc2-23-gca0107e for git v2.2.0 l10n
round 2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

Merge branch 'sv/submitting-final-patch'Junio C Hamano Wed, 19 Nov 2014 21:48:01 +0000 (13:48 -0800)

Merge branch 'sv/submitting-final-patch'

* sv/submitting-final-patch:
SubmittingPatches: final submission is To: maintainer and CC: list

Merge branch 'sn/tutorial-status-output-example'Junio C Hamano Wed, 19 Nov 2014 21:47:59 +0000 (13:47 -0800)

Merge branch 'sn/tutorial-status-output-example'

* sn/tutorial-status-output-example:
gittutorial: fix output of 'git status'

Merge branch 'mh/doc-remote-helper-xref'Junio C Hamano Wed, 19 Nov 2014 21:47:55 +0000 (13:47 -0800)

Merge branch 'mh/doc-remote-helper-xref'

* mh/doc-remote-helper-xref:
doc: add some crossrefs between manual pages

Merge branch 'tb/no-relative-file-url'Junio C Hamano Wed, 19 Nov 2014 21:47:53 +0000 (13:47 -0800)

Merge branch 'tb/no-relative-file-url'

* tb/no-relative-file-url:
t5705: the file:// URL should be absolute

Merge branch 'cc/interpret-trailers'Junio C Hamano Wed, 19 Nov 2014 21:47:49 +0000 (13:47 -0800)

Merge branch 'cc/interpret-trailers'

Small fixes to a new experimental command already in 'master'.

* cc/interpret-trailers:
trailer: display a trailer without its trailing newline
trailer: ignore comment lines inside the trailers

gitweb: hack around CGI's list-context param() handlingJeff King Tue, 18 Nov 2014 17:10:22 +0000 (12:10 -0500)

gitweb: hack around CGI's list-context param() handling

As of CGI.pm's 4.08 release, the behavior to call
CGI::param() in a list context is deprecated (because it can
be potentially unsafe if called inside a hash constructor).
This causes gitweb to issue a warning for some of our code,
which in turn causes the tests to fail.

Our use is in fact _not_ one of the dangerous cases, as we
are intentionally using a list context. The recommended
route by 4.08 is to use the new CGI::multi_param() call to
make it explicit that we know what we are doing.
However, that function is only available in 4.08, which is
about a month old; we cannot rely on having it.

One option would be to set $CGI::LIST_CONTEXT_WARN globally,
which turns off the warning. However, that would eliminate
the protection these newer releases are trying to provide.
We want to annotate each site as OK using the new function.

So instead, let's check whether CGI provides the
multi_param() function, and if not, provide an
implementation that just wraps param(). That will work on
both old and new versions of CGI. Sadly, we cannot just
check defined(\&CGI::multi_param), because CGI uses the
autoload feature, which claims that all functions are
defined. Instead, we just do a version check.

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

Merge git://github.com/git-l10n/git-poJunio C Hamano Tue, 18 Nov 2014 18:27:46 +0000 (10:27 -0800)

Merge git://github.com/git-l10n/git-po

* 'master' of git://github.com/git-l10n/git-po:
l10n: Update Catalan translation

Merge branch 'jc/doc-commit-only'Junio C Hamano Tue, 18 Nov 2014 18:19:38 +0000 (10:19 -0800)

Merge branch 'jc/doc-commit-only'

* jc/doc-commit-only:
Documentation/git-commit: clarify that --only/--include records the working tree contents

Merge branch 'ta/tutorial-modernize'Junio C Hamano Tue, 18 Nov 2014 18:18:28 +0000 (10:18 -0800)

Merge branch 'ta/tutorial-modernize'

* ta/tutorial-modernize:
gittutorial.txt: remove reference to ancient Git version

Merge branch 'da/difftool'Junio C Hamano Tue, 18 Nov 2014 18:16:54 +0000 (10:16 -0800)

Merge branch 'da/difftool'

Fix-up to a new feature in 'master'.

* da/difftool:
difftool: honor --trust-exit-code for builtin tools

create_default_files(): don't set u+x bit on $GIT_DIR... Michael Haggerty Tue, 18 Nov 2014 13:50:24 +0000 (14:50 +0100)

create_default_files(): don't set u+x bit on $GIT_DIR/config

Since time immemorial, the test of whether to set "core.filemode"
has been done by trying to toggle the u+x bit on $GIT_DIR/config,
which we know always exists, and then testing whether the change
"took". I find it somewhat odd to use the config file for this
test, but whatever.

The test code didn't set the u+x bit back to its original state
itself, instead relying on the subsequent call to git_config_set()
to re-write the config file with correct permissions.

But ever since

daa22c6f8d config: preserve config file permissions on edits (2014-05-06)

git_config_set() copies the permissions from the old config file to
the new one. This is a good change in and of itself, but it
invalidates the create_default_files()'s assumption, causing "git
init" to leave the executable bit set on $GIT_DIR/config.

Reset the permissions on $GIT_DIR/config when we are done with the
test in create_default_files().

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

l10n: Update Catalan translationAlex Henrie Tue, 18 Nov 2014 03:22:48 +0000 (20:22 -0700)

l10n: Update Catalan translation

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>

Merge branch 'master' of git://github.com/git-l10n... Junio C Hamano Mon, 17 Nov 2014 17:28:23 +0000 (09:28 -0800)

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

* 'master' of git://github.com/git-l10n/git-po:
l10n: de.po: translate 62 new messages
l10n: de.po: Fixup one translation
l10n: de.po: use imperative form for command options

use labs() for variables of type long instead of abs()René Scharfe Sat, 15 Nov 2014 13:27:21 +0000 (14:27 +0100)

use labs() for variables of type long instead of abs()

Using abs() on long values can cause truncation, so use labs() instead.
Reported by Clang 3.5 (-Wabsolute-value, enabled by -Wall).

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

use labs() for variables of type long instead of abs()René Scharfe Sat, 15 Nov 2014 13:27:21 +0000 (14:27 +0100)

use labs() for variables of type long instead of abs()

Using abs() on long values can cause truncation, so use labs() instead.
Reported by Clang 3.5 (-Wabsolute-value, enabled by -Wall).

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

Windows: correct detection of EISDIR in mingw_open()Johannes Sixt Sun, 16 Nov 2014 21:06:26 +0000 (22:06 +0100)

Windows: correct detection of EISDIR in mingw_open()

According to the Linux open(2) man page, open() must return EISDIR
if a directory was attempted to be opened for writing. Our emulation
in mingw_open() does not get this right: it checks only for O_CREAT.

Fix it to check for a write request.

This fixes a failure in reflog handling, which opens files with
O_APPEND|O_WRONLY, but without O_CREAT, and expects EISDIR when the
named file happens to be a directory.

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

l10n: de.po: translate 62 new messagesRalf Thielow Thu, 30 Oct 2014 08:00:47 +0000 (09:00 +0100)

l10n: de.po: translate 62 new messages

Translate 62 new messages came from git.pot update in 16742b0
(l10n: git.pot: proposed updates for v2.2.0 (+62)).

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

l10n: de.po: Fixup one translationStefan Beller Tue, 23 Sep 2014 12:54:46 +0000 (14:54 +0200)

l10n: de.po: Fixup one translation

English grammar with German words doesn't make it a German translation. ;)

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

difftool: honor --trust-exit-code for builtin toolsDavid Aguilar Fri, 14 Nov 2014 21:33:55 +0000 (13:33 -0800)

difftool: honor --trust-exit-code for builtin tools

run_merge_tool() was not setting $status, which prevented the
exit code for builtin tools from being forwarded to the caller.

Capture the exit status and add a test to guarantee the behavior.

Reported-by: Adria Farres <14farresa@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3301: modernize styleJohan Herland Wed, 12 Nov 2014 00:40:16 +0000 (01:40 +0100)

t3301: modernize style

Make this test script appear somewhat less old-fashioned:

- Use test helper functions:
- write_script
- test_commit
- test_write_lines
- test_line_count
- test_config
- test_unconfig
- test_path_is_missing

- Remove whitespace between redirection operators and their targets.

- Move preparation of "expect" files into tests.

- Rename "output" files to "actual".

- More consistent quoting, especially around commands that might
expand to nothing.

- More visibility of important whitespace with ${indent}.

- Combine pairs of tests that unnecessarily split setup and verification.

Improved-by: Eric Sunshine <sunshine@sunshineco.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Improved-by: Michael Blume <blume.mike@gmail.com>
Improved-by: Jeff King <peff@peff.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.2.0-rc2 v2.2.0-rc2Junio C Hamano Fri, 14 Nov 2014 21:31:15 +0000 (13:31 -0800)

Git 2.2.0-rc2

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

l10n: de.po: use imperative form for command optionsRalf Thielow Fri, 19 Sep 2014 16:38:13 +0000 (18:38 +0200)

l10n: de.po: use imperative form for command options

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

checkout $tree: do not throw away unchanged index entriesJeff King Thu, 13 Nov 2014 18:30:34 +0000 (13:30 -0500)

checkout $tree: do not throw away unchanged index entries

When we "git checkout $tree", we pull paths from $tree into
the index, and then check the resulting entries out to the
worktree. Our method for the first step is rather
heavy-handed, though; it clobbers the entire existing index
entry, even if the content is the same. This means we lose
our stat information, leading checkout_entry to later
rewrite the entire file with identical content.

Instead, let's see if we have the identical entry already in
the index, in which case we leave it in place. That lets
checkout_entry do the right thing. Our tests cover two
interesting cases:

1. We make sure that a file which has no changes is not
rewritten.

2. We make sure that we do update a file that is unchanged
in the index (versus $tree), but has working tree
changes. We keep the old index entry, and
checkout_entry is able to realize that our stat
information is out of date.

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

gittutorial: fix output of 'git status'Stefan Naewe Thu, 13 Nov 2014 10:40:07 +0000 (10:40 +0000)

gittutorial: fix output of 'git status'

'git status' doesn't output leading '#'s these days.

Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5705: the file:// URL should be absoluteTorsten Bögershausen Thu, 13 Nov 2014 07:36:07 +0000 (08:36 +0100)

t5705: the file:// URL should be absolute

The test misused a URL "file://." to mean "relative to here",
which we no longer accept.

In a file:// URL, typically there is no host, and RFC1738 says that
file:///<path> should be used.

Update t5705 to use a working URL.

Reported-by: Michael Blume <blume.mike@gmail.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin: move builtin retrieval to get_builtin()Slavomir Vlcek Wed, 12 Nov 2014 13:10:22 +0000 (14:10 +0100)

builtin: move builtin retrieval to get_builtin()

There was a redundant code for a builtin command retrieval in
'handle_builtin()' and 'is_builtin()'.

Introduce a new function 'get_builtin()' and using it from
both of these places to reduce the redundancy.

Signed-off-by: Slavomir Vlcek <svlc@inventati.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

SubmittingPatches: final submission is To: maintainer... Slavomir Vlcek Wed, 12 Nov 2014 23:18:39 +0000 (00:18 +0100)

SubmittingPatches: final submission is To: maintainer and CC: list

In an earlier part there is:

"re-send it with "To:" set to the maintainer [*1*] and "cc:" the list [*2*]"

for the final submission, but later we see

"Send it to the list and cc the maintainer."

Fix the later one to match the previous.

Signed-off-by: Slavomir Vlcek <svlc@inventati.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 2.2Junio C Hamano Wed, 12 Nov 2014 20:12:50 +0000 (12:12 -0800)

Update draft release notes to 2.2

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

Sync with 'maint'Junio C Hamano Wed, 12 Nov 2014 20:13:25 +0000 (12:13 -0800)

Sync with 'maint'

Merge branch 'nd/gitignore-trailing-whitespace' into... Junio C Hamano Wed, 12 Nov 2014 20:13:11 +0000 (12:13 -0800)

Merge branch 'nd/gitignore-trailing-whitespace' into maint

* nd/gitignore-trailing-whitespace:
gitignore.txt: fix spelling of "backslash"

Merge branch 'jk/fetch-reflog-df-conflict'Junio C Hamano Wed, 12 Nov 2014 19:59:58 +0000 (11:59 -0800)

Merge branch 'jk/fetch-reflog-df-conflict'

Fix-up a test for portability.

* jk/fetch-reflog-df-conflict:
t1410: fix breakage on case-insensitive filesystems

notes: empty notes should be shown by 'git log'Johan Herland Wed, 12 Nov 2014 00:40:15 +0000 (01:40 +0100)

notes: empty notes should be shown by 'git log'

If the user has gone through the trouble of explicitly adding an empty
note, then "git log" should not silently skip it (as if it didn't exist).

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/notes: add --allow-empty, to allow storing... Johan Herland Wed, 12 Nov 2014 00:40:14 +0000 (01:40 +0100)

builtin/notes: add --allow-empty, to allow storing empty notes

Although the "git notes" man page advertises that we support binary-safe
notes addition (using the -C option), we currently do not support adding
the empty note (i.e. using the empty blob to annotate an object). Instead,
an empty note is always treated as an intent to remove the note
altogether.

Introduce the --allow-empty option to the add/append/edit subcommands,
to explicitly allow an empty note to be stored into the notes tree.

Also update the documentation, and add test cases for the new option.

Reported-by: James H. Fisher <jhf@trifork.com>
Improved-by: Kyle J. McKay <mackyle@gmail.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/notes: split create_note() to clarify add vs... Johan Herland Wed, 12 Nov 2014 00:40:13 +0000 (01:40 +0100)

builtin/notes: split create_note() to clarify add vs. remove logic

create_note() has a non-trivial interface, and comprises three loosely
related parts:

1. launching the editor with the note contents, if needed
2. appending to an existing note, if append_only was given
3. adding or removing the resulting note, based on whether it's non-empty

Split it along those lines to make the logic clearer: The first part
goes into a new function - prepare_note_data(), with a simpler interface.
The second part is moved into append_edit(), which is the only user of
this code. Finally, the add vs. remove decision is moved into the callers
(add() and append_edit()), keeping the logic for writing the actual note
object in a separate function: write_note_data().

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/notes: simplify early exit code in add()Johan Herland Wed, 12 Nov 2014 00:40:12 +0000 (01:40 +0100)

builtin/notes: simplify early exit code in add()

Remove the need for 'retval' and the unnecessary goto. Also reorganize
to only call free_note_data() is actually needed.

Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: add some crossrefs between manual pagesMax Horn Tue, 11 Nov 2014 20:17:07 +0000 (21:17 +0100)

doc: add some crossrefs between manual pages

In particular, git-fast-import and -export link to each
other, and gitremote-helpers links to existing remote
helpers, and vice versa. Also link to fast-import from the
remote helper spec, as this is relevant for remote helpers
using the fast-import format.

Signed-off-by: Max Horn <max@quendi.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gittutorial.txt: remove reference to ancient Git versionThomas Ackermann Tue, 11 Nov 2014 19:13:36 +0000 (20:13 +0100)

gittutorial.txt: remove reference to ancient Git version

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

Sync with maintJunio C Hamano Tue, 11 Nov 2014 20:45:48 +0000 (12:45 -0800)

Sync with maint

* maint:

Merge branch 'rs/clean-menu-item-defn' into maintJunio C Hamano Tue, 11 Nov 2014 18:20:13 +0000 (10:20 -0800)

Merge branch 'rs/clean-menu-item-defn' into maint

* rs/clean-menu-item-defn:
clean: use f(void) instead of f() to declare a pointer to a function without arguments

run-command: use void to declare that functions take... René Scharfe Mon, 10 Nov 2014 21:17:00 +0000 (22:17 +0100)

run-command: use void to declare that functions take no parameters

Explicitly declare that git_atexit_dispatch() and git_atexit_clear()
take no parameters instead of leaving their parameter list empty and
thus unspecified.

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

builtin/notes: refactor note file path into struct... Johan Herland Sun, 9 Nov 2014 12:30:50 +0000 (13:30 +0100)

builtin/notes: refactor note file path into struct note_data

Move the 'path' variable from create_note() and into the
note_data struct. Unify cleanup of note_data objects with
a free_note_data() function.

This might not make too much sense on its own, but it makes the
future refactoring of create_note() considerably cleaner.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/notes: improve namingJohan Herland Sun, 9 Nov 2014 12:30:49 +0000 (13:30 +0100)

builtin/notes: improve naming

In preparation for some needed refactoring, rename struct msg_arg to
struct note_data, and rename its instances from "msg" to "d" (also
removing some unnecessary parentheses). The 'msg_arg' name was
inherited from tag.c, but is not really a good name for the contents
of a note.

Also rename write_note_data() to copy_obj_to_fd(), which more aptly
describes what it actually does: Copying the contents of a git object
(given by its SHA1) into a given file descriptor.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3301: verify that 'git notes' removes empty notes... Johan Herland Sun, 9 Nov 2014 12:30:48 +0000 (13:30 +0100)

t3301: verify that 'git notes' removes empty notes by default

Add test cases documenting the current behavior when trying to
add/append/edit empty notes. This is in preparation for adding
--allow-empty; to allow empty notes to be stored.

Improved-by: Eric Sunshine <sunshine@sunshineco.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/notes: fix premature failure when trying to... Johan Herland Sun, 9 Nov 2014 12:30:47 +0000 (13:30 +0100)

builtin/notes: fix premature failure when trying to add the empty blob

This fixes a small buglet when trying to explicitly add the empty blob
as a note object using the -c or -C option to git notes add/append.
Instead of failing with a nonsensical error message indicating that the
empty blob does not exist, we should rather behave as if an empty notes
message was given (e.g. using -m "" or -F /dev/null).

The next patch contains a test that verifies the fixed behavior.

Found-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'master' of git://github.com/git-l10n... Junio C Hamano Mon, 10 Nov 2014 19:59:30 +0000 (11:59 -0800)

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

* 'master' of git://github.com/git-l10n/git-po:
l10n: Updated Bulgarian translation of git (2296t,0f,0u)
l10n: zh_CN: translations for git v2.2.0-rc0
l10n: sv.po: Update Swedish translation (2296t0f0u)
l10n: fr.po (2296t) update for version 2.2.0
l10n: vi.po: Update new message strings
l10n: git.pot: v2.2.0 round 1 (62 new, 23 removed)

Sync with maintJunio C Hamano Mon, 10 Nov 2014 19:26:18 +0000 (11:26 -0800)

Sync with maint

* maint:
Documentation/config.txt: fix minor typo
config.txt: fix typo

Merge branch 'js/diff-highlight-avoid-sigpipe'Junio C Hamano Mon, 10 Nov 2014 19:26:09 +0000 (11:26 -0800)

Merge branch 'js/diff-highlight-avoid-sigpipe'

* js/diff-highlight-avoid-sigpipe:
diff-highlight: exit when a pipe is broken

Documentation/config.txt: fix minor typoThomas Quinot Sat, 8 Nov 2014 10:45:39 +0000 (11:45 +0100)

Documentation/config.txt: fix minor typo

Add a missing article at the beginning of a sentence, and rephrase
slightly.

Signed-off-by: Thomas Quinot <thomas@quinot.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.txt: fix typoNicolas Dermine Sun, 9 Nov 2014 16:19:33 +0000 (17:19 +0100)

config.txt: fix typo

Signed-off-by: Nicolas Dermine <nicolas.dermine@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

use args member of struct child_processRené Scharfe Sun, 9 Nov 2014 13:49:54 +0000 (14:49 +0100)

use args member of struct child_process

Convert users of struct child_process to using the managed argv_array
args instead of providing their own. This shortens the code a bit and
ensures that the allocated memory is released automatically after use.

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

trailer: use CHILD_PROCESS_INIT in apply_command()René Scharfe Sun, 9 Nov 2014 13:49:58 +0000 (14:49 +0100)

trailer: use CHILD_PROCESS_INIT in apply_command()

Initialize the struct child_process variable cp at declaration time.
This is shorter, saves a function call and prevents using the variable
before initialization by mistake.

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

trailer: display a trailer without its trailing newlineChristian Couder Sun, 9 Nov 2014 09:23:40 +0000 (10:23 +0100)

trailer: display a trailer without its trailing newline

Trailers passed to the parse_trailer() function often have
a trailing newline. When erroring out, we should display
the invalid trailer properly, that means without any
trailing newline.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trailer: ignore comment lines inside the trailersChristian Couder Sun, 9 Nov 2014 09:23:39 +0000 (10:23 +0100)

trailer: ignore comment lines inside the trailers

Otherwise trailers that are commented out might be
processed. We would also error out if the comment line
char is also a separator.

This means that comments inside a trailer block will
disappear, but that was already the case anyway.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1410: fix breakage on case-insensitive filesystemsJeff King Sun, 9 Nov 2014 01:59:18 +0000 (20:59 -0500)

t1410: fix breakage on case-insensitive filesystems

Two tests recently added to t1410 create branches "a" and
"a/b" to test d/f conflicts on reflogs. Earlier, unrelated
tests in that script create the path "A/B" in the working
tree. There's no conflict on a case-sensitive filesystem,
but on a case-insensitive one, "git log" will complain that
"a/b" is both a revision and a working tree path.

We could fix this by using a "--" to disambiguate, but we
are probably better off using names that are less confusing
to make it more clear that they are unrelated to the working
tree files. This patch turns "a/b" into "one/two".

Reported-by: Michael Blume <blume.mike@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git_connect: set ssh shell command in GIT_SSH_COMMANDThomas Quinot Sun, 9 Nov 2014 22:42:32 +0000 (23:42 +0100)

git_connect: set ssh shell command in GIT_SSH_COMMAND

It may be impractical to install a wrapper script for GIT_SSH
when additional parameters need to be passed. Provide an alternative
way of specifying a shell command to be run, including command line
arguments, by means of the GIT_SSH_COMMAND environment variable,
which behaves like GIT_SSH but is passed to the shell.

The special circuitry to modify parameters in the case of using
PuTTY's plink/tortoiseplink is activated only when using GIT_SSH;
in the case of using GIT_SSH_COMMAND, it is deliberately left up to
the user to make any required parameters adaptation before calling
the underlying ssh implementation.

Signed-off-by: Thomas Quinot <thomas@quinot.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.2.0-rc1 v2.2.0-rc1Junio C Hamano Fri, 7 Nov 2014 20:01:01 +0000 (12:01 -0800)

Git 2.2.0-rc1

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

Documentation/git-commit: clarify that --only/--include... Junio C Hamano Fri, 7 Nov 2014 19:55:40 +0000 (11:55 -0800)

Documentation/git-commit: clarify that --only/--include records the working tree contents

With the original phrasing, it is possible to misunderstand as if
the contents in the index for only the specified paths are made into
the new commit.

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

Merge branch 'maint'Junio C Hamano Thu, 6 Nov 2014 18:52:51 +0000 (10:52 -0800)

Merge branch 'maint'

* maint:
docs/credential-store: s/--store/--file/

Merge branch 'nd/gitignore-trailing-whitespace'Junio C Hamano Thu, 6 Nov 2014 18:52:40 +0000 (10:52 -0800)

Merge branch 'nd/gitignore-trailing-whitespace'

Documentation update.

* nd/gitignore-trailing-whitespace:
gitignore.txt: fix spelling of "backslash"

Merge branch 'tm/line-log-first-parent'Junio C Hamano Thu, 6 Nov 2014 18:52:36 +0000 (10:52 -0800)

Merge branch 'tm/line-log-first-parent'

"git log --first-parent -L..." used to crash.

* tm/line-log-first-parent:
line-log: fix crash when --first-parent is used

Merge branch 'jk/fetch-reflog-df-conflict'Junio C Hamano Thu, 6 Nov 2014 18:52:31 +0000 (10:52 -0800)

Merge branch 'jk/fetch-reflog-df-conflict'

Corner-case bugfixes for "git fetch" around reflog handling.

* jk/fetch-reflog-df-conflict:
ignore stale directories when checking reflog existence
fetch: load all default config at startup

Merge branch 'rs/use-child-process-init-more'Junio C Hamano Thu, 6 Nov 2014 18:52:23 +0000 (10:52 -0800)

Merge branch 'rs/use-child-process-init-more'

* rs/use-child-process-init-more:
bundle: split out ref writing from bundle_create
bundle: split out a helper function to compute and write prerequisites
bundle: split out a helper function to create pack data
use child_process_init() to initialize struct child_process variables

Merge branch 'jk/cache-tree-protect-from-broken-libgit2'Junio C Hamano Thu, 6 Nov 2014 18:51:35 +0000 (10:51 -0800)

Merge branch 'jk/cache-tree-protect-from-broken-libgit2'

The code to use cache-tree trusted the on-disk data too much
and fell into an infinite loop.

* jk/cache-tree-protect-from-broken-libgit2:
cache-tree: avoid infinite loop on zero-entry tree

docs/credential-store: s/--store/--file/Jeff King Thu, 6 Nov 2014 07:40:32 +0000 (02:40 -0500)

docs/credential-store: s/--store/--file/

The option name "--store" was used early in development, but
never even made it into an applied patch, let alone a
released version of git. I forgot to update the matching
documentation at the time, though.

Noticed-by: Jesse Hopkins <jesse.hopkins@lmco.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitignore.txt: fix spelling of "backslash"Ben North Tue, 4 Nov 2014 22:18:33 +0000 (22:18 +0000)

gitignore.txt: fix spelling of "backslash"

Signed-off-by: Ben North <ben@redfrontdoor.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-highlight: exit when a pipe is brokenJohn Szakmeister Tue, 4 Nov 2014 20:01:12 +0000 (15:01 -0500)

diff-highlight: exit when a pipe is broken

While using diff-highlight with other tools, I have discovered that Python
ignores SIGPIPE by default. Unfortunately, this also means that tools
attempting to launch a pager under Python--and don't realize this is
happening--means that the subprocess inherits this setting. In this case, it
means diff-highlight will be launched with SIGPIPE being ignored. Let's work
with those broken scripts by restoring the default SIGPIPE handler.

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

Documentation: typofixesThomas Ackermann Mon, 3 Nov 2014 20:37:07 +0000 (21:37 +0100)

Documentation: typofixes

In addition to fixing trivial and obvious typos, be careful about
the following points:

- Spell ASCII, URL and CRC in ALL CAPS;
- Spell Linux as Capitalized;
- Do not omit periods in "i.e." and "e.g.".

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

line-log: fix crash when --first-parent is usedTzvetan Mikov Tue, 4 Nov 2014 20:33:37 +0000 (12:33 -0800)

line-log: fix crash when --first-parent is used

line-log tries to access all parents of a commit, but only the first
parent has been loaded if "--first-parent" is specified, resulting
in a crash.

Limit the number of parents to one if "--first-parent" is specified.

Reported-by: Eric N. Vander Weele <ericvw@gmail.com>
Signed-off-by: Tzvetan Mikov <tmikov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ignore stale directories when checking reflog existenceJeff King Tue, 4 Nov 2014 13:24:53 +0000 (08:24 -0500)

ignore stale directories when checking reflog existence

When we update a ref, we have two rules for whether or not
we actually update the reflog:

1. If the reflog already exists, we will always append to
it.

2. If log_all_ref_updates is set, we will create a new
reflog file if necessary.

We do the existence check by trying to open the reflog file,
either with or without O_CREAT (depending on log_all_ref_updates).
If it fails, then we check errno to see what happened.

If we were not using O_CREAT and we got ENOENT, the file
doesn't exist, and we return success (there isn't a reflog
already, and we were not told to make a new one).

If we get EISDIR, then there is likely a stale directory
that needs to be removed (e.g., there used to be "foo/bar",
it was deleted, and the directory "foo" was left. Now we
want to create the ref "foo"). If O_CREAT is set, then we
catch this case, try to remove the directory, and retry our
open. So far so good.

But if we get EISDIR and O_CREAT is not set, then we treat
this as any other error, which is not right. Like ENOENT,
EISDIR is an indication that we do not have a reflog, and we
should silently return success (we were not told to create
it). Instead, the current code reports this as an error, and
we fail to update the ref at all.

Note that this is relatively unlikely to happen, as you
would have to have had reflogs turned on, and then later
turned them off (it could also happen due to a bug in fetch,
but that was fixed in the previous commit). However, it's
quite easy to fix: we just need to treat EISDIR like ENOENT
for the non-O_CREAT case, and silently return (note that
this early return means we can also simplify the O_CREAT
case).

Our new tests cover both cases (O_CREAT and non-O_CREAT).
The first one already worked, of course.

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

fetch: load all default config at startupJeff King Tue, 4 Nov 2014 13:11:19 +0000 (08:11 -0500)

fetch: load all default config at startup

When we start the git-fetch program, we call git_config to
load all config, but our callback only processes the
fetch.prune option; we do not chain to git_default_config at
all.

This means that we may not load some core configuration
which will have an effect. For instance, we do not load
core.logAllRefUpdates, which impacts whether or not we
create reflogs in a bare repository.

Note that I said "may" above. It gets even more exciting. If
we have to transfer actual objects as part of the fetch,
then we call fetch_pack as part of the same process. That
function loads its own config, which does chain to
git_default_config, impacting global variables which are
used by the rest of fetch. But if the fetch is a pure ref
update (e.g., a new ref which is a copy of an old one), we
skip fetch_pack entirely. So we get inconsistent results
depending on whether or not we have actual objects to
transfer or not!

Let's just load the core config at the start of fetch, so we
know we have it (we may also load it again as part of
fetch_pack, but that's OK; it's designed to be idempotent).

Our tests check both cases (with and without a pack). We
also check similar behavior for push for good measure, but
it already works as expected.

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

RelNotes/2.2.0.txt: fix minor typosMatthieu Moy Mon, 3 Nov 2014 15:12:00 +0000 (16:12 +0100)

RelNotes/2.2.0.txt: fix minor typos

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: Updated Bulgarian translation of git (2296t,0f,0u)Alexander Shopov Fri, 17 Oct 2014 19:39:45 +0000 (22:39 +0300)

l10n: Updated Bulgarian translation of git (2296t,0f,0u)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>

l10n: zh_CN: translations for git v2.2.0-rc0Jiang Xin Wed, 8 Oct 2014 02:55:14 +0000 (10:55 +0800)

l10n: zh_CN: translations for git v2.2.0-rc0

Translate 62 new messages (2296t0f0u) for git v2.2.0-rc0. Also changed
the translation of bare (repository).

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

Merge branch 'fr_2.2.0' of git://github.com/jnavila/gitJiang Xin Sun, 2 Nov 2014 02:12:29 +0000 (10:12 +0800)

Merge branch 'fr_2.2.0' of git://github.com/jnavila/git

* 'fr_2.2.0' of git://github.com/jnavila/git:
l10n: fr.po (2296t) update for version 2.2.0

Merge branch 'master' of git://github.com/nafmo/git... Jiang Xin Sun, 2 Nov 2014 02:11:27 +0000 (10:11 +0800)

Merge branch 'master' of git://github.com/nafmo/git-l10n-sv

* 'master' of git://github.com/nafmo/git-l10n-sv:
l10n: sv.po: Update Swedish translation (2296t0f0u)

l10n: sv.po: Update Swedish translation (2296t0f0u)Peter Krefting Sat, 1 Nov 2014 19:17:37 +0000 (20:17 +0100)

l10n: sv.po: Update Swedish translation (2296t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>