gitweb.git
userdiff/perl: match full line of POD headersJonathan Nieder Sat, 21 May 2011 19:35:51 +0000 (14:35 -0500)

userdiff/perl: match full line of POD headers

The builtin perl userdiff driver is not greedy enough about catching
POD header lines. Capture the whole line, so instead of just
declaring that we are in some "@@ =head1" section, diff/grep output
can explain that the enclosing section is about "@@ =head1 OPTIONS".

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

userdiff/perl: anchor "sub" and "package" patterns... Jonathan Nieder Sat, 21 May 2011 19:29:01 +0000 (14:29 -0500)

userdiff/perl: anchor "sub" and "package" patterns on the left

The userdiff funcname mechanism has no concept of nested scopes ---
instead, "git diff" and "git grep --show-function" simply label the
diff header with the most recent matching line. Unfortunately that
means text following a subroutine in a POD section:

=head1 DESCRIPTION

You might use this facility like so:

sub example {
foo;
}

Now, having said that, let's say more about the facility.
Blah blah blah ... etc etc.

gets the subroutine name instead of the POD header in its diff/grep
funcname header, making it harder to get oriented when reading a
diff without enough context.

The fix is simple: anchor the funcname syntax to the left margin so
nested subroutines and packages like this won't get picked up. (The
builtin C++ funcname pattern already does the same thing.) This means
the userdiff driver will misparse the idiom

{
my $static;
sub foo {
... use $static ...
}
}

but I think that's worth it; we can revisit this later if the userdiff
mechanism learns to keep track of the beginning and end of nested
scopes.

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4018 (funcname patterns): minor cleanupsJonathan Nieder Sat, 21 May 2011 19:25:14 +0000 (14:25 -0500)

t4018 (funcname patterns): minor cleanups

Introduce a test_expect_funcname function to make a diff and apply a
regexp anchored on the left to the function name it writes, avoiding
some repetition.

Omit the space after >, <<, and < operators for consistency with
other scripts. Quote the <<here document delimiter and $ signs in
quotes so readers don't have to worry about the effect of shell
metacharacters.

Remove some unnecessary blank lines.

Run "git diff" as a separate command instead of as upstream of a pipe
that checks its output, so the exit status can be tested. In
particular, this way if "git diff" starts segfaulting the test harness
will notice.

Allow "error:" as a synonym for "fatal:" when checking error messages,
since whether a command uses die() or "return error()" is a small
implementation detail.

Anchor some more regexes on the right.

None of the above is very important on its own; the point is just to
make the script a little easier to read and the code less scary to
modify.

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

t4018 (funcname patterns): make configuration easier... Jonathan Nieder Sat, 21 May 2011 19:22:28 +0000 (14:22 -0500)

t4018 (funcname patterns): make configuration easier to track

Introduce a "test_config" function to set a configuration variable
for use by a single test (automatically unsetting it when the
assertion finishes). If this function is used consistently, the
configuration used in a test_expect_success block can be read at the
beginning of that block instead of requiring reading all the tests
that come before. So it becomes a little easier to add new tests or
rearrange existing ones without fear of breaking configuration.

In particular, the test of alternation in xfuncname patterns also
checks that xfuncname takes precedence over funcname variable as a
sort of side-effect, since the latter leaks in from previous tests.
In the new syntax, the test has to say explicitly what variables it is
using, making the test clearer and a future regression in coverage
from carelessly editing the script less likely.

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

t4018 (funcname patterns): make .gitattributes state... Jonathan Nieder Sat, 21 May 2011 19:11:33 +0000 (14:11 -0500)

t4018 (funcname patterns): make .gitattributes state easier to track

Most, but not all, tests in this script rely on attributes declaring
that files with a .java extension should use the "java" driver:

*.java diff=java

Split out a "set up" test to put such a .gitattributes in place after
the tests that do not want it have run, to make it more likely that
individual tests other than this setup test can be safely modified,
rearranged, or skipped. Presumably this setup code will learn to
request other drivers for other extensions in the same place when the
test suite learns to exercise other diff drivers.

Similarly, make sure that early test assertions that do not use these
default attributes set up .gitattributes appropriately for themselves,
so tests that run before can be modified with less risk of breaking
something.

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

i18n: git-bisect bisect_next_check "You need to" messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:29 +0000 (18:44 +0000)

i18n: git-bisect bisect_next_check "You need to" message

Gettextize the "You need to start by" message in
bisect_next_check. This message assembled English output by hand so it
needed to be split up to make it translatable.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-bisect [Y/n] messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:28 +0000 (18:44 +0000)

