gitweb.git
Merge branch 'dn/gpg-doc'Junio C Hamano Mon, 27 Jun 2016 16:56:45 +0000 (09:56 -0700)

Merge branch 'dn/gpg-doc'

The documentation tries to consistently spell "GPG"; when
referring to the specific program name, "gpg" is used.

* dn/gpg-doc:
Documentation: GPG capitalization

Merge branch 'jk/fetch-prune-doc'Junio C Hamano Mon, 27 Jun 2016 16:56:44 +0000 (09:56 -0700)

Merge branch 'jk/fetch-prune-doc'

* jk/fetch-prune-doc:
fetch: document that pruning happens before fetching

Merge branch 'ap/git-svn-propset-doc'Junio C Hamano Mon, 27 Jun 2016 16:56:43 +0000 (09:56 -0700)

Merge branch 'ap/git-svn-propset-doc'

"git svn propset" subcommand that was added in 2.3 days is
documented now.

* ap/git-svn-propset-doc:
git-svn: document the 'git svn propset' command

Merge branch 'tr/doc-tt'Junio C Hamano Mon, 27 Jun 2016 16:56:42 +0000 (09:56 -0700)

Merge branch 'tr/doc-tt'

The documentation set has been updated so that literal commands,
configuration variables and environment variables are consistently
typeset in fixed-width font and bold in manpages.

* tr/doc-tt:
doc: change configuration variables format
doc: more consistency in environment variables format
doc: change environment variables format
doc: clearer rule about formatting literals

Merge branch 'pc/occurred'Junio C Hamano Mon, 27 Jun 2016 16:56:42 +0000 (09:56 -0700)

Merge branch 'pc/occurred'

* pc/occurred:
config.c: fix misspelt "occurred" in an error message
refs.h: fix misspelt "occurred" in a comment

Merge branch 'cc/apply-introduce-state'Junio C Hamano Mon, 27 Jun 2016 16:56:42 +0000 (09:56 -0700)

Merge branch 'cc/apply-introduce-state'

The "git apply" standalone program is being libified; this is the
first step to move many state variables into a structure that can
be explicitly (re)initialized to make the machinery callable more
than once.

The next step that moves some remaining state variables into the
structure and turns die()s into an error return that propagates up
to the caller is not queued yet but in flight. It would be good to
review the above first and give the remainder of the series a solid
base to build on.

* cc/apply-introduce-state: (50 commits)
builtin/apply: remove misleading comment on lock_file field
builtin/apply: move 'newfd' global into 'struct apply_state'
builtin/apply: add 'lock_file' pointer into 'struct apply_state'
builtin/apply: move applying patches into apply_all_patches()
builtin/apply: move 'state' check into check_apply_state()
builtin/apply: move 'symlink_changes' global into 'struct apply_state'
builtin/apply: move 'fn_table' global into 'struct apply_state'
builtin/apply: move 'state_linenr' global into 'struct apply_state'
builtin/apply: move 'max_change' and 'max_len' into 'struct apply_state'
builtin/apply: move 'ws_ignore_action' into 'struct apply_state'
builtin/apply: move 'ws_error_action' into 'struct apply_state'
builtin/apply: move 'applied_after_fixing_ws' into 'struct apply_state'
builtin/apply: move 'squelch_whitespace_errors' into 'struct apply_state'
builtin/apply: remove whitespace_option arg from set_default_whitespace_mode()
builtin/apply: move 'whitespace_option' into 'struct apply_state'
builtin/apply: move 'whitespace_error' global into 'struct apply_state'
builtin/apply: move 'root' global into 'struct apply_state'
builtin/apply: move 'p_value_known' global into 'struct apply_state'
builtin/apply: move 'p_value' global into 'struct apply_state'
builtin/apply: move 'has_include' global into 'struct apply_state'
...

Merge branch 'rs/xdiff-hunk-with-func-line' into maintJunio C Hamano Mon, 27 Jun 2016 16:56:24 +0000 (09:56 -0700)

Merge branch 'rs/xdiff-hunk-with-func-line' into maint

"git show -W" (extend hunks to cover the entire function, delimited
by lines that match the "funcname" pattern) used to show the entire
file when a change added an entire function at the end of the file,
which has been fixed.

* rs/xdiff-hunk-with-func-line:
xdiff: fix merging of appended hunk with -W
grep: -W: don't extend context to trailing empty lines
t7810: add test for grep -W and trailing empty context lines
xdiff: don't trim common tail with -W
xdiff: -W: don't include common trailing empty lines in context
xdiff: ignore empty lines before added functions with -W
xdiff: handle appended chunks better with -W
xdiff: factor out match_func_rec()
t4051: rewrite, add more tests

Merge branch 'jk/rev-list-count-with-bitmap' into maintJunio C Hamano Mon, 27 Jun 2016 16:56:24 +0000 (09:56 -0700)

Merge branch 'jk/rev-list-count-with-bitmap' into maint

"git rev-list --count" whose walk-length is limited with "-n"
option did not work well with the counting optimized to look at the
bitmap index.

* jk/rev-list-count-with-bitmap:
rev-list: disable bitmaps when "-n" is used with listing objects
rev-list: "adjust" results of "--count --use-bitmap-index -n"

Merge branch 'et/pretty-format-c-auto' into maintJunio C Hamano Mon, 27 Jun 2016 16:56:23 +0000 (09:56 -0700)

Merge branch 'et/pretty-format-c-auto' into maint

The commands in `git log` family take %C(auto) in a custom format
string. This unconditionally turned the color on, ignoring
--no-color or with --color=auto when the output is not connected to
a tty; this was corrected to make the format truly behave as
"auto".

* et/pretty-format-c-auto:
format_commit_message: honor `color=auto` for `%C(auto)`

Merge branch 'ew/daemon-socket-keepalive' into maintJunio C Hamano Mon, 27 Jun 2016 16:56:22 +0000 (09:56 -0700)

Merge branch 'ew/daemon-socket-keepalive' into maint

When "git daemon" is run without --[init-]timeout specified, a
connection from a client that silently goes offline can hang around
for a long time, wasting resources. The socket-level KEEPALIVE has
been enabled to allow the OS to notice such failed connections.

* ew/daemon-socket-keepalive:
daemon: enable SO_KEEPALIVE for all sockets

unpack-trees: fix English grammar in do-this-before... Alex Henrie Sat, 25 Jun 2016 06:34:04 +0000 (00:34 -0600)

unpack-trees: fix English grammar in do-this-before-that messages

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gc: fix off-by-one error with gc.autoPackLimitEric Wong Sat, 25 Jun 2016 06:46:47 +0000 (06:46 +0000)

