Commit graph

43561 commits

Author SHA1 Message Date
Jeff King adb3356664 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>
2016-06-23 11:32:51 -07:00
Jeff King 0111681ecf 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>
2016-06-23 11:32:51 -07:00
Eric Wong 6d523a3ab7 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>
2016-06-22 22:48:54 +00:00
Johannes Schindelin 412b9a16a0 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>
2016-06-22 14:47:36 -07:00
Jeff King 85a727895d 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>
2016-06-22 13:47:55 -07:00
Jeff King 1a0962dee5 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>
2016-06-22 13:47:16 -07:00
Johannes Schindelin 4e1b06da25 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>
2016-06-22 13:24:17 -07:00
Johannes Schindelin 7735612244 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>
2016-06-22 13:23:56 -07:00
Jonathan Nieder f79358279c 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>
2016-06-22 12:37:33 -07:00
Andrew Oakley 09667d013c 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>
2016-06-22 09:45:15 -07:00
Charles Bailey fe0537aa6e t7810: fix duplicated test title
Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-21 15:33:34 -07:00
Stefan Beller 5819c2eeff 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>
2016-06-21 12:08:38 -07:00
Armin Kunaschik d2addc3b96 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>
2016-06-21 11:41:31 -07:00
Johannes Schindelin e3efa94be9 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>
2016-06-21 11:18:17 -07:00
Jeff King bab748371a 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>
2016-06-20 15:08:07 -07:00
Jeff King 36d6792157 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>
2016-06-20 15:08:07 -07:00
Jeff King fdba2cdec4 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>
2016-06-20 15:08:07 -07:00
Johannes Schindelin 0767172b90 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>
2016-06-20 12:12:12 -07:00
Junio C Hamano 18a74a092b 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>
2016-06-20 11:35:28 -07:00
Junio C Hamano ab7797dbe9 Start the post-2.9 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-20 11:06:49 -07:00
Junio C Hamano d15c05a5d0 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
2016-06-20 11:01:04 -07:00
Junio C Hamano 6d8c5454b6 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"
2016-06-20 11:01:03 -07:00
Junio C Hamano 8699b74ae1 Merge branch 'wd/userdiff-css'
Update the funcname definition to support css files.

* wd/userdiff-css:
  userdiff: add built-in pattern for CSS
2016-06-20 11:01:02 -07:00
Junio C Hamano 1958a17fe4 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()
2016-06-20 11:01:02 -07:00
Junio C Hamano 0196c75e14 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
2016-06-20 11:01:02 -07:00
Junio C Hamano 6d41eb685a 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
2016-06-20 11:01:02 -07:00
Junio C Hamano 1b3d14c1c8 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)`
2016-06-20 11:01:01 -07:00
Junio C Hamano 3807098cd6 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
2016-06-20 11:01:01 -07:00
Junio C Hamano de76eb69d2 Merge branch 'sb/submodule-misc-cleanups'
Minor simplification.

* sb/submodule-misc-cleanups:
  submodule update: make use of the existing fetch_in_submodule function
2016-06-20 11:01:01 -07:00
Junio C Hamano 349e0c1adc 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
2016-06-20 11:01:01 -07:00
Junio C Hamano 73bc4b4928 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
2016-06-20 11:01:00 -07:00
Junio C Hamano 8d6a7e9a19 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
2016-06-20 11:01:00 -07:00
LE Manh Cuong 01247e0299 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>
2016-06-19 14:07:04 -07:00
Michael J Gruber efee9553a4 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>
2016-06-17 17:03:57 -07:00
Jeff King 0581b54641 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>
2016-06-17 17:03:57 -07:00
Jeff King 0d2b664efd 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>
2016-06-17 17:03:57 -07:00
Jeff King 96335bcf4d 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>
2016-06-17 17:03:56 -07:00
Jeff King 4322353bfb 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>
2016-06-17 17:03:56 -07:00
Jeff King c752fcc8e0 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>
2016-06-17 17:03:56 -07:00
Jeff King aedb5dc343 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>
2016-06-17 17:03:55 -07:00
Vasco Almeida b18237f4e3 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>
2016-06-17 15:46:10 -07:00
Vasco Almeida f813fb41fc 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>
2016-06-17 15:46:10 -07:00
Vasco Almeida c87302bfe4 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>
2016-06-17 15:46:10 -07:00
Vasco Almeida 0d71dbfd50 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>
2016-06-17 15:46:10 -07:00
Vasco Almeida c30364d080 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>
2016-06-17 15:46:10 -07:00
Vasco Almeida a1b467a4ee 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>
2016-06-17 15:46:10 -07:00
Vasco Almeida 7ba7b9abcc 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>
2016-06-17 15:46:10 -07:00
Vasco Almeida e923a8abe9 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>
2016-06-17 15:46:10 -07:00
Vasco Almeida 62d09ef319 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>
2016-06-17 15:46:10 -07:00
Vasco Almeida c8bb9d2e5a 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>
2016-06-17 15:46:10 -07:00