i18n: git-bisect [Y/n] messages

Gettextize the [Y/n] questions git-bisect presents, and leave a note
in a TRANSLATORS comment explaining that translators have to preserve
a mention of the Y/n characters since the program will expect them,
and not their localized equivalents.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-bisect bisect_replay + $1 messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:27 +0000 (18:44 +0000)

i18n: git-bisect bisect_replay + $1 messages

Gettextize bisect_replay messages that use the $1 variable. Since it's
subroutine local we have to provide an alias for it for eval_gettext.

Since I was doing that anyway I've changed all other uses of $1
variable to use the alias variable for clarity.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-bisect bisect_reset + $1 messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:26 +0000 (18:44 +0000)

i18n: git-bisect bisect_reset + $1 messages

ettextize bisect_reset messages that use the $1 variable. Since it's
subroutine local we have to provide an alias for it for eval_gettext.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-bisect bisect_run + $@ messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:25 +0000 (18:44 +0000)

i18n: git-bisect bisect_run + $@ messages

Gettextize bisect_run messages that use the $@ variable. Since it's
subroutine local we have to provide an alias for it for eval_gettext.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-bisect die + eval_gettext messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:24 +0000 (18:44 +0000)

i18n: git-bisect die + eval_gettext messages

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-bisect die + gettext messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:23 +0000 (18:44 +0000)

i18n: git-bisect die + gettext messages

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-bisect echo + eval_gettext messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:22 +0000 (18:44 +0000)

i18n: git-bisect echo + eval_gettext message

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-bisect echo + gettext messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:21 +0000 (18:44 +0000)

i18n: git-bisect echo + gettext messages

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-bisect gettext + echo messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:20 +0000 (18:44 +0000)

i18n: git-bisect gettext + echo message

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-bisect add git-sh-i18nÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:19 +0000 (18:44 +0000)

i18n: git-bisect add git-sh-i18n

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-stash drop_stash say/die messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:18 +0000 (18:44 +0000)

i18n: git-stash drop_stash say/die messages

Gettextize the say/die eval_gettext messages in the drop_stash
function. Since making these translatable would result in a long line
I've wrapped this into two lines.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-stash "unknown option" messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:17 +0000 (18:44 +0000)

i18n: git-stash "unknown option" message

Gettextize the "unknown option for 'stash save'" message that's shown
on:

$ git stash save --blah-blah
error: unknown option for 'stash save': --blah-blah
To provide a message, use git stash save -- '--blah-blah'
Usage: git stash list [<options>]

In a translation the second line should be aligned with the first
one. I've added a TRANSLATORS comment to indicate this.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-stash die + eval_gettext $1 messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:16 +0000 (18:44 +0000)

i18n: git-stash die + eval_gettext $1 messages

Gettextize a messages that used the $1 variable. Since it's subroutine
local we have to provide an alias for it for eval_gettext.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-stash die + eval_gettext $* messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:15 +0000 (18:44 +0000)

i18n: git-stash die + eval_gettext $* messages

Gettextize messages that used the $* variable. Since it's subroutine
local we have to provide an alias for it for eval_gettext.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-stash die + eval_gettext messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:14 +0000 (18:44 +0000)

i18n: git-stash die + eval_gettext messages

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-stash die + gettext messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:13 +0000 (18:44 +0000)

i18n: git-stash die + gettext messages

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-stash say + gettext messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:12 +0000 (18:44 +0000)

i18n: git-stash say + gettext messages

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-stash echo + gettext messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:11 +0000 (18:44 +0000)

i18n: git-stash echo + gettext message

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-stash add git-sh-i18nÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:10 +0000 (18:44 +0000)

i18n: git-stash add git-sh-i18n

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-submodule "blob" and "submodule" messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:09 +0000 (18:44 +0000)

i18n: git-submodule "blob" and "submodule" messages

Gettextize the words "blob" and "submodule", which will be
interpolated in a message emitted by git-submodule. This is
explicitly tested for so we need to skip a portion of a test with
test_i18ncmp.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-submodule "path not initialized" messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:08 +0000 (18:44 +0000)

i18n: git-submodule "path not initialized" message

Gettextize the "Submodule path '$path' not initialized" message. This
is explicitly tested for so we need to skip a portion of a test with
test_i18grep.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-submodule "[...] path is ignored" messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:07 +0000 (18:44 +0000)

i18n: git-submodule "[...] path is ignored" message