gc: fix off-by-one error with gc.autoPackLimit

This matches the documentation and allows gc.autoPackLimit=1
to maintain a single pack without attempting a repack on every
"git gc --auto" invocation.

Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

log: add log.showSignature configuration variableMehul Jain Wed, 22 Jun 2016 16:51:26 +0000 (22:21 +0530)

log: add log.showSignature configuration variable

Users may want to always use "--show-signature" while using git-log and
related commands.

When log.showSignature is set to true, git-log and related commands will
behave as if "--show-signature" was given to them.

Note that this config variable is meant to affect git-log, git-show,
git-whatchanged and git-reflog. Other commands like git-format-patch,
git-rev-list are not to be affected by this config variable.

Signed-off-by: Mehul Jain <mehul.jain2029@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

log: add "--no-show-signature" command line optionMehul Jain Wed, 22 Jun 2016 16:51:25 +0000 (22:21 +0530)

log: add "--no-show-signature" command line option

If an user creates an alias with "--show-signature" early in command
line, e.g.
[alias] logss = log --show-signature

then there is no way to countermand it through command line.

Teach git-log and related commands about "--no-show-signature" command
line option. This will make "git logss --no-show-signature" run
without showing GPG signature.

Signed-off-by: Mehul Jain <mehul.jain2029@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4202: refactor testMehul Jain Fri, 24 Jun 2016 14:12:34 +0000 (19:42 +0530)

t4202: refactor test

Subsequent patches will want to reuse the 'signed' branch that the
'log --graph --show-signature' test creates and uses.

Split the set-up part into a test of its own, and make the existing
test into a separate one that only inspects the history on the 'signed'
branch. This way, it becomes clearer that tests added by subsequent
patches reuse the 'signed' branch in the same way.

Signed-off-by: Mehul Jain <mehul.jain2029@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

color: support strike-through attributeJeff King Thu, 23 Jun 2016 17:40:16 +0000 (13:40 -0400)

color: support strike-through attribute

This is the only remaining attribute that is commonly
supported (at least by xterm) that we don't support. Let's
add it for completeness.

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

color: support "italic" attributeJeff King Thu, 23 Jun 2016 17:39:07 +0000 (13:39 -0400)

color: support "italic" attribute

We already support bold, underline, and similar attributes.
Let's add italic to the mix. According to the Wikipedia
page on ANSI colors, this attribute is "not widely
supported", but it does seem to work on my xterm.

We don't have to bump the maximum color size because we were
already over-allocating it (but we do adjust the comment
appropriately).

Requested-by: Simon Courtois <scourtois@cubyx.fr>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

color: allow "no-" for negating attributesJeff King Thu, 23 Jun 2016 17:38:44 +0000 (13:38 -0400)

color: allow "no-" for negating attributes

Using "no-bold" rather than "nobold" is easier to read and
more natural to type (to me, anyway, even though I was the
person who introduced "nobold" in the first place). It's
easy to allow both.

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

color: refactor parse_attrJeff King Thu, 23 Jun 2016 17:38:13 +0000 (13:38 -0400)

color: refactor parse_attr

The list of attributes we recognize is a bit unwieldy, as we
actually have two arrays that must be kept in sync. Instead,
let's have a single array-of-struct to represent our
mapping. That means we can never have an accident that
causes us to read off the end of an array, and it makes
diffs for adding new attributes much easier to read.

This also makes it easy to handle the "no" cases without
having to repeat each attribute (this shortens the list,
making it easier to read, but also also cuts the size of our
linear search in half). Technically this makes it impossible
for us to add an attribute that starts with "no" (we could
confuse "nobody" for the negation of "body"), but since this
is a constrained set of attributes, that's OK.

Since we can also store the length of each name in the
struct, that makes it easy for us to avoid reading past the
"len" parameter given to us (though in practice it was not a
bug, since all of our current callers are interested in a
subset of a NUL-terminated buffer, not a true undelimited
range of memory).

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

add skip_prefix_mem helperJeff King Thu, 23 Jun 2016 17:33:57 +0000 (13:33 -0400)

add skip_prefix_mem helper

The skip_prefix function has been very useful for
simplifying pointer arithmetic and avoiding repeated magic
numbers, but we have no equivalent for length-limited
buffers. So we're stuck with:

if (3 <= len && skip_prefix(buf, "foo", &buf))
len -= 3;

That's not that complicated, but it needs to use magic
numbers for the length of the prefix (or else write out
strlen("foo"), repeating the string). By using a helper, we
can get the string length behind the scenes (and often at
compile time for string literals).

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

doc: refactor description of color formatJeff King Thu, 23 Jun 2016 17:32:30 +0000 (13:32 -0400)

doc: refactor description of color format

This is a general cleanup of the description of colors in
git-config, mostly to address inaccuracies and confusion
that had grown over time:

- you can have many attributes, not just one

- the discussion flip-flopped between colors and
attributes; now we discuss everything about colors, then
everything about attributes

- many concepts were lumped into the first paragraph,
making it hard to read, and especially to find the
actual lists of colors and attributes. I stopped short
of breaking those out into their own lists, as it seemed
like an excessive use of vertical screen real estate.

- we introduced negated attributes, but then the next
paragraph basically explains how each item starts off
with no attributes. So why would one need negated
attributes? We now explain.

- minor typo, language, and typography fixes

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

color: fix max-size commentJeff King Thu, 23 Jun 2016 17:31:44 +0000 (13:31 -0400)

color: fix max-size comment

We use fixed-size buffers for colors, because we know our
parsing cannot grow beyond a particular bound. However, our
comment description has two issues:

1. It has the description in two forms: a short one, and
one with more explanation. Over time the latter has
been updated, but the former has not. Let's just drop
the short one (after making sure everything it says
is in the long one).

2. As of ff40d18 (parse_color: recognize "no$foo" to clear
the $foo attribute, 2014-11-20), the per-attribute size
bumped to "3" (because "nobold" is actually "21;"). But
that's not quite enough, as somebody may use both
"bold" and "nobold", requiring 5 characters.

This wasn't a problem for the final count, because we
over-estimated in other ways, but let's clarify how we
got to the final number.

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

git-svn: skip mergeinfo handling with --no-follow-parentEric Wong Mon, 20 Jun 2016 21:52:53 +0000 (21:52 +0000)

git-svn: skip mergeinfo handling with --no-follow-parent

For repositories without parent following enabled, finding
git parents through svn:mergeinfo or svk::parents can be
expensive and pointless.