Gettextize the "The following path is ignored" message. This is
explicitly tested for so we need to skip a portion of a test with
test_i18ncmp.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-submodule "Entering [...]" messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:06 +0000 (18:44 +0000)

i18n: git-submodule "Entering [...]" message

Gettextize the "Entering [...]" message. This is explicitly tested for
so we need to skip a portion of a test with test_i18ncmp.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-submodule $errmsg messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:05 +0000 (18:44 +0000)

i18n: git-submodule $errmsg messages

Gettextize warning messages stored in the $errmsg variable using
eval_gettext interpolation. This is explicitly tested for so we
need to skip a portion of a test with test_i18ncmp.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-submodule "Submodule change[...]" messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:04 +0000 (18:44 +0000)

i18n: git-submodule "Submodule change[...]" messages

Gettextize the "Submodules changed but not updated" and "Submodule
changes to be committed" messages. This is explicitly tested for so we
need to skip a portion of a test with test_i18ncmp.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-submodule "cached cannot be used" messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:03 +0000 (18:44 +0000)

i18n: git-submodule "cached cannot be used" message

Gettextize the "--cached cannot be used with --files" message. Since
this message starts with "--" we have to pass "--" as the first
argument. This works with both GNU gettext 0.18.1 (as expected), and
the gettext(1) on Solaris 10.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-submodule $update_module say + die messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:02 +0000 (18:44 +0000)

i18n: git-submodule $update_module say + die messages

Gettextize $update_module say and die messages. These messages needed
to be split up to make them translatable.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-submodule die + eval_gettext messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:01 +0000 (18:44 +0000)

i18n: git-submodule die + eval_gettext messages

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-submodule say + eval_gettext messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:44:00 +0000 (18:44 +0000)

i18n: git-submodule say + eval_gettext messages

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-submodule echo + eval_gettext messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:59 +0000 (18:43 +0000)

i18n: git-submodule echo + eval_gettext messages

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-submodule add git-sh-i18nÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:58 +0000 (18:43 +0000)

i18n: git-submodule add git-sh-i18n

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-pull eval_gettext + warning messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:57 +0000 (18:43 +0000)

i18n: git-pull eval_gettext + warning message

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-pull eval_gettext + die messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:56 +0000 (18:43 +0000)

i18n: git-pull eval_gettext + die message

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-pull die messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:55 +0000 (18:43 +0000)

i18n: git-pull die messages

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-pull add git-sh-i18nÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:54 +0000 (18:43 +0000)

i18n: git-pull add git-sh-i18n

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-am printf(1) message to eval_gettextÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:53 +0000 (18:43 +0000)

i18n: git-am printf(1) message to eval_gettext

Convert a message that used printf(1) format to use eval_gettext. It's
easier for translators to handle the latter, since the eval format
automatically gives them context via variable names.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-am core say messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:52 +0000 (18:43 +0000)

i18n: git-am core say messages

Make the core git-am messages that use say() translatable. These are
visible on almost every git am invocation.

There are tests that depend on the "Applying" output that need to be
changed to use the test_i18* functions along with this translation.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-am "Falling back" say messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:51 +0000 (18:43 +0000)

i18n: git-am "Falling back" say message

Make the "Falling back to patching base and 3-way merge..." message
used by fall_back_3way() translatable.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-am "Apply?" messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:50 +0000 (18:43 +0000)

i18n: git-am "Apply?" message

Make the "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all" message
translatable, and leave a note in a TRANSLATORS comment explaining
that translators have to preserve a mention of the y/n/e/v/a
characters since the program will expect them, and not their
localized equivalents.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-am clean_abort messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:49 +0000 (18:43 +0000)

i18n: git-am clean_abort messages

Messages that used the clean_abort function needed both gettext(1) and
eval_gettext(). These need to be interpolated in a string like the die
and cannot_fallback messages.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-am cannot_fallback messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:48 +0000 (18:43 +0000)

i18n: git-am cannot_fallback messages

Translate messages with gettext(1) before they're passed to the
cannot_fallback function, just like we handle the die function.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-am die messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:47 +0000 (18:43 +0000)

i18n: git-am die messages

The die messages in git-am need to use:

die "$(gettext "string")"

Since gettext(1) emits the message instead of returning it like the C
equivalent, and our die() function in git-sh-setup needs to get a
string as an argument.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-am gettext + gettext to stderr messageÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:46 +0000 (18:43 +0000)

i18n: git-am gettext + gettext to stderr message

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