Reported-by: Александр Овчинников <proff@proff.email>
http://mid.gmane.org/4094761466408188@web24o.yandex.ru

Signed-off-by: Eric Wong <e@80x24.org>

t2300: "git --exec-path" is not usable in $PATH on... Johannes Schindelin Sat, 18 Jun 2016 10:49:11 +0000 (12:49 +0200)

t2300: "git --exec-path" is not usable in $PATH on Windows as-is

The "git" command prepends the exec-path to the PATH environment
variable for processes it spawns. That is how ". git-sh-setup" in
our scripted Porcelains can find the dot-sourced file in the
exec-path location that is not usually on user's PATH.

When t2300 runs, because it is not spawned by the "git" command, the
scriptlet being tested did not run with a realistic setting of PATH
environment. It lacked the exec-path on the PATH, and failed to
find the dot-sourced file. A recent update to t2300 attempted to
fix this, with "PATH=$(git --exec-path):$PATH", which has been the
recommended way around v1.6.0 days (a script whose original was
written before that release that survives to this day is likely to
have such a line).

However, the "git --exec-path" command outputs C:\path\to\exec\dir
(not /c/path/to/exec/dir) on Windows; the recent update failed to
consider the problem that comes from it.

Even though Git itself, when doing the equivalent internally, does
so in a platform native way (i.e. on Windows, C:\path\to\exec\dir is
prepended to the existing value of %PATH% using ';' as a component
separator), the result is further massaged by bash and gets turned
into $PATH that uses /c/path/to/exec/dir with ':' separating the
components, which is the form understood by bash, so scripted
Porcelains find commands from PATH correctly.

An end user script written in shell, however, cannot prepend
"C:\path\to\exec\dir:" to the existing value of $PATH and expect
bash to magically turn it into the form it understands. In other
words, "PATH=$(git --exec-path):$PATH" does not work as an emulation
of what "Git" internally does to the PATH on Windows.

To correctly emulate how exec-path is prepended to the PATH
environment internally on Windows, we'd need to convert
C:\git-sdk-64\usr\src\git to at least /c\git-sdk-64\usr\src\git
ourselves before prepending it to PATH.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

p4211: explicitly disable renames in no-rename testJeff King Wed, 22 Jun 2016 19:40:51 +0000 (15:40 -0400)

p4211: explicitly disable renames in no-rename test

p4211 tests line-log performance both with and without "-M".
In v2.9.0, the case without "-M" appears to have regressed
badly, but that is only because we flipped on renames by
default.

Let's have the test explicitly disable renames to get
consistent timings (and to match the presumed intent of the
test, which is to see the effects with and without renames).

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

t/perf: fix regression in testing older versions of gitJeff King Wed, 22 Jun 2016 19:40:13 +0000 (15:40 -0400)

t/perf: fix regression in testing older versions of git

Commit 7501b59 (perf: make the tests work in worktrees,
2016-05-13) introduced the use of "git rev-parse --git-path"
in the perf-lib setup code. Because the to-be-tested version
of git is at the front of the $PATH when this code runs,
this means we cannot use modern versions of t/perf to test
versions of git older than v2.5.0 (when that option was
introduced).

This is a symptom of a more general problem. The t/perf
suite is essentially independent of git versions, and
ideally we would be able to run the most modern and complete
set of tests across many historical versions (to see how
they compare). But any setup code they run is therefore
required to use the lowest common denominator we expect to
test.

So let's introduce a new variable, $MODERN_GIT, that we can
use both in perf-lib and in the test setup to get a reliable
set of git features (we might change git and break some
tests, of course, but $MODERN_GIT is tied to the same
version of git as the t/perf scripts, so they can be fixed
or adjusted together).

This commit fixes the "--git-path" case, but does not
mass-convert existing setup code to use $MODERN_GIT. Most
setup code is fairly vanilla and will work with effectively
all versions. But now the tool is there to fix any other
issues we find going forward.

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

commit.c: make find_commit_subject() more robustJohannes Schindelin Wed, 22 Jun 2016 20:20:20 +0000 (22:20 +0200)

commit.c: make find_commit_subject() more robust

Just like the pretty printing machinery, we should simply ignore
blank lines at the beginning of the commit messages.

This discrepancy was noticed when an early version of the
rebase--helper produced commit objects with more than one empty line
between the header and the commit message.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pretty: make the skip_blank_lines() function publicJohannes Schindelin Wed, 22 Jun 2016 20:20:16 +0000 (22:20 +0200)

pretty: make the skip_blank_lines() function public

This function will be used also in the find_commit_subject()
function.

While at it, rename the function to reflect that it skips not only
empty lines, but any lines consisting of only whitespace, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: git-htmldocs.googlecode.com is no moreJonathan Nieder Wed, 22 Jun 2016 17:38:25 +0000 (10:38 -0700)

doc: git-htmldocs.googlecode.com is no more

http://git-htmldocs.googlecode.com/git/git.html says

There was no service found for the uri requested.

Link to the rendered documentation on Jekyll instead.

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

git-p4: correct hasBranchPrefix verbose outputAndrew Oakley Wed, 22 Jun 2016 09:26:11 +0000 (10:26 +0100)

git-p4: correct hasBranchPrefix verbose output

The logic here was inverted, you got a message saying the file is
ignored for each file that is not ignored.

Signed-off-by: Andrew Oakley <aoakley@roku.com>
Acked-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7810: fix duplicated test titleCharles Bailey Tue, 21 Jun 2016 21:14:11 +0000 (14:14 -0700)

t7810: fix duplicated test title

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5614: don't use subshellsStefan Beller Mon, 20 Jun 2016 17:21:18 +0000 (10:21 -0700)

t5614: don't use subshells

Using a subshell for just one git command is both a waste in compute
overhead (create a new process) as well as in line count.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7800: readlink may not be availableArmin Kunaschik Tue, 31 May 2016 00:26:12 +0000 (02:26 +0200)

t7800: readlink may not be available

The readlink(1) command is not available on all platforms (notably
not on AIX and HP-UX) and can be replaced in this test with the
"workaround"

ls -ld <name> | sed -e 's/.* -> //'

This is no universal readlink replacement but works in the
controlled test environment well enough.

Signed-off-by: Armin Kunaschik <megabreit@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

perf: accommodate for MacOSXJohannes Schindelin Tue, 21 Jun 2016 13:53:43 +0000 (15:53 +0200)

perf: accommodate for MacOSX

As this developer has no access to MacOSX developer setups anymore,
Travis becomes the best bet to run performance tests on that OS.

However, on MacOSX /usr/bin/time is that good old BSD executable that
no Linux user cares about, as demonstrated by the perf-lib.sh's use
of GNU-ish extensions. And by the hard-coded path.

Let's just work around this issue by using gtime on MacOSX, the
Homebrew-provided GNU implementation onto which pretty much every
MacOSX power user falls back anyway.

To help other developers use Travis to run performance tests on
MacOSX, the .travis.yml file now sports a commented-out line that
installs GNU time via Homebrew.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

local_tzoffset: detect errors from tm_to_time_tJeff King Mon, 20 Jun 2016 21:14:14 +0000 (17:14 -0400)

local_tzoffset: detect errors from tm_to_time_t

When we want to know the local timezone offset at a given
timestamp, we compute it by asking for localtime() at the
given time, and comparing the offset to GMT at that time.
However, there's some juggling between time_t and "struct
tm" which happens, which involves calling our own
tm_to_time_t().

If that function returns an error (e.g., because it only
handles dates up to the year 2099), it returns "-1", which
we treat as a time_t, and is clearly bogus, leading to
bizarre timestamps (that seem to always adjust the time back
to (time_t)(uint32_t)-1, in the year 2106).

It's not a good idea for local_tzoffset() to simply die
here; it would make it hard to run "git log" on a repository
with funny timestamps. Instead, let's just treat such cases
as "zero offset".

Reported-by: Norbert Kiesel <nkiesel@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0006: test various date formatsJeff King Mon, 20 Jun 2016 21:11:59 +0000 (17:11 -0400)

t0006: test various date formats

We ended up testing some of these date formats throughout
the rest of the suite (e.g., via for-each-ref's
"$(authordate:...)" format), but we never did so
systematically. t0006 is the right place for unit-testing of
our date-handling code.

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

t0006: rename test-date's "show" to "relative"Jeff King Mon, 20 Jun 2016 21:10:29 +0000 (17:10 -0400)

t0006: rename test-date's "show" to "relative"

The "show" tests are really only checking relative formats;
we should make that more clear.

This also frees up the "show" name to later check other
formats. We could later fold "relative" into a more generic
"show" command, but it's not worth it. Relative times are a
special case already because we have to munge the concept of
"now" in our tests.

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

mingw: let the build succeed with DEVELOPER=1Johannes Schindelin Sat, 18 Jun 2016 12:38:36 +0000 (14:38 +0200)

mingw: let the build succeed with DEVELOPER=1

The recently introduced developer flags identified a couple of
old-style function declarations in the Windows-specific code where
the parameter list was left empty instead of specifying "void"
explicitly. Let's just fix them.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clone: do not let --depth imply --shallow-submodulesJunio C Hamano Sun, 19 Jun 2016 20:51:56 +0000 (13:51 -0700)

clone: do not let --depth imply --shallow-submodules

In v2.9.0, we prematurely flipped the default to force cloning
submodules shallowly, when the superproject is getting cloned
shallowly. This is likely to fail when the upstream repositories
submodules are cloned from a repository that is not prepared to
serve histories that ends at a commit that is not at the tip of a
branch, and we know the world is not yet ready.

Use a safer default to clone the submodules fully, unless the user
tells us that she knows that the upstream repository of the
submodules are willing to cooperate with "--shallow-submodules"
option.

Noticed-by: Vadim Eisenberg <VADIME@il.ibm.com>
Helped-by: Jeff King <peff@peff.net>
Helped-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Start the post-2.9 cycleJunio C Hamano Mon, 20 Jun 2016 18:06:49 +0000 (11:06 -0700)

Start the post-2.9 cycle

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

Merge branch 'rs/xdiff-hunk-with-func-line'Junio C Hamano Mon, 20 Jun 2016 18:01:04 +0000 (11:01 -0700)

Merge branch 'rs/xdiff-hunk-with-func-line'

"git show -W" (extend hunks to cover the entire function, delimited
by lines that match the "funcname" pattern) used to show the entire
file when a change added an entire function at the end of the file,
which has been fixed.

* rs/xdiff-hunk-with-func-line:
xdiff: fix merging of appended hunk with -W
grep: -W: don't extend context to trailing empty lines
t7810: add test for grep -W and trailing empty context lines
xdiff: don't trim common tail with -W
xdiff: -W: don't include common trailing empty lines in context
xdiff: ignore empty lines before added functions with -W
xdiff: handle appended chunks better with -W
xdiff: factor out match_func_rec()
t4051: rewrite, add more tests

Merge branch 'jk/rev-list-count-with-bitmap'Junio C Hamano Mon, 20 Jun 2016 18:01:03 +0000 (11:01 -0700)

Merge branch 'jk/rev-list-count-with-bitmap'

"git rev-list --count" whose walk-length is limited with "-n"
option did not work well with the counting optimized to look at the
bitmap index.

* jk/rev-list-count-with-bitmap:
rev-list: disable bitmaps when "-n" is used with listing objects
rev-list: "adjust" results of "--count --use-bitmap-index -n"

Merge branch 'wd/userdiff-css'Junio C Hamano Mon, 20 Jun 2016 18:01:02 +0000 (11:01 -0700)

Merge branch 'wd/userdiff-css'

Update the funcname definition to support css files.

* wd/userdiff-css:
userdiff: add built-in pattern for CSS

Merge branch 'jc/clear-pathspec'Junio C Hamano Mon, 20 Jun 2016 18:01:02 +0000 (11:01 -0700)

Merge branch 'jc/clear-pathspec'

We usually call a function that clears the contents a data
structure X without freeing the structure itself clear_X(), and
call a function that does clear_X() and also frees it free_X().
free_pathspec() function has been renamed to clear_pathspec()
to avoid confusion.

* jc/clear-pathspec:
pathspec: rename free_pathspec() to clear_pathspec()

Merge branch 'aq/upload-pack-use-parse-options'Junio C Hamano Mon, 20 Jun 2016 18:01:02 +0000 (11:01 -0700)

Merge branch 'aq/upload-pack-use-parse-options'

"git upload-pack" command has been updated to use the parse-options
API.

* aq/upload-pack-use-parse-options:
upload-pack.c: use parse-options API

Merge branch 'jg/dash-is-last-branch-in-worktree-add'Junio C Hamano Mon, 20 Jun 2016 18:01:02 +0000 (11:01 -0700)

Merge branch 'jg/dash-is-last-branch-in-worktree-add'

"git worktree add" learned that '-' can be used as a short-hand for
"@{-1}", the previous branch.

* jg/dash-is-last-branch-in-worktree-add:
worktree: allow "-" short-hand for @{-1} in add command