i18n: git-am eval_gettext messagesÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:45 +0000 (18:43 +0000)

i18n: git-am eval_gettext messages

Messages that use variables to be interpolated need to use
eval_gettext(), this wrapper will eval the message and expand the
variable for us.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-am multi-line getttext $msg; echoÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:44 +0000 (18:43 +0000)

i18n: git-am multi-line getttext $msg; echo

When we have multi-line `gettext $msg; echo' messages we can't
preserve the existing indenting because gettext(1) can't accept input
on stdin.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-am one-line gettext $msg; echoÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:43 +0000 (18:43 +0000)

i18n: git-am one-line gettext $msg; echo

One-line `gettext $msg; echo' messages are the simplest use case for
gettext(1).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: git-am add git-sh-i18nÆvar Arnfjörð Bjarmason Sat, 21 May 2011 18:43:42 +0000 (18:43 +0000)

i18n: git-am add git-sh-i18n

Source git-sh-i18n in git-am.sh, it's needed to import the Git gettext
shell functions.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

streaming: read loose objects incrementallyJunio C Hamano Sun, 15 May 2011 02:17:10 +0000 (19:17 -0700)

streaming: read loose objects incrementally

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

sha1_file.c: expose helpers to read loose objectsJunio C Hamano Sun, 15 May 2011 02:42:10 +0000 (19:42 -0700)

sha1_file.c: expose helpers to read loose objects

Make map_sha1_file(), parse_sha1_header() and unpack_sha1_header()
available to the streaming read API by exporting them via cache.h header
file.

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

streaming: read non-delta incrementally from a packJunio C Hamano Fri, 13 May 2011 22:34:58 +0000 (15:34 -0700)

streaming: read non-delta incrementally from a pack

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

streaming_write_entry(): support files with holesJunio C Hamano Fri, 13 May 2011 22:55:00 +0000 (15:55 -0700)

streaming_write_entry(): support files with holes

One typical use of a large binary file is to hold a sparse on-disk hash
table with a lot of holes. Help preserving the holes with lseek().

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

convert: CRLF_INPUT is a no-op in the output codepathJunio C Hamano Fri, 20 May 2011 23:14:32 +0000 (16:14 -0700)

convert: CRLF_INPUT is a no-op in the output codepath

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

Merge branch 'maint'Junio C Hamano Sat, 21 May 2011 01:50:29 +0000 (18:50 -0700)

Merge branch 'maint'

* maint:
git-svn: Fix git svn log --show-commit

streaming_write_entry(): use streaming API in write_entry()Junio C Hamano Thu, 12 May 2011 21:31:08 +0000 (14:31 -0700)

streaming_write_entry(): use streaming API in write_entry()

When the output to a path does not have to be converted, we can read from
the object database from the streaming API and write to the file in the
working tree, without having to hold everything in the memory.

The ident, auto- and safe- crlf conversions inherently require you to read
the whole thing before deciding what to do, so while it is technically
possible to support them by using a buffer of an unbound size or rewinding
and reading the stream twice, it is less practical than the traditional
"read the whole thing in core and convert" approach.

Adding streaming filters for the other conversions on top of this should
be doable by tweaking the can_bypass_conversion() function (it should be
renamed to can_filter_stream() when it happens). Then the streaming API
can be extended to wrap the git_istream streaming_write_entry() opens on
the underlying object in another git_istream that reads from it, filters
what is read, and let the streaming_write_entry() read the filtered
result. But that is outside the scope of this series.

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

streaming: a new API to read from the object storeJunio C Hamano Thu, 12 May 2011 02:30:25 +0000 (19:30 -0700)

streaming: a new API to read from the object store

Given an object name, use open_istream() to get a git_istream handle
that you can read_istream() from as if you are using read(2) to read
the contents of the object, and close it with close_istream() when
you are done.

Currently, we do not do anything fancy--it just calls read_sha1_file()
and keeps the contents in memory as a whole, and carve it out as you
request with read_istream().

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

write_entry(): separate two helper functions outJunio C Hamano Fri, 13 May 2011 04:36:42 +0000 (21:36 -0700)

write_entry(): separate two helper functions out

In the write-out codepath, a block of code determines what file in the
working tree to write to, and opens an output file descriptor to it.

After writing the contents out to the file, another block of code runs
fstat() on the file descriptor when appropriate.

Separate these blocks out to open_output_fd() and fstat_output()
helper functions.

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

unpack_object_header(): make it publicJunio C Hamano Fri, 13 May 2011 22:33:33 +0000 (15:33 -0700)

unpack_object_header(): make it public

This function is used to read and skip over the per-object header
in a packfile.

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

sha1_object_info_extended(): hint about objects in... Junio C Hamano Fri, 13 May 2011 20:20:43 +0000 (13:20 -0700)

sha1_object_info_extended(): hint about objects in delta-base cache

An object found in the delta-base cache is not guaranteed to
stay there, but we know it came from a pack and it is likely
to give us a quick access if we read_sha1_file() it right now,
which is a piece of useful information.

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

do not read beyond end of malloc'd bufferJim Meyering Fri, 20 May 2011 17:20:12 +0000 (19:20 +0200)

do not read beyond end of malloc'd buffer

With diff.suppress-blank-empty=true, "git diff --word-diff" would
output data that had been read from uninitialized heap memory.
The problem was that fn_out_consume did not account for the
possibility of a line with length 1, i.e., the empty context line
that diff.suppress-blank-empty=true converts from " \n" to "\n".
Since it assumed there would always be a prefix character (the space),
it decremented "len" unconditionally, thus passing len=0 to emit_line,
which would then blindly call emit_line_0 with len=-1 which would
pass that value on to fwrite as SIZE_MAX. Boom.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: Fix git svn log --show-commitMichael J Gruber Fri, 20 May 2011 11:16:34 +0000 (13:16 +0200)

git-svn: Fix git svn log --show-commit

git svn log --show-commit had no tests and, consequently, no attention
by the author of

b1b4755 (git-log: put space after commit mark, 2011-03-10)

who kept git svn log working only without --show-commit.

Introduce a test and fix it.

Reported-by: Bernt Hansen <bernt@norang.ca>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.7.6Junio C Hamano Fri, 20 May 2011 03:50:07 +0000 (20:50 -0700)

Update draft release notes to 1.7.6

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

Merge branch 'jc/maint-1.7.4-pathspec-stdin-and-cmdline'Junio C Hamano Fri, 20 May 2011 04:02:14 +0000 (21:02 -0700)

Merge branch 'jc/maint-1.7.4-pathspec-stdin-and-cmdline'

* jc/maint-1.7.4-pathspec-stdin-and-cmdline:

Merge branch 'rg/copy-gecos-username'Junio C Hamano Fri, 20 May 2011 03:37:21 +0000 (20:37 -0700)

Merge branch 'rg/copy-gecos-username'

* rg/copy-gecos-username:
copy_gecos: fix not adding nlen to len when processing "&"

Merge branch 'jl/submodule-conflicted-gitmodules'Junio C Hamano Fri, 20 May 2011 03:37:21 +0000 (20:37 -0700)

Merge branch 'jl/submodule-conflicted-gitmodules'

* jl/submodule-conflicted-gitmodules:
Submodules: Don't parse .gitmodules when it contains, merge conflicts
test that git status works with merge conflict in, .gitmodules

Merge branch 'jc/replacing'Junio C Hamano Fri, 20 May 2011 03:37:21 +0000 (20:37 -0700)

Merge branch 'jc/replacing'

* jc/replacing:
read_sha1_file(): allow selective bypassing of replacement mechanism
inline lookup_replace_object() calls
read_sha1_file(): get rid of read_sha1_file_repl() madness
t6050: make sure we test not just commit replacement
Declare lookup_replace_object() in cache.h, not in commit.h

Conflicts:
environment.c

Merge branch 'nd/sparse-co-fix'Junio C Hamano Fri, 20 May 2011 03:37:21 +0000 (20:37 -0700)

Merge branch 'nd/sparse-co-fix'

* nd/sparse-co-fix:
sparse checkout: do not eagerly decide the fate for whole directory
t1011: fix sparse-checkout initialization and add new file

Merge branch 'ld/p4-preserve-user-names'Junio C Hamano Fri, 20 May 2011 03:37:20 +0000 (20:37 -0700)

Merge branch 'ld/p4-preserve-user-names'

* ld/p4-preserve-user-names:
git-p4: warn if git authorship won't be retained
git-p4: small improvements to user-preservation
git-p4: add option to preserve user names

Merge branch 'ms/tagname-does-not-begin-with-dash'Junio C Hamano Fri, 20 May 2011 03:37:20 +0000 (20:37 -0700)

Merge branch 'ms/tagname-does-not-begin-with-dash'

* ms/tagname-does-not-begin-with-dash:
tag: disallow '-' as tag name