Merge branch 'et/pretty-format-c-auto'Junio C Hamano Mon, 20 Jun 2016 18:01:01 +0000 (11:01 -0700)

Merge branch 'et/pretty-format-c-auto'

The commands in `git log` family take %C(auto) in a custom format
string. This unconditionally turned the color on, ignoring
--no-color or with --color=auto when the output is not connected to
a tty; this was corrected to make the format truly behave as
"auto".

* et/pretty-format-c-auto:
format_commit_message: honor `color=auto` for `%C(auto)`

Merge branch 'sb/submodule-recommend-shallowness'Junio C Hamano Mon, 20 Jun 2016 18:01:01 +0000 (11:01 -0700)

Merge branch 'sb/submodule-recommend-shallowness'

An upstream project can make a recommendation to shallowly clone
some submodules in the .gitmodules file it ships.

* sb/submodule-recommend-shallowness:
submodule update: learn `--[no-]recommend-shallow` option
submodule-config: keep shallow recommendation around

Merge branch 'sb/submodule-misc-cleanups'Junio C Hamano Mon, 20 Jun 2016 18:01:01 +0000 (11:01 -0700)

Merge branch 'sb/submodule-misc-cleanups'

Minor simplification.

* sb/submodule-misc-cleanups:
submodule update: make use of the existing fetch_in_submodule function

Merge branch 'ew/daemon-socket-keepalive'Junio C Hamano Mon, 20 Jun 2016 18:01:00 +0000 (11:01 -0700)

Merge branch 'ew/daemon-socket-keepalive'

When "git daemon" is run without --[init-]timeout specified, a
connection from a client that silently goes offline can hang around
for a long time, wasting resources. The socket-level KEEPALIVE has
been enabled to allow the OS to notice such failed connections.

* ew/daemon-socket-keepalive:
daemon: enable SO_KEEPALIVE for all sockets

Merge branch 'ah/no-verify-signature-with-pull-rebase'Junio C Hamano Mon, 20 Jun 2016 18:01:00 +0000 (11:01 -0700)

Merge branch 'ah/no-verify-signature-with-pull-rebase'

"git pull --rebase --verify-signature" learned to warn the user
that "--verify-signature" is a no-op when rebasing.

* ah/no-verify-signature-with-pull-rebase:
pull: warn on --verify-signatures with --rebase

Merge branch 'ew/fast-import-unpack-limit'Junio C Hamano Mon, 20 Jun 2016 18:01:00 +0000 (11:01 -0700)

Merge branch 'ew/fast-import-unpack-limit'

"git fast-import" learned the same performance trick to avoid
creating too small a packfile as "git fetch" and "git push" have,
using *.unpackLimit configuration.

* ew/fast-import-unpack-limit:
fast-import: invalidate pack_id references after loosening
fast-import: implement unpack limit

sh-setup: enclose setting of ${VAR=default} in double... LE Manh Cuong Sat, 18 Jun 2016 20:26:03 +0000 (03:26 +0700)

sh-setup: enclose setting of ${VAR=default} in double-quotes

We often make sure an environment variable is set to
something, either set by the user (in which case we do not
molest it) or set it to our default value (otherwise), with

: ${VAR=default value}

i.e. running the no-op command ":" with ${VAR} as its
parameters (or the default value we supply), relying on that
":" is a no-op.

This pattern, even though it is no-op from correctness point
of view, still can be expensive if the existing value in VAR
has shell glob (because they will be expanded against
filesystem entities) and IFS whitespaces (because the value
need to be split into multiple parameters). Our invocation
of ":" command does not care if the parameter given to it is
after the value in VAR goes through these processing.

Enclosing the whole thing in double-quote, i.e.

: "${VAR=default value}"

avoids paying the unnecessary cost, so let's do so.

Signed-off-by: LE Manh Cuong <cuong.manhle.vn@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gpg-interface: check gpg signature creation statusMichael J Gruber Fri, 17 Jun 2016 23:38:59 +0000 (19:38 -0400)

gpg-interface: check gpg signature creation status

When we create a signature, it may happen that gpg returns with
"success" but not with an actual detached signature on stdout.

Check for the correct signature creation status to catch these cases
better. Really, --status-fd parsing is the only way to check gpg status
reliably. We do the same for verify already.

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

sign_buffer: use pipe_commandJeff King Fri, 17 Jun 2016 23:38:55 +0000 (19:38 -0400)

sign_buffer: use pipe_command

Similar to the prior commit for verify_signed_buffer, the
motivation here is both to make the code simpler, and to
avoid any possible deadlocks with gpg.

In this case we have the same "write to stdin, then read
from stdout" that the verify case had. This is unlikely to
be a problem in practice, since stdout has the detached
signature, which it cannot compute until it has read all of
stdin (if it were a non-detached signature, that would be a
problem, though).

We don't read from stderr at all currently. However, we will
want to in a future patch, so this also prepares us there
(and in that case gpg _does_ write before reading all of the
input, though again, it is unlikely that a key uid will fill
up a pipe buffer).

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

verify_signed_buffer: use pipe_commandJeff King Fri, 17 Jun 2016 23:38:52 +0000 (19:38 -0400)

verify_signed_buffer: use pipe_command

This is shorter and should make the function easier to
follow. But more importantly, it removes the possibility of
any deadlocks based on reading or writing to gpg.

It's not clear if such a deadlock is possible in practice.

We do write the whole payload before reading anything, so we
could deadlock there. However, in practice gpg will need to
read our whole input to verify the signature, so it will
drain our payload first. It could write an error to stderr
before reading, but it's unlikely that such an error
wouldn't be followed by it immediately exiting, or that the
error would actually be larger than a pipe buffer.

On the writing side, we drain stderr (with the
human-readable output) in its entirety before reading stdout
(with the status-fd data). Running strace on "gpg --verify"
does show interleaved output on the two descriptors:

write(2, "gpg: ", 5) = 5
write(2, "Signature made Thu 16 Jun 2016 0"..., 73) = 73
write(1, "[GNUPG:] SIG_ID tQw8KGcs9rBfLvAj"..., 66) = 66
write(1, "[GNUPG:] GOODSIG 69808639F9430ED"..., 60) = 60
write(2, "gpg: ", 5) = 5
write(2, "Good signature from \"Jeff King <"..., 47) = 47
write(2, "\n", 1) = 1
write(2, "gpg: ", 5) = 5
write(2, " aka \"Jeff King <"..., 49) = 49
write(2, "\n", 1) = 1
write(1, "[GNUPG:] VALIDSIG C49CE24156AF08"..., 135) = 135
write(1, "[GNUPG:] TRUST_ULTIMATE\n", 24) = 24