Merge branch 'jk/git-connection-deadlock-fix'Junio C Hamano Fri, 20 May 2011 03:37:20 +0000 (20:37 -0700)

Merge branch 'jk/git-connection-deadlock-fix'

* jk/git-connection-deadlock-fix:
test core.gitproxy configuration
send-pack: avoid deadlock on git:// push with failed pack-objects
connect: let callers know if connection is a socket
connect: treat generic proxy processes like ssh processes

Conflicts:
connect.c

Merge branch 'js/maint-send-pack-stateless-rpc-deadlock... Junio C Hamano Fri, 20 May 2011 03:37:19 +0000 (20:37 -0700)

Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix'

* js/maint-send-pack-stateless-rpc-deadlock-fix:
sideband_demux(): fix decl-after-stmt

Merge branch 'jk/cherry-pick-root-with-resolve'Junio C Hamano Fri, 20 May 2011 03:37:19 +0000 (20:37 -0700)

Merge branch 'jk/cherry-pick-root-with-resolve'

* jk/cherry-pick-root-with-resolve:
t3503: test cherry picking and reverting root commits
revert: allow reverting a root commit
cherry-pick: handle root commits with external strategies

Merge branch 'jc/maint-pathspec-stdin-and-cmdline'Junio C Hamano Fri, 20 May 2011 03:37:18 +0000 (20:37 -0700)

Merge branch 'jc/maint-pathspec-stdin-and-cmdline'

* jc/maint-pathspec-stdin-and-cmdline:
setup_revisions(): take pathspec from command line and --stdin correctly

Conflicts:
revision.c

Merge 1.7.5.2 inJunio C Hamano Fri, 20 May 2011 03:37:08 +0000 (20:37 -0700)

Merge 1.7.5.2 in

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

Revert "Merge branch 'en/merge-recursive'"Junio C Hamano Fri, 20 May 2011 03:17:44 +0000 (20:17 -0700)

Revert "Merge branch 'en/merge-recursive'"

As the band-aid to merge-recursive seems to regress complex merges in an
unpleasant way. The merge-recursive implementation needs to be rewritten
in such a way that it resolves renames and D/F conflicts entirely in-core
and not to touch working tree at all while doing so. But in the meantime,
this reverts commit ac9666f84 that merged the topic in its entirety.

Git 1.7.5.2 v1.7.5.2Junio C Hamano Fri, 20 May 2011 03:30:44 +0000 (20:30 -0700)

Git 1.7.5.2

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

receive-pack: eliminate duplicate .have refsJeff King Thu, 19 May 2011 21:34:46 +0000 (17:34 -0400)

receive-pack: eliminate duplicate .have refs

When receiving a push, we advertise ref tips from any
alternate repositories, in case that helps the client send a
smaller pack. Since these refs don't actually exist in the
destination repository, we don't transmit the real ref
names, but instead use the pseudo-ref ".have".

If your alternate has a large number of duplicate refs (for
example, because it is aggregating objects from many related
repositories, some of which will have the same tags and
branch tips), then we will send each ".have $sha1" line
multiple times. This is a pointless waste of bandwidth, as
we are simply repeating the same fact to the client over and
over.

This patch eliminates duplicate .have refs early on. It does
so efficiently by sorting the complete list and skipping
duplicates. This has the side effect of re-ordering the
.have lines by ascending sha1; this isn't a problem, though,
as the original order was meaningless.

There is a similar .have system in fetch-pack, but it
does not suffer from the same problem. For each alternate
ref we consider in fetch-pack, we actually open the object
and mark it with the SEEN flag, so duplicates are
automatically culled.

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

bisect: refactor sha1_array into a generic sha1 listJeff King Thu, 19 May 2011 21:34:33 +0000 (17:34 -0400)

bisect: refactor sha1_array into a generic sha1 list

This is a generally useful abstraction, so let's let others
make use of it. The refactoring is more or less a straight
copy; however, functions and struct members have had their
names changed to match string_list, which is the most
similar data structure.

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

refactor refs_from_alternate_cb to allow passing extra... Jeff King Thu, 19 May 2011 21:33:17 +0000 (17:33 -0400)

refactor refs_from_alternate_cb to allow passing extra data

The foreach_alt_odb function triggers a callback for each
alternate object db we have, with room for a single void
pointer as data. Currently, we always call refs_from_alternate_cb
as the callback function, and then pass another callback (to
receive each ref individually) as the void pointer.

This has two problems:

1. C technically forbids stuffing a function pointer into
a "void *". In practice, this probably doesn't matter
on any architectures git runs on, but it never hurts to
follow the letter of the law.