The second line written to stdout there contains the
signer's UID, which can be arbitrarily long. If it fills the
pipe buffer, then gpg would block writing to its stdout,
while we are blocked trying to read its stderr.

In practice, GPG seems to limit UIDs to 2048 bytes, so
unless your pipe buffer size is quite small, or unless gpg
does not enforce the limit under some conditions, this seems
unlikely in practice.

Still, it is not hard for us to be cautious and just use
pipe_command.

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

run-command: add pipe_command helperJeff King Fri, 17 Jun 2016 23:38:47 +0000 (19:38 -0400)

run-command: add pipe_command helper

We already have capture_command(), which captures the stdout
of a command in a way that avoids deadlocks. But sometimes
we need to do more I/O, like capturing stderr as well, or
sending data to stdin. It's easy to write code that
deadlocks racily in these situations depending on how fast
the command reads its input, or in which order it writes its
output.

Let's give callers an easy interface for doing this the
right way, similar to what capture_command() did for the
simple case.

The whole thing is backed by a generic poll() loop that can
feed an arbitrary number of buffers to descriptors, and fill
an arbitrary number of strbufs from other descriptors. This
seems like overkill, but the resulting code is actually a
bit cleaner than just handling the three descriptors
(because the output code for stdout/stderr is effectively
duplicated, so being able to loop is a benefit).

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

verify_signed_buffer: use tempfile objectJeff King Fri, 17 Jun 2016 23:38:43 +0000 (19:38 -0400)

verify_signed_buffer: use tempfile object

We use git_mkstemp to create a temporary file, and try to
clean it up in all exit paths from the function. But that
misses any cases where we die by signal, or by calling die()
in a sub-function. In addition, we missed one of the exit
paths.

Let's convert to using a tempfile object, which handles the
hard cases for us, and add the missing cleanup call. Note
that we would not simply want to rely on program exit to
catch our missed cleanup, as this function may be called
many times in a single program (for the same reason, we use
a static tempfile instead of heap-allocating a new one; that
gives an upper bound on our memory usage).

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

verify_signed_buffer: drop pbuf variableJeff King Fri, 17 Jun 2016 23:38:39 +0000 (19:38 -0400)

verify_signed_buffer: drop pbuf variable

If our caller gave us a non-NULL gpg_status parameter, we
write the gpg status into their strbuf. If they didn't, then
we write it to a temporary local strbuf (since we still need
to look at it). The variable "pbuf" adds an extra layer of
indirection so that the rest of the function can just access
whichever is appropriate.

However, the name "pbuf" isn't very descriptive, and it's
easy to get confused about what is supposed to be in it
(especially because we are reading both "status" and
"output" from gpg).

Rather than give it a more descriptive name, we can just use
gpg_status as our indirection pointer. Either it points to
the caller's input, or we can point it directly to our
temporary buffer.

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

gpg-interface: use child_process.argsJeff King Fri, 17 Jun 2016 23:38:35 +0000 (19:38 -0400)

gpg-interface: use child_process.args

Our argv allocations are relatively straightforward, but
this avoids us having to manually keep the count up to date
(or create new to-be-replaced slots in the declaration) when
we add new arguments.

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

i18n: branch: mark comment when editing branch descript... Vasco Almeida Fri, 17 Jun 2016 21:54:15 +0000 (21:54 +0000)

i18n: branch: mark comment when editing branch description for translation

When one issues git branch --edit-description branch_name, a edit with
that message commented out is opened. Mark that message for translation
in to order to be localized.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: unmark die messages for translationVasco Almeida Fri, 17 Jun 2016 21:54:14 +0000 (21:54 +0000)

i18n: unmark die messages for translation

These messages are relevant for the programmer only, not for the end
user. Thus, they can be unmarked for translation, saving translator
some work.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: submodule: escape shell variables inside eval_gettextVasco Almeida Fri, 17 Jun 2016 21:54:13 +0000 (21:54 +0000)

i18n: submodule: escape shell variables inside eval_gettext

According to the gettext manual [1], references to shell variables inside
eval_gettext call must be escaped so that eval_gettext receives the
translatable string before the variable values are substituted into it.

[1] http://www.gnu.org/software/gettext/manual/html_node/Preparing-Shell-Scripts.html

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: submodule: join strings marked for translationVasco Almeida Fri, 17 Jun 2016 21:54:12 +0000 (21:54 +0000)

i18n: submodule: join strings marked for translation

Join strings marked for translation since that would facilitate and
improve translations result.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: init-db: join message piecesVasco Almeida Fri, 17 Jun 2016 21:54:11 +0000 (21:54 +0000)

i18n: init-db: join message pieces

Join message displayed during repository initialization in one entire
sentence. That would improve translations since it's easier translate
an entire sentence than translating each piece.

Update Icelandic translation to reflect the changes. The Icelandic
translation of these messages is used with test
t0204-gettext-reencode-sanity.sh and not updating the translation would
fail the test.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: remote: allow translations to reorder messageVasco Almeida Fri, 17 Jun 2016 20:21:22 +0000 (20:21 +0000)

i18n: remote: allow translations to reorder message

Before this patch, translations couldn't place the branch name
where it was better fit in the message "and with remote <branch_name>".
Allow translations that, instead of forcing the branch name to display
right of the message.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: remote: mark URL fallback text for translationVasco Almeida Fri, 17 Jun 2016 20:21:21 +0000 (20:21 +0000)

i18n: remote: mark URL fallback text for translation

Marks fallback text for translation that may be displayed in git remote
show output.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: standardise messagesVasco Almeida Fri, 17 Jun 2016 20:21:20 +0000 (20:21 +0000)

i18n: standardise messages

Standardise messages in order to save translators some work.

Nuances fixed in this commit:
"failed to read %s"
"read of %s failed"

"detach the HEAD at named commit"
"detach HEAD at named commit"

"removing '%s' failed"
"failed to remove '%s'"

"index file corrupt"
"corrupt index file"

"failed to read %s"
"read of %s failed"

"detach the HEAD at named commit"
"detach HEAD at named commit"

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: sequencer: add period to error messageVasco Almeida Fri, 17 Jun 2016 20:21:19 +0000 (20:21 +0000)

i18n: sequencer: add period to error message

Add a period to error message so it matches others instances in
sequencer.c. Now translator would have to translate such message only
once.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: merge: change command option help to lowercaseVasco Almeida Fri, 17 Jun 2016 20:21:18 +0000 (20:21 +0000)

i18n: merge: change command option help to lowercase