2. There is no room for an extra data pointer. Indeed, the
alternate_ref_fn that refs_from_alternate_cb calls
takes a void* for data, but we always pass it NULL.

Instead, let's properly stuff our function pointer into a
data struct, which also leaves room for an extra
caller-supplied data pointer. And to keep things simple for
existing callers, let's make a for_each_alternate_ref
function that takes care of creating the extra struct.

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

Makefile: sort TEST_PROGRAMS listJeff King Thu, 19 May 2011 21:24:24 +0000 (17:24 -0400)

Makefile: sort TEST_PROGRAMS list

We usually keep these lists in sorted order, but the last
few entries were just tacked on the end.

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

fetch: avoid repeated commits in mark_completeJeff King Thu, 19 May 2011 20:48:51 +0000 (16:48 -0400)

fetch: avoid repeated commits in mark_complete

We add every local ref to a list so that we can mark them
and all of their ancestors back to a certain cutoff point.
However, if some refs point to the same commit, we will end
up adding them to the list many times.

Furthermore, since commit_lists are stored as linked lists,
we must do an O(n) traversal of the list in order to find
the right place to insert each commit. This makes building
the list O(n^2) in the number of refs.

For normal repositories, this isn't a big deal. We have a
few hundreds refs at most, and most of them are unique. But
consider an "alternates" repo that serves as an object
database for many other similar repos. For reachability, it
needs to keep a copy of the refs in each child repo. This
means it may have a large number of refs, many of which
point to the same commits.

By noting commits we have already added to the list, we can
shrink the size of "n" in such a repo to the number of
unique commits, which is on the order of what a normal repo
would contain (it's actually more than a normal repo, since child repos
may have branches at different states, but in practice it tends
to be much smaller than the list with duplicates).

Here are the results on one particular giant repo
(containing objects for all Rails forks on GitHub):

$ git for-each-ref | wc -l
112514

[before]
$ git fetch --no-tags ../remote.git
63.52user 0.12system 1:03.68elapsed 99%CPU (0avgtext+0avgdata 137648maxresident)k
1856inputs+48outputs (11major+19603minor)pagefaults 0swaps

$ git fetch --no-tags ../remote.git
6.15user 0.08system 0:06.25elapsed 99%CPU (0avgtext+0avgdata 123856maxresident)k
0inputs+40outputs (0major+18872minor)pagefaults 0swaps

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

ident: add NO_GECOS_IN_PWENT for systems without pw_gec... Rafael Gieschke Thu, 19 May 2011 11:37:55 +0000 (13:37 +0200)

ident: add NO_GECOS_IN_PWENT for systems without pw_gecos in struct passwd

Allow NO_GECOS_IN_PWENT to be defined in the Makefile for platforms that
lack the pw_gecos field in their "struct passwd", in which case the
uppercased user name is used instead via the standard '&' replacement
mechanism.

Signed-off-by: Rafael Gieschke <rafael@gieschke.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

provide a copy of the LGPLv2.1Jonathan Nieder Thu, 19 May 2011 15:14:25 +0000 (10:14 -0500)

provide a copy of the LGPLv2.1

The LGPL seems to require providing a copy of the license when
distributing xdiff, compat/fnmatch, and so on, or altering the license
notices to refer to the GPL intead. Since we don't want to do the
latter, let's do the former. It's nice to let people know their
rights anyway.

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

sha1_object_info_extended(): expose a bit more infoJunio C Hamano Thu, 12 May 2011 22:51:38 +0000 (15:51 -0700)

sha1_object_info_extended(): expose a bit more info

The original interface for sha1_object_info() takes an object name and
gives back a type and its size (the latter is given only when it was
asked). The new interface wraps its implementation and exposes a bit
more pieces of information that the interface used to discard, namely:

- where the object is stored (loose? cached? packed?)
- if packed, where in which packfile?

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

* In the earlier round, this used u.pack.delta to record the length of
the delta chain, but the caller is not necessarily interested in the
length of the delta chain per-se, but may only want to know if it is a
delta against another object or is stored as a deflated data. Calling
packed_object_info_detail() involves walking the reverse index chain to
compute the store size of the object and is unnecessarily expensive.

We could resurrect the code if a new caller wants to know, but I doubt
it.

show: --ignore-missingJunio C Hamano Thu, 19 May 2011 01:08:09 +0000 (18:08 -0700)

show: --ignore-missing

Instead of barfing, simply ignore bad object names seen in the
input. This is useful when reading from "git notes list" output
that may refer to objects that have already been garbage collected.

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

notes remove: --stdin reads from the standard inputJunio C Hamano Wed, 18 May 2011 23:44:30 +0000 (16:44 -0700)

notes remove: --stdin reads from the standard input

Teach the command to read object names to remove from the standard
input, in addition to the object names given from the command line.

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

notes remove: --ignore-missingJunio C Hamano Wed, 18 May 2011 23:02:58 +0000 (16:02 -0700)

notes remove: --ignore-missing

Depending on the application, it is not necessarily an error for an object
to lack a note, especially if the only thing the caller wants to make sure
is that notes are cleared for an object. By passing this option from the
command line, the "git notes remove" command considers it a success if the
object did not have any note to begin with.

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

notes remove: allow removing more than oneJunio C Hamano Wed, 18 May 2011 22:44:37 +0000 (15:44 -0700)

notes remove: allow removing more than one

While "xargs -n1 git notes rm" is certainly a possible way to remove notes
from many objects, this would create one notes "commit" per removal, which
is not quite suitable for seasonal housekeeping.

Allow taking more than one on the command line, and record their removal
as a single atomic event if everthing goes well.

Even though the old code insisted that "git notes rm" must be given only
one object (or zero, in which case it would default to HEAD), this
condition was not tested. Add tests to handle the new case where we feed
multiple objects, and also make sure if there is a bad input, no change
is recorded.

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

ls-remote: the --exit-code option reports "no matching... Michael Schubert Wed, 18 May 2011 20:06:00 +0000 (22:06 +0200)

ls-remote: the --exit-code option reports "no matching refs"

The "git ls-remote" uses its exit status to indicate if it successfully
talked with the remote repository. A new option "--exit-code" makes the
command exit with status "2" when there is no refs to be listed, even when
the command successfully talked with the remote repository.

This way, the caller can tell if we failed to contact the remote, or the
remote did not have what we wanted to see. Of course, you can inspect the
output from the command, which has been and will continue to be a valid
way to check the same thing.

Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Windows: add a wrapper for the shutdown() system callJohannes Sixt Wed, 18 May 2011 20:24:37 +0000 (22:24 +0200)

Windows: add a wrapper for the shutdown() system call

Even though Windows's socket functions look like their POSIX counter parts,
they do not operate on file descriptors, but on "socket objects". To bring
the functions in line with POSIX, we have proxy functions that wrap and
unwrap the socket objects in file descriptors using open_osfhandle and
get_osfhandle. But shutdown() was not proxied, yet. Fix this.

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

test core.gitproxy configurationJeff King Wed, 18 May 2011 08:57:44 +0000 (04:57 -0400)

test core.gitproxy configuration

This is just a basic sanity test to see whether
core.gitproxy works at all. Until now, we were not testing
anywhere.

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

Add log.abbrevCommit config variableJay Soffian Wed, 18 May 2011 17:56:04 +0000 (13:56 -0400)

Add log.abbrevCommit config variable

Add log.abbrevCommit config variable as a convenience for users who
often use --abbrev-commit with git log and friends. Allow the option
to be overridden with --no-abbrev-commit. Per 635530a2fc and 4f62c2bc57,
the config variable is ignored when log is given "--pretty=raw".

(Also, a drive-by spelling correction in git log's short help.)

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

"git log -h": typofix misspelled 'suppress'Jay Soffian Wed, 18 May 2011 17:56:04 +0000 (13:56 -0400)

"git log -h": typofix misspelled 'suppress'

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

copy_gecos: fix not adding nlen to len when processing "&"Rafael Gieschke Mon, 16 May 2011 20:08:21 +0000 (22:08 +0200)

copy_gecos: fix not adding nlen to len when processing "&"

nlen has to be added to len when inserting (capitalized) pw_name as
substitution for "&" in pw_gecos. Otherwise, pw_gecos will be truncated
and data might be written beyond name+sz.

Signed-off-by: Rafael Gieschke <rafael@gieschke.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

setup.c: Fix some "symbol not declared" sparse warningsRamsay Jones Tue, 17 May 2011 17:43:10 +0000 (18:43 +0100)

setup.c: Fix some "symbol not declared" sparse warnings

In particular, sparse issues the "symbol 'a_symbol' was not declared.
Should it be static?" warnings for the following symbols:

setup.c:159:3: 'pathspec_magic'
setup.c:176:12: 'prefix_pathspec'

These symbols only require file scope, so we add the static modifier
to their declarations.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>