Change command option description to lowercase, matching pull
counterpart option. Translators would have to translate such message
only once.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: merge: mark messages for translationVasco Almeida Fri, 17 Jun 2016 20:21:17 +0000 (20:21 +0000)

i18n: merge: mark messages for translation

Mark messages shown to the user for translation.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: notes: mark options for translationVasco Almeida Fri, 17 Jun 2016 20:21:15 +0000 (20:21 +0000)

i18n: notes: mark options for translation

Mark options description of git prune for translation.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: notes: mark strings for translationVasco Almeida Fri, 17 Jun 2016 20:21:14 +0000 (20:21 +0000)

i18n: notes: mark strings for translation

Mark strings of messages for the user as translatable.

Update tests t3310-notes-merge-manual-resolve.sh and
t3320-notes-merge-worktrees.sh to reflect new translatable messages.

Tests that grep for .git/NOTES_MERGE_WORKTREE reflect the translatable
string "Automatic notes merge failed. Fix conflicts in %s and [...]".

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: transport-helper.c: change N_() call to _()Vasco Almeida Fri, 17 Jun 2016 20:21:13 +0000 (20:21 +0000)

i18n: transport-helper.c: change N_() call to _()

The N_() no-op call currently marks the string to be extracted by
xgettext but doesn't trigger the retrieval of the translation at run
time, whereas _() does both. Meaning that, in spite of having
translations available, they were never retrieved to make use of them.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: bisect: mark strings for translationVasco Almeida Fri, 17 Jun 2016 20:21:12 +0000 (20:21 +0000)

i18n: bisect: mark strings for translation

In the last message, involving Q_(), try to mark the message in such way
that is suited for RTL (Right to Left) languages.

Update test t6030-bisect-porcelain.sh to reflect the changes.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5523: use test_i18ngrep for negationVasco Almeida Fri, 17 Jun 2016 20:21:11 +0000 (20:21 +0000)

t5523: use test_i18ngrep for negation

Replace the first form with the second one:

! grep expected actual
test_i18ngrep ! expected actual

The latter syntax is supported by test_i18ngrep defined in
t/test-lib.sh.

Although the test already passes whether GETTEXT_POSION is enabled, use
the i18n grep variant for the sake of consistency and also to make
obvious that those strings are subject to i18n.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4153: fix negated test_i18ngrep callVasco Almeida Fri, 17 Jun 2016 20:21:10 +0000 (20:21 +0000)

t4153: fix negated test_i18ngrep call

The function test_i18ngrep fakes success when run under GETTEXT_POISON.
Hence, running in the following manner will always fail under gettext
poison:

! test_i18ngrep expected actual

Use correct syntax: test_i18ngrep ! expected actual

For other instance of this issue see 41ca19b ("tests: fix negated
test_i18ngrep calls", 2014-08-13).

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9003: become resilient to GETTEXT_POISONVasco Almeida Fri, 17 Jun 2016 20:21:09 +0000 (20:21 +0000)

t9003: become resilient to GETTEXT_POISON

The test t9003-help-autocorrect.sh fails when run under GETTEXT_POISON,
because it's expecting to filter out the original output. Accommodate
gettext poison case by also filtering out the default simulated output.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: unpack-trees: update to use test_i18n* functionsVasco Almeida Fri, 17 Jun 2016 20:21:08 +0000 (20:21 +0000)

tests: unpack-trees: update to use test_i18n* functions

Use functions test_i18ncmp and test_i18ngrep to successfully pass tests
running under GETTEXT_POISON.

The output strings compared to in these test were marked for translation
in ed47fdf ("i18n: unpack-trees: mark strings for translation",
2016-04-09) and later improved in 2e3926b ("i18n: unpack-trees: avoid
substituting only a verb in sentences", 2016-05-12).

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: use test_i18n* functions to suppress false positivesVasco Almeida Fri, 17 Jun 2016 20:21:07 +0000 (20:21 +0000)

tests: use test_i18n* functions to suppress false positives

The test functions test_i18ncmp and test_i18ngrep pretend success if run
under GETTEXT_POISON. By using those functions to test output which is
correctly marked as translatable, enables one to detect if the strings
newly marked for translation are from plumbing output. If they are
indeed from plumbing, the test would fail, and the string should be
unmarked, since it is not seen by users.

Thus, it is productive to not have false positives when running the test
under GETTEXT_POISON. This commit replaces normal test functions by
their i18n aware variants in use-cases know to be correctly marked for
translation, suppressing false positives.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: setup: mark strings for translationVasco Almeida Fri, 17 Jun 2016 20:21:06 +0000 (20:21 +0000)

i18n: setup: mark strings for translation

Update tests that compare the strings newly marked for translation to
succeed when running under GETTEXT_POISON.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: rebase-interactive: mark comments of squash for... Vasco Almeida Fri, 17 Jun 2016 20:21:05 +0000 (20:21 +0000)

i18n: rebase-interactive: mark comments of squash for translation

Mark comment messages of squash/fixup file ($squash_msg) for
translation.

Helper functions this_nth_commit_message and skip_nth_commit_message
replace the previous method of making the comment messages (such as
"This is the 2nd commit message:") aided by nth_string helper function.
This step was taken as a workaround to enabled translation of entire
sentences. However, doesn't change any text seen in English by the user,
except for string "The first commit's message is:" which was changed to
match the style of other instances.

The test t3404-rebase-interactive.sh resorts to set_fake_editor which
didn't account for GETTEXT_POISON. Fix it by assuming success when we
find dummy gettext poison output where was supposed to find the first
comment line "This is a combination of $count commits.".

For that same message, use plural aware eval_ngettext instead of
eval_gettext, since other languages have more complex plural forms.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: rebase-interactive: mark here-doc strings for... Vasco Almeida Fri, 17 Jun 2016 20:21:04 +0000 (20:21 +0000)

i18n: rebase-interactive: mark here-doc strings for translation

Use pipe to send gettext output to git stripspace instead of the
original method of using shell here-document, because command
substitution '$(...)' would not take place inside the here-documents.
The exception is the case of the last here-document redirecting to cat,
in which commands substitution works and, thus, is preserved in this
commit.

t3404: adapt test to the strings newly marked for translation
Test t3404-rebase-interactive.sh would fail under GETTEXT_POISON unless
using test_i18ngrep.

Add eval_ngettext fallback functions to be called when running, for
instance, under GETTEXT_POISON. Otherwise, tests would fail under
GETTEXT_POISON, or other build that doesn't support the GNU gettext,
because that function could not be found.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: rebase-interactive: mark strings for translationVasco Almeida Fri, 17 Jun 2016 20:21:03 +0000 (20:21 +0000)

i18n: rebase-interactive: mark strings for translation

Mark strings in git-rebase--interactive.sh for translation. There is no
need to source git-sh-i18n since git-rebase.sh already does so.

Add git-rebase--interactive.sh to LOCALIZED_SH in Makefile in order to
enable extracting strings marked for translation by xgettext.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-sh-setup.sh: mark strings for translationVasco Almeida Fri, 17 Jun 2016 20:21:02 +0000 (20:21 +0000)

i18n: git-sh-setup.sh: mark strings for translation

Positional arguments, such as $0, $1, etc, need to be stored on shell
variables for use in translatable strings, according to gettext manual
[1].

Add git-sh-setup.sh to LOCALIZED_SH variable in Makefile to enable
extraction of string marked for translation by xgettext.

Source git-sh-i18n in git-sh-setup.sh for gettext support.
git-sh-setup.sh is a shell library to be sourced by other shell scripts.
In order to avoid other scripts from sourcing git-sh-i18n twice, remove
line that sources it from them. Not sourcing git-sh-i18n in any script
that uses gettext would lead to failure due to, for instance, gettextln
not being found.

[1] http://www.gnu.org/software/gettext/manual/html_node/Preparing-Shell-Scripts.html

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6030: update to use test_i18ncmpVasco Almeida Fri, 17 Jun 2016 20:21:01 +0000 (20:21 +0000)

t6030: update to use test_i18ncmp

Since the git bisect output tested here is subject to translation, the
helper function test_i18ncmp should be used over test_cmp.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: bisect: simplify error message for i18nVasco Almeida Fri, 17 Jun 2016 20:21:00 +0000 (20:21 +0000)

i18n: bisect: simplify error message for i18n

The message was not being extracted by xgettext, although it was marked
for translation, seemingly because it contained a command substitution.
Moreover, eval_gettext should be used instead of gettext for strings
with substitution.

See step 4. of section 15.5.2.1 Preparing Shell Scripts for
Internationalization from gettext manual [1]:
"Simplify translatable strings so that they don't contain command
substitution ("`...`" or "$(...)") [...]"

[1] http://www.gnu.org/software/gettext/manual/html_node/Preparing-Shell-Scripts.html

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: rebase: mark placeholder for translationVasco Almeida Fri, 17 Jun 2016 20:20:59 +0000 (20:20 +0000)

i18n: rebase: mark placeholder for translation

Mark placeholder "<branch>" in git-rebase.sh for translation. The string
containing the named placeholder is passed to shell function
error_on_missing_default_upstream in git-parse-remote.sh which uses it
to display a command hint for the user.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: rebase: fix marked string to use eval_gettext... Vasco Almeida Fri, 17 Jun 2016 20:20:58 +0000 (20:20 +0000)

i18n: rebase: fix marked string to use eval_gettext variant

The string message marked for translation should use eval_gettext
variant instead of the gettext one, since we want to dollar-substitute
$head_name in the result.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-octopus: use die shell function from git-sh-setup.shVasco Almeida Fri, 17 Jun 2016 20:20:57 +0000 (20:20 +0000)

merge-octopus: use die shell function from git-sh-setup.sh

Source git-sh-setup in order to use die shell function from
git-sh-setup.sh library instead of using the one defined in
git-merge-octopus.sh. Remove the former die function.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: merge-octopus: mark messages for translationVasco Almeida Fri, 17 Jun 2016 20:20:56 +0000 (20:20 +0000)

i18n: merge-octopus: mark messages for translation

Mark messages in git-merge-octopus.sh for translation.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: sequencer: mark string for translationVasco Almeida Fri, 17 Jun 2016 20:20:55 +0000 (20:20 +0000)

i18n: sequencer: mark string for translation

Mark informative string "<action_name>: fast-forward" for translation.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: sequencer: mark entire sentences for translationVasco Almeida Fri, 17 Jun 2016 20:20:54 +0000 (20:20 +0000)

i18n: sequencer: mark entire sentences for translation

Mark entire sentences of error message rather than assembling one using
placeholders (e.g. "Cannot %s during a %s").

That would facilitate translation work because it is easier to translate
a entire sentence than translating pieces. We would have better
translations at the expense of source code verbosity.

Moreover, translators can now 1) translate the terms "revert" and
"cherry-pick" if they please 2) have more leeway to adapt their
translations.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: transport: mark strings for translationVasco Almeida Fri, 17 Jun 2016 20:20:53 +0000 (20:20 +0000)

i18n: transport: mark strings for translation

Mark one printf string and one error string for translation.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: advice: internationalize message for conflictsVasco Almeida Fri, 17 Jun 2016 20:20:52 +0000 (20:20 +0000)

i18n: advice: internationalize message for conflicts

Mark message for translation telling the user she has conflicts to
resolve. Expose each particular use case, in order to enable translating
entire sentences which would facilitate translating into other
languages.

Change "Pull" to lowercase to match other instances. Update test
t5520-pull.sh, that relied on the old error message, to use the new one.

Although we loose in source code conciseness, we would gain better
translations because translators can 1) translate the entire sentence,
including those terms concerning Git (committing, merging, etc) 2) have
leeway to adapt to their languages.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: advice: mark string about detached head for trans... Vasco Almeida Fri, 17 Jun 2016 20:20:51 +0000 (20:20 +0000)

i18n: advice: mark string about detached head for translation

Mark string with advice seen by the user when in detached head.

Update test t7201-co.sh to pass under GETTEXT_POISON build. Pretend
success if the number of lines of "git checkout renamer^" output is not
greater than 1 and test are running under GETTEXT_POISON.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: builtin/remote.c: fix mark for translationVasco Almeida Fri, 17 Jun 2016 20:20:50 +0000 (20:20 +0000)

i18n: builtin/remote.c: fix mark for translation

The second string inside _() was not being extracted for translation by
xgettext, meaning that, although the string was passed to gettext, there
was no translation available.

Mark each individual string instead of marking the result of ternary if.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/technical: signed merge tag formatMichael J Gruber Fri, 17 Jun 2016 07:46:11 +0000 (09:46 +0200)

Documentation/technical: signed merge tag format

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

Documentation/technical: signed commit formatMichael J Gruber Fri, 17 Jun 2016 07:46:10 +0000 (09:46 +0200)

Documentation/technical: signed commit format

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

Documentation/technical: signed tag formatMichael J Gruber Fri, 17 Jun 2016 07:46:09 +0000 (09:46 +0200)

Documentation/technical: signed tag format

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