* [RFC/PATCH 0/2] git diff <(command1) <(command2)
From: Dennis Kaarsemaker @ 2016-11-11 20:19 UTC (permalink / raw)
To: git; +Cc: Dennis Kaarsemaker
Today on #git, a user asked why git diff <(command1) <(command2) gave only some
gibberish about pipes as output. The answer is fairly simple: git diff gets as
arguments /dev/fd/62 and /dev/fd/63, which are symlinks. So git simply
readlink()s them and gets pipe:[123456] as destination of that link which it
then outputs.
Given that 'normal' diff provides arguably better output in this case (a diff
of the output of the two commands), I wanted to look at what it would take for
git to handle this. Surprisingly: not much. 1/2 adds support for
--follow-symlinks to git diff --no-index (and only the --no-index variant) and
2/2 adds support for reading from pipes.
No tests or documentation updates yet, and I'm not sure whether
--follow-symlinks in other modes than --no-index should be supported, ignored
(as it is now) or cause an error, but I'm leaning towards the third option.
Dennis Kaarsemaker (2):
diff --no-index: add option to follow symlinks
diff --no-index: support reading from pipes
diff-no-index.c | 15 ++++++++++++---
diff.c | 23 +++++++++++++++++++----
diff.h | 2 +-
3 files changed, 32 insertions(+), 8 deletions(-)
--
2.10.1-449-gab0f84c
^ permalink raw reply
* Re: [RFC] Add way to make Git credentials accessible from clean/smudge filter
From: Dennis Kaarsemaker @ 2016-11-11 20:02 UTC (permalink / raw)
To: Lars Schneider, Jeff King; +Cc: Matthieu Moy, git, me
In-Reply-To: <4060C484-B42E-42AB-BB42-4753373F0E7F@gmail.com>
On Fri, 2016-11-11 at 10:40 +0100, Lars Schneider wrote:
> On 11 Nov 2016, at 10:31, Jeff King <peff@peff.net> wrote:
>
> > On Fri, Nov 11, 2016 at 10:28:56AM +0100, Lars Schneider wrote:
> >
> > > > Yeah, that is the solution I was going to suggest. The credentials are
> > > > totally orthogonal to the filters, and I would rather not shove them
> > > > into the protocol. It's an extra process, but with the new multi-use
> > > > smudge filter, it's one per git invocation, not one per file.
> > >
> > >
> > > The trouble with "git credential" is that it works only if the credential
> > > helper is setup correctly. Although I assume that most people have setup this,
> > > I have also worked with a number of people who prefer to enter their passwords
> > > every time Git makes a network connection.
> >
> >
> > Are you sure about that? If I do:
> >
> > echo url=https://example.com/repo.git |
> > git credential fill
> >
> > I get prompted for a username and password.
>
>
> Hm.. either I don't understand you or I expressed myself unclear.
>
> Let's say a user runs:
>
> $ git clone https://myrepo.git
>
> If no credential helper is setup, then Git asks the user for credentials.
> Afterwards Git starts downloading stuff. At some point Git will run my
> smudge filter on some files and in my case the smudge filter needs the
> Git credentials. AFAIK, the smudge filter has no way to get the credentials
> from Git at this point - not even by invoking "git credential".
> Is this correct?
I think that's correct, but the same argument goes both ways: unless I
use a credential helper, or explicitely give a filter application my
credentials, I don't want a helper to be able to get to those
credentials. I'd consider that a security bug.
D.
^ permalink raw reply
* Re: [PATCH] t0021, t5615: use $PWD instead of $(pwd) in PATH-like shell variables
From: Junio C Hamano @ 2016-11-11 18:55 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Johannes Schindelin, git, Jeff King
In-Reply-To: <2b69d098-92ef-77b0-367a-516e9edbe257@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
> We have to use $PWD instead of $(pwd) because on Windows the latter
> would add a C: style path to bash's Unix-style $PATH variable, which
> becomes confused by the colon after the drive letter. ($PWD is a
> Unix-style path.)
>
> In the case of GIT_ALTERNATE_OBJECT_DIRECTORIES, bash on Windows
> assembles a Unix-style path list with the colon as separators. It
> converts the value to a Windows-style path list with the semicolon as
> path separator when it forwards the variable to git.exe. The same
> confusion happens when bash's original value is contaminated with
> Windows style paths.
>
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
> Am 11.11.2016 um 18:11 schrieb Johannes Sixt:
>> Am 11.11.2016 um 18:06 schrieb Junio C Hamano:
>>> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
>>> ...
>
> When the MSYS program such as bash invokes a non-MSYS program, it
> translates the Unix-style paths in arguments and environment variables
> to Windows stlye. We only have to ensure that we inject only Unix-style
> paths in these places so as not to confuse the conversion algorithm.
> Most of the time, we do not have to worry.
>
> On the other hand, when we write a path to a file that git.exe consumes
> or receive a path from git.exe, i.e., when the path travels through
> stdout and stdin, no automatic translation happens (which is quite
> understandable), and we have do the translation explicitly. An example
> for such a case is when we write a .git/info/alternates file via the
> shell.
>
>> A simpler fix is to use $PWD instead of $(pwd). I'll submit a patch in a
>> moment.
>
> Here it is. I had proposed the t0021 part earlier, but it fell through
> the cracks during the temporary maintainer change.
Thanks. Dscho, does this fix both of these issues to you?
> t/t0021-conversion.sh | 2 +-
> t/t5615-alternate-env.sh | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
> index 9ff502773d..b93cd44546 100755
> --- a/t/t0021-conversion.sh
> +++ b/t/t0021-conversion.sh
> @@ -4,7 +4,7 @@ test_description='blob conversion via gitattributes'
>
> . ./test-lib.sh
>
> -TEST_ROOT="$(pwd)"
> +TEST_ROOT="$PWD"
> PATH=$TEST_ROOT:$PATH
>
> write_script <<\EOF "$TEST_ROOT/rot13.sh"
> diff --git a/t/t5615-alternate-env.sh b/t/t5615-alternate-env.sh
> index 22d9d8178b..eec4137ca5 100755
> --- a/t/t5615-alternate-env.sh
> +++ b/t/t5615-alternate-env.sh
> @@ -31,14 +31,14 @@ test_expect_success 'objects inaccessible without alternates' '
> '
>
> test_expect_success 'access alternate via absolute path' '
> - check_obj "$(pwd)/one.git/objects" <<-EOF
> + check_obj "$PWD/one.git/objects" <<-EOF
> $one blob
> $two missing
> EOF
> '
>
> test_expect_success 'access multiple alternates' '
> - check_obj "$(pwd)/one.git/objects:$(pwd)/two.git/objects" <<-EOF
> + check_obj "$PWD/one.git/objects:$PWD/two.git/objects" <<-EOF
> $one blob
> $two blob
> EOF
^ permalink raw reply
* Re: [git-for-windows] [ANNOUNCE] Prerelease: Git for Windows v2.11.0-rc0
From: Johannes Schindelin @ 2016-11-11 18:37 UTC (permalink / raw)
To: Lars Schneider; +Cc: git-for-windows, Git Mailing List, me
In-Reply-To: <F2B1E33E-3C31-45A3-8A5B-098A59CD399D@gmail.com>
Hi Lars,
On Fri, 11 Nov 2016, Lars Schneider wrote:
>
> On 10 Nov 2016, at 22:39, Johannes Schindelin <johannes.schindelin@gmx.de> wrote:
>
> > Hi Lars,
> >
> > On Wed, 9 Nov 2016, Lars Schneider wrote:
> >
> >> On 05 Nov 2016, at 10:50, Johannes Schindelin <johannes.schindelin@gmx.de> wrote:
> >>
> >>> I finally got around to rebase the Windows-specific patches (which seem to
> >>> not make it upstream as fast as we get new ones) on top of upstream Git
> >>> v2.11.0-rc0, and to bundle installers, portable Git and MinGit [*1*]:
> >>>
> >>> https://github.com/git-for-windows/git/releases/tag/v2.11.0-rc0.windows.1
> >>
> >>
> >> I tested a new feature in 2.11 on Windows today and it failed. After some
> >> confusion I realized that the feature is not on your 2.11 branch.
> >
> > Oops. That must have been a major snafu on my side, very sorry for that.
> >
> > I just tagged v2.11.0-rc0.windows.2 in https://github.com/dscho/git and
> > will make a new prerelease tomorrow.
>
> No worries! I am looking forward to the new release!
>
> For some reason my own build of Git for Windows cannot use HTTPS properly.
> I need to debug this further at some point.
Here it is:
https://github.com/git-for-windows/git/releases/tag/v2.11.0-rc0.windows.2
Thanks for catching my snafu,
Dscho
^ permalink raw reply
* Re: [ANNOUNCE] Prerelease: Git for Windows v2.11.0-rc0
From: Johannes Schindelin @ 2016-11-11 18:33 UTC (permalink / raw)
To: stefan.naewe; +Cc: git-for-windows, git
In-Reply-To: <alpine.DEB.2.20.1611111750580.3746@virtualbox>
Hi Stefan,
On Fri, 11 Nov 2016, Johannes Schindelin wrote:
> Will keep you posted,
I published the prerelease:
https://github.com/git-for-windows/git/releases/tag/v2.11.0-rc0.windows.2
Thanks,
Dscho
^ permalink raw reply
* Re: [PATCH] t0021, t5615: use $PWD instead of $(pwd) in PATH-like shell variables
From: Jeff King @ 2016-11-11 18:16 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Junio C Hamano, Johannes Schindelin, git
In-Reply-To: <2b69d098-92ef-77b0-367a-516e9edbe257@kdbg.org>
On Fri, Nov 11, 2016 at 06:31:48PM +0100, Johannes Sixt wrote:
> We have to use $PWD instead of $(pwd) because on Windows the latter
> would add a C: style path to bash's Unix-style $PATH variable, which
> becomes confused by the colon after the drive letter. ($PWD is a
> Unix-style path.)
>
> In the case of GIT_ALTERNATE_OBJECT_DIRECTORIES, bash on Windows
> assembles a Unix-style path list with the colon as separators. It
> converts the value to a Windows-style path list with the semicolon as
> path separator when it forwards the variable to git.exe. The same
> confusion happens when bash's original value is contaminated with
> Windows style paths.
So on reading your original I wondered why you did not need to use the
";", and that explains it. But wow, it's subtle.
I don't know what people typically write in the wild, and if it's worth
actually testing explicitly the ";" case. I'll leave that to Windows
people to debate.
-Peff
^ permalink raw reply
* Re: [PATCH] mingw: hot-fix t5615
From: Jeff King @ 2016-11-11 18:12 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, Junio C Hamano
In-Reply-To: <f4336a7fa3df8c0b426c3d01ada8d7d8f38e588a.1478881741.git.johannes.schindelin@gmx.de>
On Fri, Nov 11, 2016 at 05:29:33PM +0100, Johannes Schindelin wrote:
> That test made the incorrect assumption that the path separator character
> is always a colon. On Windows, it is a semicolon instead.
Oof, sorry about that. I remember being careful about the ";" while
doing the original alt-odb work, but forgot about it while making the
recent fix in 37a95862c.
The patch itself looks like obviously correct (or at least obviously in
the right direction, since it sounds like more is needed).
-Peff
^ permalink raw reply
* Re: 2.11.0-rc1 will not be tagged for a few days
From: Junio C Hamano @ 2016-11-11 17:41 UTC (permalink / raw)
To: Lars Schneider; +Cc: Johannes Schindelin, git
In-Reply-To: <4FF1825D-F699-4532-9B53-A673DFF00D8B@gmail.com>
Lars Schneider <larsxschneider@gmail.com> writes:
> Part of the reason is that Hannes' squash got lost:
> http://public-inbox.org/git/d36d8b51-f2d7-a2f5-89ea-369f49556e10@kdbg.org/
>
> @Junio: Can you apply this (see discussion with Peff linked to email above).
Thanks for a quick and usable report followed by a quick fix.
^ permalink raw reply
* Re: 2.11.0-rc1 will not be tagged for a few days
From: Lars Schneider @ 2016-11-11 17:38 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
In-Reply-To: <89DB812E-EC29-4D12-97EA-6E8FF6F86FE5@gmail.com>
> On 11 Nov 2016, at 18:31, Lars Schneider <larsxschneider@gmail.com> wrote:
>
>>
>> On 11 Nov 2016, at 18:05, Lars Schneider <larsxschneider@gmail.com> wrote:
>>
>>
>>> On 11 Nov 2016, at 17:13, Johannes Schindelin <johannes.schindelin@gmx.de> wrote:
>>>
>>> Hi Junio,
>>>
>>> On Thu, 10 Nov 2016, Junio C Hamano wrote:
>>>
>>>> Junio C Hamano <gitster@pobox.com> writes:
>>>>
>>>>> I'll report back an updated schedule when able.
>>>>
>>>> I pushed some updates out on 'master' today.
>>>
>>> Which means that t0021 is now broken also on `master` when running in Git
>>> for Windows' SDK.
>>
>> Part of the reason is that Hannes' squash got lost:
>> http://public-inbox.org/git/d36d8b51-f2d7-a2f5-89ea-369f49556e10@kdbg.org/
>>
>> @Junio: Can you apply this (see discussion with Peff linked to email above).
>>
>> @Dscho:
>> There is still one remaining new issue with t0021 ... investigating!
>
> "17 - required process filter should be used only for "clean" operation only"
> seems flaky.
>
> I don't have any more time today but I will look into it tomorrow.
FWIW: This patch (which would be the right thing to do anyways) seems to fix
the flakyness but I can't be sure ... it needs to run longer...
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index 9ff5027..107766b 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -29,8 +29,7 @@ file_size () {
filter_git () {
rm -f rot13-filter.log &&
- git "$@" 2>git-stderr.log &&
- rm -f git-stderr.log
+ git "$@" 2>/dev/null
}
# Compare two files and ensure that `clean` and `smudge` respectively are
^ permalink raw reply related
* [PATCH] t0021, t5615: use $PWD instead of $(pwd) in PATH-like shell variables
From: Johannes Sixt @ 2016-11-11 17:31 UTC (permalink / raw)
To: Junio C Hamano, Johannes Schindelin; +Cc: git, Jeff King
In-Reply-To: <fa11def5-a878-a5c8-6e7b-627ea8cda7e2@kdbg.org>
We have to use $PWD instead of $(pwd) because on Windows the latter
would add a C: style path to bash's Unix-style $PATH variable, which
becomes confused by the colon after the drive letter. ($PWD is a
Unix-style path.)
In the case of GIT_ALTERNATE_OBJECT_DIRECTORIES, bash on Windows
assembles a Unix-style path list with the colon as separators. It
converts the value to a Windows-style path list with the semicolon as
path separator when it forwards the variable to git.exe. The same
confusion happens when bash's original value is contaminated with
Windows style paths.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
Am 11.11.2016 um 18:11 schrieb Johannes Sixt:
> Am 11.11.2016 um 18:06 schrieb Junio C Hamano:
>> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
>>
>>> That test made the incorrect assumption that the path separator
>>> character
>>> is always a colon. On Windows, it is a semicolon instead.
>>
>> Documentation/git.txt says that GIT_ALTERNATE_OBJECT_DIRECTORIES is
>> separated with ";" on Windows fairly clearly, and we should have
>> caught that.
>>
>> For the upcoming release there is no need for any further tweak on
>> your fix I am responding to, but in the longer term we would want to
>> turn this to path_sep=";" (or ":") and define it in the global
>> t/test-lib.sh, as it is plausible that we may want to prepend or
>> append to $PATH in the tests and that also needs ";" on Windows, no?
When the MSYS program such as bash invokes a non-MSYS program, it
translates the Unix-style paths in arguments and environment variables
to Windows stlye. We only have to ensure that we inject only Unix-style
paths in these places so as not to confuse the conversion algorithm.
Most of the time, we do not have to worry.
On the other hand, when we write a path to a file that git.exe consumes
or receive a path from git.exe, i.e., when the path travels through
stdout and stdin, no automatic translation happens (which is quite
understandable), and we have do the translation explicitly. An example
for such a case is when we write a .git/info/alternates file via the
shell.
> A simpler fix is to use $PWD instead of $(pwd). I'll submit a patch in a
> moment.
Here it is. I had proposed the t0021 part earlier, but it fell through
the cracks during the temporary maintainer change.
t/t0021-conversion.sh | 2 +-
t/t5615-alternate-env.sh | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index 9ff502773d..b93cd44546 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -4,7 +4,7 @@ test_description='blob conversion via gitattributes'
. ./test-lib.sh
-TEST_ROOT="$(pwd)"
+TEST_ROOT="$PWD"
PATH=$TEST_ROOT:$PATH
write_script <<\EOF "$TEST_ROOT/rot13.sh"
diff --git a/t/t5615-alternate-env.sh b/t/t5615-alternate-env.sh
index 22d9d8178b..eec4137ca5 100755
--- a/t/t5615-alternate-env.sh
+++ b/t/t5615-alternate-env.sh
@@ -31,14 +31,14 @@ test_expect_success 'objects inaccessible without alternates' '
'
test_expect_success 'access alternate via absolute path' '
- check_obj "$(pwd)/one.git/objects" <<-EOF
+ check_obj "$PWD/one.git/objects" <<-EOF
$one blob
$two missing
EOF
'
test_expect_success 'access multiple alternates' '
- check_obj "$(pwd)/one.git/objects:$(pwd)/two.git/objects" <<-EOF
+ check_obj "$PWD/one.git/objects:$PWD/two.git/objects" <<-EOF
$one blob
$two blob
EOF
--
2.11.0.rc0.55.gd967357
^ permalink raw reply related
* Re: 2.11.0-rc1 will not be tagged for a few days
From: Lars Schneider @ 2016-11-11 17:31 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
In-Reply-To: <4FF1825D-F699-4532-9B53-A673DFF00D8B@gmail.com>
> On 11 Nov 2016, at 18:05, Lars Schneider <larsxschneider@gmail.com> wrote:
>
>
>> On 11 Nov 2016, at 17:13, Johannes Schindelin <johannes.schindelin@gmx.de> wrote:
>>
>> Hi Junio,
>>
>> On Thu, 10 Nov 2016, Junio C Hamano wrote:
>>
>>> Junio C Hamano <gitster@pobox.com> writes:
>>>
>>>> I'll report back an updated schedule when able.
>>>
>>> I pushed some updates out on 'master' today.
>>
>> Which means that t0021 is now broken also on `master` when running in Git
>> for Windows' SDK.
>
> Part of the reason is that Hannes' squash got lost:
> http://public-inbox.org/git/d36d8b51-f2d7-a2f5-89ea-369f49556e10@kdbg.org/
>
> @Junio: Can you apply this (see discussion with Peff linked to email above).
>
> @Dscho:
> There is still one remaining new issue with t0021 ... investigating!
"17 - required process filter should be used only for "clean" operation only"
seems flaky.
I don't have any more time today but I will look into it tomorrow.
- Lars
^ permalink raw reply
* [PATCH v2] upload-pack: Optionally allow fetching any sha1
From: David Turner @ 2016-11-11 17:23 UTC (permalink / raw)
To: git, spearce; +Cc: David Turner
It seems a little silly to do a reachabilty check in the case where we
trust the user to access absolutely everything in the repository.
Also, it's racy in a distributed system -- perhaps one server
advertises a ref, but another has since had a force-push to that ref,
and perhaps the two HTTP requests end up directed to these different
servers.
Signed-off-by: David Turner <dturner@twosigma.com>
---
Actually, I realized as forgot the doco. Sorry.
Documentation/config.txt | 5 +++++
Documentation/git-fetch-pack.txt | 6 +++---
t/t5551-http-fetch-smart.sh | 22 ++++++++++++++++++++++
upload-pack.c | 10 +++++++++-
4 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index a0ab66a..b7f9991 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -2961,6 +2961,11 @@ uploadpack.allowReachableSHA1InWant::
calculating object reachability is computationally expensive.
Defaults to `false`.
+uploadpack.allowAnySHA1InWant::
+ Allow `upload-pack` to accept a fetch request that asks for any
+ object at all.
+ Defaults to `false`.
+
uploadpack.keepAlive::
When `upload-pack` has started `pack-objects`, there may be a
quiet period while `pack-objects` prepares the pack. Normally
diff --git a/Documentation/git-fetch-pack.txt b/Documentation/git-fetch-pack.txt
index d45f6ad..f7ebe36 100644
--- a/Documentation/git-fetch-pack.txt
+++ b/Documentation/git-fetch-pack.txt
@@ -119,9 +119,9 @@ be in a separate packet, and the list must end with a flush packet.
$GIT_DIR (e.g. "HEAD", "refs/heads/master"). When
unspecified, update from all heads the remote side has.
+
-If the remote has enabled the options `uploadpack.allowTipSHA1InWant` or
-`uploadpack.allowReachableSHA1InWant`, they may alternatively be 40-hex
-sha1s present on the remote.
+If the remote has enabled the options `uploadpack.allowTipSHA1InWant`,
+`uploadpack.allowReachableSHA1InWant`, or `uploadpack.allowAnySHA1InWant`,
+they may alternatively be 40-hex sha1s present on the remote.
SEE ALSO
--------
diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index 43665ab..8d3db40 100755
--- a/t/t5551-http-fetch-smart.sh
+++ b/t/t5551-http-fetch-smart.sh
@@ -306,6 +306,28 @@ test_expect_success 'test allowreachablesha1inwant with unreachable' '
test_must_fail git -C test_reachable.git fetch origin "$(git rev-parse HEAD)"
'
+test_expect_success 'test allowanysha1inwant with unreachable' '
+ test_when_finished "rm -rf test_reachable.git; git reset --hard $(git rev-parse HEAD)" &&
+
+ #create unreachable sha
+ echo content >file2 &&
+ git add file2 &&
+ git commit -m two &&
+ git push public HEAD:refs/heads/doomed &&
+ git push public :refs/heads/doomed &&
+
+ server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+ master_sha=$(git -C "$server" rev-parse refs/heads/master) &&
+ git -C "$server" config uploadpack.allowreachablesha1inwant 1 &&
+
+ git init --bare test_reachable.git &&
+ git -C test_reachable.git remote add origin "$HTTPD_URL/smart/repo.git" &&
+ test_must_fail git -C test_reachable.git fetch origin "$(git rev-parse HEAD)" &&
+
+ git -C "$server" config uploadpack.allowanysha1inwant 1 &&
+ git -C test_reachable.git fetch origin "$(git rev-parse HEAD)"
+'
+
test_expect_success EXPENSIVE 'http can handle enormous ref negotiation' '
(
cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
diff --git a/upload-pack.c b/upload-pack.c
index e0db8b4..7597ba3 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -46,6 +46,8 @@ static int no_progress, daemon_mode;
#define ALLOW_TIP_SHA1 01
/* Allow request of a sha1 if it is reachable from a ref (possibly hidden ref). */
#define ALLOW_REACHABLE_SHA1 02
+/* Allow request of any sha1. Implies ALLOW_TIP_SHA1 and ALLOW_REACHABLE_SHA1. */
+#define ALLOW_ANY_SHA1 07
static unsigned int allow_unadvertised_object_request;
static int shallow_nr;
static struct object_array have_obj;
@@ -825,7 +827,8 @@ static void receive_needs(void)
sha1_to_hex(sha1_buf));
if (!(o->flags & WANTED)) {
o->flags |= WANTED;
- if (!is_our_ref(o))
+ if (!((allow_unadvertised_object_request & ALLOW_ANY_SHA1) == ALLOW_ANY_SHA1
+ || is_our_ref(o)))
has_non_tip = 1;
add_object_array(o, NULL, &want_obj);
}
@@ -1008,6 +1011,11 @@ static int upload_pack_config(const char *var, const char *value, void *unused)
allow_unadvertised_object_request |= ALLOW_REACHABLE_SHA1;
else
allow_unadvertised_object_request &= ~ALLOW_REACHABLE_SHA1;
+ } else if (!strcmp("uploadpack.allowanysha1inwant", var)) {
+ if (git_config_bool(var, value))
+ allow_unadvertised_object_request |= ALLOW_ANY_SHA1;
+ else
+ allow_unadvertised_object_request &= ~ALLOW_ANY_SHA1;
} else if (!strcmp("uploadpack.keepalive", var)) {
keepalive = git_config_int(var, value);
if (!keepalive)
--
2.8.0.rc4.22.g8ae061a
^ permalink raw reply related
* [PATCH] fetch-pack.c: correct command at the beginning of an error message
From: Ralf Thielow @ 2016-11-11 17:21 UTC (permalink / raw)
To: git; +Cc: gitster, Ralf Thielow
One error message in fetch-pack.c uses 'git fetch_pack' at the beginning
which is not a git command. Use 'git fetch-pack' instead.
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
---
fetch-pack.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fetch-pack.c b/fetch-pack.c
index cb45c346e..601f0779a 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -240,7 +240,7 @@ static enum ack_type get_ack(int fd, unsigned char *result_sha1)
return ACK;
}
}
- die(_("git fetch_pack: expected ACK/NAK, got '%s'"), line);
+ die(_("git fetch-pack: expected ACK/NAK, got '%s'"), line);
}
static void send_request(struct fetch_pack_args *args,
--
2.11.0.rc0.151.gf7463a1
^ permalink raw reply related
* Re: [PATCH] mingw: hot-fix t5615
From: Johannes Sixt @ 2016-11-11 17:11 UTC (permalink / raw)
To: Junio C Hamano, Johannes Schindelin; +Cc: git, Jeff King
In-Reply-To: <xmqq37iy3q0s.fsf@gitster.mtv.corp.google.com>
Am 11.11.2016 um 18:06 schrieb Junio C Hamano:
> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
>
>> That test made the incorrect assumption that the path separator character
>> is always a colon. On Windows, it is a semicolon instead.
>
> Documentation/git.txt says that GIT_ALTERNATE_OBJECT_DIRECTORIES is
> separated with ";" on Windows fairly clearly, and we should have
> caught that.
>
> For the upcoming release there is no need for any further tweak on
> your fix I am responding to, but in the longer term we would want to
> turn this to path_sep=";" (or ":") and define it in the global
> t/test-lib.sh, as it is plausible that we may want to prepend or
> append to $PATH in the tests and that also needs ";" on Windows, no?
>
> Are there other variables that is a list of paths that we care in
> our tests? I notice GIT_CEILING_DIRECTORIES does not have the
> corresponding ": separated (on windows ; separated) list" in its
> description in Documentation/git.txt but the documentation may need
> to be fixed there as well?
>
> Thanks for a quick fix. Will apply on jk/alt-odb-cleanup and merge
> down.
A simpler fix is to use $PWD instead of $(pwd). I'll submit a patch in a
moment.
-- Hannes
^ permalink raw reply
* Re: [PATCH] mingw: hot-fix t5615
From: Junio C Hamano @ 2016-11-11 17:06 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, Jeff King
In-Reply-To: <f4336a7fa3df8c0b426c3d01ada8d7d8f38e588a.1478881741.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> That test made the incorrect assumption that the path separator character
> is always a colon. On Windows, it is a semicolon instead.
Documentation/git.txt says that GIT_ALTERNATE_OBJECT_DIRECTORIES is
separated with ";" on Windows fairly clearly, and we should have
caught that.
For the upcoming release there is no need for any further tweak on
your fix I am responding to, but in the longer term we would want to
turn this to path_sep=";" (or ":") and define it in the global
t/test-lib.sh, as it is plausible that we may want to prepend or
append to $PATH in the tests and that also needs ";" on Windows, no?
Are there other variables that is a list of paths that we care in
our tests? I notice GIT_CEILING_DIRECTORIES does not have the
corresponding ": separated (on windows ; separated) list" in its
description in Documentation/git.txt but the documentation may need
to be fixed there as well?
Thanks for a quick fix. Will apply on jk/alt-odb-cleanup and merge
down.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> Published-As: https://github.com/dscho/git/releases/tag/t5615-path-separator-v1
> Fetch-It-Via: git fetch https://github.com/dscho/git t5615-path-separator-v1
>
> This is required, but not sufficient, to fix `master` on Windows.
>
> t/t5615-alternate-env.sh | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/t/t5615-alternate-env.sh b/t/t5615-alternate-env.sh
> index 22d9d81..3aeffb6 100755
> --- a/t/t5615-alternate-env.sh
> +++ b/t/t5615-alternate-env.sh
> @@ -37,8 +37,10 @@ test_expect_success 'access alternate via absolute path' '
> EOF
> '
>
> +sep=:
> +test_have_prereq !MINGW || sep=\;
> test_expect_success 'access multiple alternates' '
> - check_obj "$(pwd)/one.git/objects:$(pwd)/two.git/objects" <<-EOF
> + check_obj "$(pwd)/one.git/objects$sep$(pwd)/two.git/objects" <<-EOF
> $one blob
> $two blob
> EOF
>
> base-commit: 0538b84027a8aba7e8b805e3ec8fceb3990023e5
^ permalink raw reply
* Re: 2.11.0-rc1 will not be tagged for a few days
From: Lars Schneider @ 2016-11-11 17:05 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
In-Reply-To: <alpine.DEB.2.20.1611111711210.3746@virtualbox>
> On 11 Nov 2016, at 17:13, Johannes Schindelin <johannes.schindelin@gmx.de> wrote:
>
> Hi Junio,
>
> On Thu, 10 Nov 2016, Junio C Hamano wrote:
>
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>>> I'll report back an updated schedule when able.
>>
>> I pushed some updates out on 'master' today.
>
> Which means that t0021 is now broken also on `master` when running in Git
> for Windows' SDK.
Part of the reason is that Hannes' squash got lost:
http://public-inbox.org/git/d36d8b51-f2d7-a2f5-89ea-369f49556e10@kdbg.org/
@Junio: Can you apply this (see discussion with Peff linked to email above).
@Dscho:
There is still one remaining new issue with t0021 ... investigating!
> To add insult to injury, t5615 is now broken, too. I do not recall it
> being broken in any of my CI builds in any of the integration branches
> before.
Confirmed on my machine.
- Lars
^ permalink raw reply
* Re: 2.11.0-rc1 will not be tagged for a few days
From: Johannes Schindelin @ 2016-11-11 17:02 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <alpine.DEB.2.20.1611111711210.3746@virtualbox>
Hi,
On Fri, 11 Nov 2016, Johannes Schindelin wrote:
> On Thu, 10 Nov 2016, Junio C Hamano wrote:
>
> > Junio C Hamano <gitster@pobox.com> writes:
> >
> > > I'll report back an updated schedule when able.
> >
> > I pushed some updates out on 'master' today.
>
> Which means that t0021 is now broken also on `master` when running in Git
> for Windows' SDK.
To be precise, it says:
# failed 7 among 23 test(s)
Running with -i -v -x shows that the first broken test is this one:
-- snipsnap --
expecting success:
test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
test_config_global filter.protocol.required true &&
rm -rf repo &&
mkdir repo &&
(
cd repo &&
git init &&
echo "git-stderr.log" >.gitignore &&
echo "*.r filter=protocol" >.gitattributes &&
git add . &&
git commit . -m "test commit 1" &&
git branch empty-branch &&
cp "$TEST_ROOT/test.o" test.r &&
cp "$TEST_ROOT/test2.o" test2.r &&
mkdir testsubdir &&
cp "$TEST_ROOT/test3 'sq',\$x.o" "testsubdir/test3 'sq',\$x.r" &&
>test4-empty.r &&
S=$(file_size test.r) &&
S2=$(file_size test2.r) &&
S3=$(file_size "testsubdir/test3 'sq',\$x.r") &&
filter_git add . &&
cat >expected.log <<-EOF &&
START
init handshake complete
IN: clean test.r $S [OK] -- OUT: $S . [OK]
IN: clean test2.r $S2 [OK] -- OUT: $S2 . [OK]
IN: clean test4-empty.r 0 [OK] -- OUT: 0 [OK]
IN: clean testsubdir/test3 'sq',\$x.r $S3 [OK] -- OUT: $S3 . [OK]
STOP
EOF
test_cmp_count expected.log rot13-filter.log &&
filter_git commit . -m "test commit 2" &&
cat >expected.log <<-EOF &&
START
init handshake complete
IN: clean test.r $S [OK] -- OUT: $S . [OK]
IN: clean test2.r $S2 [OK] -- OUT: $S2 . [OK]
IN: clean test4-empty.r 0 [OK] -- OUT: 0 [OK]
IN: clean testsubdir/test3 'sq',\$x.r $S3 [OK] -- OUT: $S3 . [OK]
IN: clean test.r $S [OK] -- OUT: $S . [OK]
IN: clean test2.r $S2 [OK] -- OUT: $S2 . [OK]
IN: clean test4-empty.r 0 [OK] -- OUT: 0 [OK]
IN: clean testsubdir/test3 'sq',\$x.r $S3 [OK] -- OUT: $S3 . [OK]
STOP
EOF
test_cmp_count expected.log rot13-filter.log &&
rm -f test2.r "testsubdir/test3 'sq',\$x.r" &&
filter_git checkout --quiet --no-progress . &&
cat >expected.log <<-EOF &&
START
init handshake complete
IN: smudge test2.r $S2 [OK] -- OUT: $S2 . [OK]
IN: smudge testsubdir/test3 'sq',\$x.r $S3 [OK] -- OUT: $S3 . [OK]
STOP
EOF
test_cmp_exclude_clean expected.log rot13-filter.log &&
filter_git checkout --quiet --no-progress empty-branch &&
cat >expected.log <<-EOF &&
START
init handshake complete
IN: clean test.r $S [OK] -- OUT: $S . [OK]
STOP
EOF
test_cmp_exclude_clean expected.log rot13-filter.log &&
filter_git checkout --quiet --no-progress master &&
cat >expected.log <<-EOF &&
START
init handshake complete
IN: smudge test.r $S [OK] -- OUT: $S . [OK]
IN: smudge test2.r $S2 [OK] -- OUT: $S2 . [OK]
IN: smudge test4-empty.r 0 [OK] -- OUT: 0 [OK]
IN: smudge testsubdir/test3 'sq',\$x.r $S3 [OK] -- OUT: $S3 . [OK]
STOP
EOF
test_cmp_exclude_clean expected.log rot13-filter.log &&
test_cmp_committed_rot13 "$TEST_ROOT/test.o" test.r &&
test_cmp_committed_rot13 "$TEST_ROOT/test2.o" test2.r &&
test_cmp_committed_rot13 "$TEST_ROOT/test3 'sq',\$x.o" "testsubdir/test3 'sq',\$x.r"
)
++ test_config_global filter.protocol.process 'rot13-filter.pl clean smudge'
++ test_when_finished 'test_unconfig --global '\''filter.protocol.process'\'''
++ test 0 = 0
++ test_cleanup='{ test_unconfig --global '\''filter.protocol.process'\''
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git config --global filter.protocol.process 'rot13-filter.pl clean smudge'
++ test_config_global filter.protocol.required true
++ test_when_finished 'test_unconfig --global '\''filter.protocol.required'\'''
++ test 0 = 0
++ test_cleanup='{ test_unconfig --global '\''filter.protocol.required'\''
} && (exit "$eval_ret"); eval_ret=$?; { test_unconfig --global '\''filter.protocol.process'\''
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git config --global filter.protocol.required true
++ rm -rf repo
++ mkdir repo
++ cd repo
++ git init
Initialized empty Git repository in C:/git-sdk-64/usr/src/git/wip2/t/trash directory.t0021-conversion/repo/.git/
++ echo git-stderr.log
++ echo '*.r filter=protocol'
++ git add .
++ git commit . -m 'test commit 1'
[master (root-commit) aa5dd37] test commit 1
Author: A U Thor <author@example.com>
2 files changed, 2 insertions(+)
create mode 100644 .gitattributes
create mode 100644 .gitignore
++ git branch empty-branch
++ cp 'C:/git-sdk-64/usr/src/git/wip2/t/trash directory.t0021-conversion/test.o' test.r
++ cp 'C:/git-sdk-64/usr/src/git/wip2/t/trash directory.t0021-conversion/test2.o' test2.r
++ mkdir testsubdir
++ cp 'C:/git-sdk-64/usr/src/git/wip2/t/trash directory.t0021-conversion/test3 '\''sq'\'',$x.o' 'testsubdir/test3 '\''sq'\'',$x.r'
+++ file_size test.r
+++ perl -e 'print -s $ARGV[0]' test.r
+++ command /usr/bin/perl -e 'print -s $ARGV[0]' test.r
+++ /usr/bin/perl -e 'print -s $ARGV[0]' test.r
++ S=57
+++ file_size test2.r
+++ perl -e 'print -s $ARGV[0]' test2.r
+++ command /usr/bin/perl -e 'print -s $ARGV[0]' test2.r
+++ /usr/bin/perl -e 'print -s $ARGV[0]' test2.r
++ S2=14
+++ file_size 'testsubdir/test3 '\''sq'\'',$x.r'
+++ perl -e 'print -s $ARGV[0]' 'testsubdir/test3 '\''sq'\'',$x.r'
+++ command /usr/bin/perl -e 'print -s $ARGV[0]' 'testsubdir/test3 '\''sq'\'',$x.r'
+++ /usr/bin/perl -e 'print -s $ARGV[0]' 'testsubdir/test3 '\''sq'\'',$x.r'
++ S3=49
++ filter_git add .
++ rm -f rot13-filter.log
++ git add .
+ test_eval_ret_=128
+ want_trace
+ test t = t
+ test t = t
+ set +x
error: last command exited with $?=128
not ok 15 - required process filter should filter data
#
# test_config_global filter.protocol.process
# "rot13-filter.pl clean smudge" &&
# test_config_global filter.protocol.required true &&
# rm -rf repo &&
# mkdir repo &&
# (
# cd repo &&
# git init &&
#
# echo "git-stderr.log" >.gitignore &&
# echo "*.r filter=protocol" >.gitattributes &&
# git add . &&
# git commit . -m "test commit 1" &&
# git branch empty-branch &&
#
# cp "$TEST_ROOT/test.o" test.r &&
# cp "$TEST_ROOT/test2.o" test2.r &&
# mkdir testsubdir &&
# cp "$TEST_ROOT/test3 'sq',\$x.o" "testsubdir/test3
# 'sq',\$x.r" &&
# >test4-empty.r &&
#
# S=$(file_size test.r) &&
# S2=$(file_size test2.r) &&
# S3=$(file_size "testsubdir/test3 'sq',\$x.r") &&
#
# filter_git add . &&
# cat >expected.log <<-EOF &&
# START
# init handshake complete
# IN: clean test.r $S [OK] -- OUT: $S . [OK]
# IN: clean test2.r $S2 [OK] -- OUT: $S2 .
# [OK]
# IN: clean test4-empty.r 0 [OK] -- OUT: 0
# [OK]
# IN: clean testsubdir/test3 'sq',\$x.r $S3
# [OK] -- OUT: $S3 . [OK]
# STOP
# EOF
# test_cmp_count expected.log rot13-filter.log &&
#
# filter_git commit . -m "test commit 2" &&
# cat >expected.log <<-EOF &&
# START
# init handshake complete
# IN: clean test.r $S [OK] -- OUT: $S . [OK]
# IN: clean test2.r $S2 [OK] -- OUT: $S2 .
# [OK]
# IN: clean test4-empty.r 0 [OK] -- OUT: 0
# [OK]
# IN: clean testsubdir/test3 'sq',\$x.r $S3
# [OK] -- OUT: $S3 . [OK]
# IN: clean test.r $S [OK] -- OUT: $S . [OK]
# IN: clean test2.r $S2 [OK] -- OUT: $S2 .
# [OK]
# IN: clean test4-empty.r 0 [OK] -- OUT: 0
# [OK]
# IN: clean testsubdir/test3 'sq',\$x.r $S3
# [OK] -- OUT: $S3 . [OK]
# STOP
# EOF
# test_cmp_count expected.log rot13-filter.log &&
#
# rm -f test2.r "testsubdir/test3 'sq',\$x.r" &&
#
# filter_git checkout --quiet --no-progress . &&
# cat >expected.log <<-EOF &&
# START
# init handshake complete
# IN: smudge test2.r $S2 [OK] -- OUT: $S2 .
# [OK]
# IN: smudge testsubdir/test3 'sq',\$x.r $S3
# [OK] -- OUT: $S3 . [OK]
# STOP
# EOF
# test_cmp_exclude_clean expected.log
# rot13-filter.log &&
#
# filter_git checkout --quiet --no-progress
# empty-branch &&
# cat >expected.log <<-EOF &&
# START
# init handshake complete
# IN: clean test.r $S [OK] -- OUT: $S . [OK]
# STOP
# EOF
# test_cmp_exclude_clean expected.log
# rot13-filter.log &&
#
# filter_git checkout --quiet --no-progress master
# &&
# cat >expected.log <<-EOF &&
# START
# init handshake complete
# IN: smudge test.r $S [OK] -- OUT: $S .
# [OK]
# IN: smudge test2.r $S2 [OK] -- OUT: $S2 .
# [OK]
# IN: smudge test4-empty.r 0 [OK] -- OUT: 0
# [OK]
# IN: smudge testsubdir/test3 'sq',\$x.r $S3
# [OK] -- OUT: $S3 . [OK]
# STOP
# EOF
# test_cmp_exclude_clean expected.log
# rot13-filter.log &&
#
# test_cmp_committed_rot13 "$TEST_ROOT/test.o"
# test.r &&
# test_cmp_committed_rot13 "$TEST_ROOT/test2.o"
# test2.r &&
# test_cmp_committed_rot13 "$TEST_ROOT/test3
# 'sq',\$x.o" "testsubdir/test3 'sq',\$x.r"
# )
#
^ permalink raw reply
* Re: [ANNOUNCE] Prerelease: Git for Windows v2.11.0-rc0
From: Johannes Schindelin @ 2016-11-11 16:54 UTC (permalink / raw)
To: stefan.naewe; +Cc: git-for-windows, git
In-Reply-To: <1784ec06-2557-aa99-ead8-b8997b68d8d9@atlas-elektronik.com>
Hi Stefan,
On Thu, 10 Nov 2016, stefan.naewe@atlas-elektronik.com wrote:
> Am 05.11.2016 um 10:50 schrieb Johannes Schindelin:
> > Dear Git users,
> >
> > I finally got around to rebase the Windows-specific patches (which seem to
> > not make it upstream as fast as we get new ones) on top of upstream Git
> > v2.11.0-rc0, and to bundle installers, portable Git and MinGit [*1*]:
> >
> > https://github.com/git-for-windows/git/releases/tag/v2.11.0-rc0.windows.1
> >
> > It would be really nice if those of you who have access to Windows [*2*]
> > could try it out and report bugs before v2.11.0 final.
>
> I tried that version on 64bit Win7.
> Somehow the PATH env. variable does no longer get set correctly.
You are absolutely correct. There was a change in MSYS2 that I missed: by
default, it re-sets the PATH to be minimal now. This is obviously not what
we want.
I worked around this in the usual way [*1*].
Thank you so much for testing. It would have been really awful if Git for
Windows v2.11.0 would have shipped with this bug.
Unfortunately I have to re-build and re-package the installers I promised
to upload today; Hopefully I will get around to upload the fixed ones
soon.
Will keep you posted,
Dscho
Footnote *1*:
https://github.com/git-for-windows/build-extra/commit/db24c0378adf33c07d6c053f39f04a6a025150cc
^ permalink raw reply
* [PATCH] upload-pack: Optionally allow fetching any sha1
From: David Turner @ 2016-11-11 16:31 UTC (permalink / raw)
To: git, spearce; +Cc: David Turner
It seems a little silly to do a reachabilty check in the case where we
trust the user to access absolutely everything in the repository.
Also, it's racy in a distributed system -- perhaps one server
advertises a ref, but another has since had a force-push to that ref,
and perhaps the two HTTP requests end up directed to these different
servers.
Signed-off-by: David Turner <dturner@twosigma.com>
---
This one is on top of yesterday's patch, "remote-curl: don't hang when
a server dies before any output".
That's because I want my test to show that allowanysha1inhead allows a
fetch to succeed where allowreachablesha1inhead would fail. Prior to
the previous patch, the first fetch's failure would instead be a hang.
t/t5551-http-fetch-smart.sh | 22 ++++++++++++++++++++++
upload-pack.c | 10 +++++++++-
2 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index 43665ab..8d3db40 100755
--- a/t/t5551-http-fetch-smart.sh
+++ b/t/t5551-http-fetch-smart.sh
@@ -306,6 +306,28 @@ test_expect_success 'test allowreachablesha1inwant with unreachable' '
test_must_fail git -C test_reachable.git fetch origin "$(git rev-parse HEAD)"
'
+test_expect_success 'test allowanysha1inwant with unreachable' '
+ test_when_finished "rm -rf test_reachable.git; git reset --hard $(git rev-parse HEAD)" &&
+
+ #create unreachable sha
+ echo content >file2 &&
+ git add file2 &&
+ git commit -m two &&
+ git push public HEAD:refs/heads/doomed &&
+ git push public :refs/heads/doomed &&
+
+ server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+ master_sha=$(git -C "$server" rev-parse refs/heads/master) &&
+ git -C "$server" config uploadpack.allowreachablesha1inwant 1 &&
+
+ git init --bare test_reachable.git &&
+ git -C test_reachable.git remote add origin "$HTTPD_URL/smart/repo.git" &&
+ test_must_fail git -C test_reachable.git fetch origin "$(git rev-parse HEAD)" &&
+
+ git -C "$server" config uploadpack.allowanysha1inwant 1 &&
+ git -C test_reachable.git fetch origin "$(git rev-parse HEAD)"
+'
+
test_expect_success EXPENSIVE 'http can handle enormous ref negotiation' '
(
cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
diff --git a/upload-pack.c b/upload-pack.c
index e0db8b4..7597ba3 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -46,6 +46,8 @@ static int no_progress, daemon_mode;
#define ALLOW_TIP_SHA1 01
/* Allow request of a sha1 if it is reachable from a ref (possibly hidden ref). */
#define ALLOW_REACHABLE_SHA1 02
+/* Allow request of any sha1. Implies ALLOW_TIP_SHA1 and ALLOW_REACHABLE_SHA1. */
+#define ALLOW_ANY_SHA1 07
static unsigned int allow_unadvertised_object_request;
static int shallow_nr;
static struct object_array have_obj;
@@ -825,7 +827,8 @@ static void receive_needs(void)
sha1_to_hex(sha1_buf));
if (!(o->flags & WANTED)) {
o->flags |= WANTED;
- if (!is_our_ref(o))
+ if (!((allow_unadvertised_object_request & ALLOW_ANY_SHA1) == ALLOW_ANY_SHA1
+ || is_our_ref(o)))
has_non_tip = 1;
add_object_array(o, NULL, &want_obj);
}
@@ -1008,6 +1011,11 @@ static int upload_pack_config(const char *var, const char *value, void *unused)
allow_unadvertised_object_request |= ALLOW_REACHABLE_SHA1;
else
allow_unadvertised_object_request &= ~ALLOW_REACHABLE_SHA1;
+ } else if (!strcmp("uploadpack.allowanysha1inwant", var)) {
+ if (git_config_bool(var, value))
+ allow_unadvertised_object_request |= ALLOW_ANY_SHA1;
+ else
+ allow_unadvertised_object_request &= ~ALLOW_ANY_SHA1;
} else if (!strcmp("uploadpack.keepalive", var)) {
keepalive = git_config_int(var, value);
if (!keepalive)
--
2.8.0.rc4.22.g8ae061a
^ permalink raw reply related
* [PATCH] mingw: hot-fix t5615
From: Johannes Schindelin @ 2016-11-11 16:29 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jeff King
That test made the incorrect assumption that the path separator character
is always a colon. On Windows, it is a semicolon instead.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
Published-As: https://github.com/dscho/git/releases/tag/t5615-path-separator-v1
Fetch-It-Via: git fetch https://github.com/dscho/git t5615-path-separator-v1
This is required, but not sufficient, to fix `master` on Windows.
t/t5615-alternate-env.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/t/t5615-alternate-env.sh b/t/t5615-alternate-env.sh
index 22d9d81..3aeffb6 100755
--- a/t/t5615-alternate-env.sh
+++ b/t/t5615-alternate-env.sh
@@ -37,8 +37,10 @@ test_expect_success 'access alternate via absolute path' '
EOF
'
+sep=:
+test_have_prereq !MINGW || sep=\;
test_expect_success 'access multiple alternates' '
- check_obj "$(pwd)/one.git/objects:$(pwd)/two.git/objects" <<-EOF
+ check_obj "$(pwd)/one.git/objects$sep$(pwd)/two.git/objects" <<-EOF
$one blob
$two blob
EOF
base-commit: 0538b84027a8aba7e8b805e3ec8fceb3990023e5
--
2.10.1.583.g721a9e0
^ permalink raw reply related
* Re: 2.11.0-rc1 will not be tagged for a few days
From: Johannes Schindelin @ 2016-11-11 16:13 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <xmqqoa1n57u4.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Thu, 10 Nov 2016, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
> > I'll report back an updated schedule when able.
>
> I pushed some updates out on 'master' today.
Which means that t0021 is now broken also on `master` when running in Git
for Windows' SDK.
To add insult to injury, t5615 is now broken, too. I do not recall it
being broken in any of my CI builds in any of the integration branches
before.
Ciao,
Dscho
^ permalink raw reply
* [PATCH v6 03/16] i18n: add--interactive: mark simple here-documents for translation
From: Vasco Almeida @ 2016-11-11 12:45 UTC (permalink / raw)
To: git
Cc: Vasco Almeida, Jiang Xin, Ævar Arnfjörð Bjarmason,
Jean-Noël AVILA, Jakub Narębski, David Aguilar,
Junio C Hamano
In-Reply-To: <20161005172110.30801-1-vascomalmeida@sapo.pt>
Mark messages in here-documents without interpolation for translation.
The here-document delimiter \EOF, which is the same as 'EOF', indicates
that the text is to be treated literally without interpolation of its
content. Unfortunately xgettext is not able to extract here-documents
delimited with \EOF but it is with delimiter enclosed in single quotes.
So change \EOF to 'EOF', although in this case does not make
difference what variation of here-document to use since there is nothing
to interpolate.
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
git-add--interactive.perl | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index cf216ecb6..5800010ed 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -639,7 +639,7 @@ sub list_and_choose {
}
sub singleton_prompt_help_cmd {
- print colored $help_color, <<\EOF ;
+ print colored $help_color, __ <<'EOF' ;
Prompt help:
1 - select a numbered item
foo - select item based on unique prefix
@@ -648,7 +648,7 @@ EOF
}
sub prompt_help_cmd {
- print colored $help_color, <<\EOF ;
+ print colored $help_color, __ <<'EOF' ;
Prompt help:
1 - select a single item
3-5 - select a range of items
@@ -1584,7 +1584,9 @@ sub quit_cmd {
}
sub help_cmd {
- print colored $help_color, <<\EOF ;
+# TRANSLATORS: please do not translate the command names
+# 'status', 'update', 'revert', etc.
+ print colored $help_color, __ <<'EOF' ;
status - show paths with changes
update - add working tree state to the staged set of changes
revert - revert staged set of changes back to the HEAD version
--
2.11.0.rc0.33.gec17dab
^ permalink raw reply related
* [PATCH v6 02/16] i18n: add--interactive: mark strings for translation
From: Vasco Almeida @ 2016-11-11 12:45 UTC (permalink / raw)
To: git
Cc: Vasco Almeida, Jiang Xin, Ævar Arnfjörð Bjarmason,
Jean-Noël AVILA, Jakub Narębski, David Aguilar,
Junio C Hamano
In-Reply-To: <20161005172110.30801-1-vascomalmeida@sapo.pt>
Mark simple strings (without interpolation) for translation.
Brackets around first parameter of ternary operator is necessary because
otherwise xgettext fails to extract strings marked for translation from
the rest of the file.
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
git-add--interactive.perl | 76 ++++++++++++++++++++++++++---------------------
1 file changed, 42 insertions(+), 34 deletions(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index ee3d81269..cf216ecb6 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -4,6 +4,7 @@ use 5.008;
use strict;
use warnings;
use Git;
+use Git::I18N;
binmode(STDOUT, ":raw");
@@ -253,8 +254,9 @@ sub list_untracked {
run_cmd_pipe(qw(git ls-files --others --exclude-standard --), @ARGV);
}
-my $status_fmt = '%12s %12s %s';
-my $status_head = sprintf($status_fmt, 'staged', 'unstaged', 'path');
+# TRANSLATORS: you can adjust this to align "git add -i" status menu
+my $status_fmt = __('%12s %12s %s');
+my $status_head = sprintf($status_fmt, __('staged'), __('unstaged'), __('path'));
{
my $initial;
@@ -680,7 +682,7 @@ sub update_cmd {
my @mods = list_modified('file-only');
return if (!@mods);
- my @update = list_and_choose({ PROMPT => 'Update',
+ my @update = list_and_choose({ PROMPT => __('Update'),
HEADER => $status_head, },
@mods);
if (@update) {
@@ -692,7 +694,7 @@ sub update_cmd {
}
sub revert_cmd {
- my @update = list_and_choose({ PROMPT => 'Revert',
+ my @update = list_and_choose({ PROMPT => __('Revert'),
HEADER => $status_head, },
list_modified());
if (@update) {
@@ -726,13 +728,13 @@ sub revert_cmd {
}
sub add_untracked_cmd {
- my @add = list_and_choose({ PROMPT => 'Add untracked' },
+ my @add = list_and_choose({ PROMPT => __('Add untracked') },
list_untracked());
if (@add) {
system(qw(git update-index --add --), @add);
say_n_paths('added', @add);
} else {
- print "No untracked files.\n";
+ print __("No untracked files.\n");
}
print "\n";
}
@@ -1166,8 +1168,14 @@ sub edit_hunk_loop {
}
else {
prompt_yesno(
- 'Your edited hunk does not apply. Edit again '
- . '(saying "no" discards!) [y/n]? '
+ # TRANSLATORS: do not translate [y/n]
+ # The program will only accept that input
+ # at this point.
+ # Consider translating (saying "no" discards!) as
+ # (saying "n" for "no" discards!) if the translation
+ # of the word "no" does not start with n.
+ __('Your edited hunk does not apply. Edit again '
+ . '(saying "no" discards!) [y/n]? ')
) or return undef;
}
}
@@ -1213,11 +1221,11 @@ sub apply_patch_for_checkout_commit {
run_git_apply 'apply '.$reverse, @_;
return 1;
} elsif (!$applies_index) {
- print colored $error_color, "The selected hunks do not apply to the index!\n";
- if (prompt_yesno "Apply them to the worktree anyway? ") {
+ print colored $error_color, __("The selected hunks do not apply to the index!\n");
+ if (prompt_yesno __("Apply them to the worktree anyway? ")) {
return run_git_apply 'apply '.$reverse, @_;
} else {
- print colored $error_color, "Nothing was applied.\n";
+ print colored $error_color, __("Nothing was applied.\n");
return 0;
}
} else {
@@ -1237,9 +1245,9 @@ sub patch_update_cmd {
if (!@mods) {
if (@all_mods) {
- print STDERR "Only binary files changed.\n";
+ print STDERR __("Only binary files changed.\n");
} else {
- print STDERR "No changes.\n";
+ print STDERR __("No changes.\n");
}
return 0;
}
@@ -1247,7 +1255,7 @@ sub patch_update_cmd {
@them = @mods;
}
else {
- @them = list_and_choose({ PROMPT => 'Patch update',
+ @them = list_and_choose({ PROMPT => __('Patch update'),
HEADER => $status_head, },
@mods);
}
@@ -1397,12 +1405,12 @@ sub patch_update_file {
my $response = $1;
my $no = $ix > 10 ? $ix - 10 : 0;
while ($response eq '') {
- my $extra = "";
$no = display_hunks(\@hunk, $no);
if ($no < $num) {
- $extra = " (<ret> to see more)";
+ print __("go to which hunk (<ret> to see more)? ");
+ } else {
+ print __("go to which hunk? ");
}
- print "go to which hunk$extra? ";
$response = <STDIN>;
if (!defined $response) {
$response = '';
@@ -1439,7 +1447,7 @@ sub patch_update_file {
elsif ($line =~ m|^/(.*)|) {
my $regex = $1;
if ($1 eq "") {
- print colored $prompt_color, "search for regex? ";
+ print colored $prompt_color, __("search for regex? ");
$regex = <STDIN>;
if (defined $regex) {
chomp $regex;
@@ -1462,7 +1470,7 @@ sub patch_update_file {
$iy++;
$iy = 0 if ($iy >= $num);
if ($ix == $iy) {
- error_msg "No hunk matches the given pattern\n";
+ error_msg __("No hunk matches the given pattern\n");
last;
}
}
@@ -1474,7 +1482,7 @@ sub patch_update_file {
$ix--;
}
else {
- error_msg "No previous hunk\n";
+ error_msg __("No previous hunk\n");
}
next;
}
@@ -1483,7 +1491,7 @@ sub patch_update_file {
$ix++;
}
else {
- error_msg "No next hunk\n";
+ error_msg __("No next hunk\n");
}
next;
}
@@ -1496,13 +1504,13 @@ sub patch_update_file {
}
}
else {
- error_msg "No previous hunk\n";
+ error_msg __("No previous hunk\n");
}
next;
}
elsif ($line =~ /^j/) {
if ($other !~ /j/) {
- error_msg "No next hunk\n";
+ error_msg __("No next hunk\n");
next;
}
}
@@ -1560,18 +1568,18 @@ sub diff_cmd {
my @mods = list_modified('index-only');
@mods = grep { !($_->{BINARY}) } @mods;
return if (!@mods);
- my (@them) = list_and_choose({ PROMPT => 'Review diff',
+ my (@them) = list_and_choose({ PROMPT => __('Review diff'),
IMMEDIATE => 1,
HEADER => $status_head, },
@mods);
return if (!@them);
- my $reference = is_initial_commit() ? get_empty_tree() : 'HEAD';
+ my $reference = (is_initial_commit()) ? get_empty_tree() : 'HEAD';
system(qw(git diff -p --cached), $reference, '--',
map { $_->{VALUE} } @them);
}
sub quit_cmd {
- print "Bye.\n";
+ print __("Bye.\n");
exit(0);
}
@@ -1594,32 +1602,32 @@ sub process_args {
if ($1 eq 'reset') {
$patch_mode = 'reset_head';
$patch_mode_revision = 'HEAD';
- $arg = shift @ARGV or die "missing --";
+ $arg = shift @ARGV or die __("missing --");
if ($arg ne '--') {
$patch_mode_revision = $arg;
$patch_mode = ($arg eq 'HEAD' ?
'reset_head' : 'reset_nothead');
- $arg = shift @ARGV or die "missing --";
+ $arg = shift @ARGV or die __("missing --");
}
} elsif ($1 eq 'checkout') {
- $arg = shift @ARGV or die "missing --";
+ $arg = shift @ARGV or die __("missing --");
if ($arg eq '--') {
$patch_mode = 'checkout_index';
} else {
$patch_mode_revision = $arg;
$patch_mode = ($arg eq 'HEAD' ?
'checkout_head' : 'checkout_nothead');
- $arg = shift @ARGV or die "missing --";
+ $arg = shift @ARGV or die __("missing --");
}
} elsif ($1 eq 'stage' or $1 eq 'stash') {
$patch_mode = $1;
- $arg = shift @ARGV or die "missing --";
+ $arg = shift @ARGV or die __("missing --");
} else {
die "unknown --patch mode: $1";
}
} else {
$patch_mode = 'stage';
- $arg = shift @ARGV or die "missing --";
+ $arg = shift @ARGV or die __("missing --");
}
die "invalid argument $arg, expecting --"
unless $arg eq "--";
@@ -1641,10 +1649,10 @@ sub main_loop {
[ 'help', \&help_cmd, ],
);
while (1) {
- my ($it) = list_and_choose({ PROMPT => 'What now',
+ my ($it) = list_and_choose({ PROMPT => __('What now'),
SINGLETON => 1,
LIST_FLAT => 4,
- HEADER => '*** Commands ***',
+ HEADER => __('*** Commands ***'),
ON_EOF => \&quit_cmd,
IMMEDIATE => 1 }, @cmd);
if ($it) {
--
2.11.0.rc0.33.gec17dab
^ permalink raw reply related
* [PATCH v6 04/16] i18n: add--interactive: mark strings with interpolation for translation
From: Vasco Almeida @ 2016-11-11 12:45 UTC (permalink / raw)
To: git
Cc: Vasco Almeida, Jiang Xin, Ævar Arnfjörð Bjarmason,
Jean-Noël AVILA, Jakub Narębski, David Aguilar,
Junio C Hamano
In-Reply-To: <20161005172110.30801-1-vascomalmeida@sapo.pt>
Since at this point Git::I18N.perl lacks support for Perl i18n
placeholder substitution, use of sprintf following die or error_msg is
necessary for placeholder substitution take place.
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
git-add--interactive.perl | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 5800010ed..d05ac608e 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -615,12 +615,12 @@ sub list_and_choose {
else {
$bottom = $top = find_unique($choice, @stuff);
if (!defined $bottom) {
- error_msg "Huh ($choice)?\n";
+ error_msg sprintf(__("Huh (%s)?\n"), $choice);
next TOPLOOP;
}
}
if ($opts->{SINGLETON} && $bottom != $top) {
- error_msg "Huh ($choice)?\n";
+ error_msg sprintf(__("Huh (%s)?\n"), $choice);
next TOPLOOP;
}
for ($i = $bottom-1; $i <= $top-1; $i++) {
@@ -717,7 +717,7 @@ sub revert_cmd {
$_->{INDEX_ADDDEL} eq 'create') {
system(qw(git update-index --force-remove --),
$_->{VALUE});
- print "note: $_->{VALUE} is untracked now.\n";
+ printf(__("note: %s is untracked now.\n"), $_->{VALUE});
}
}
}
@@ -1056,7 +1056,7 @@ sub edit_hunk_manually {
my $hunkfile = $repo->repo_path . "/addp-hunk-edit.diff";
my $fh;
open $fh, '>', $hunkfile
- or die "failed to open hunk edit file for writing: " . $!;
+ or die sprintf(__("failed to open hunk edit file for writing: %s"), $!);
print $fh "# Manual hunk edit mode -- see bottom for a quick guide\n";
print $fh @$oldtext;
my $participle = $patch_mode_flavour{PARTICIPLE};
@@ -1083,7 +1083,7 @@ EOF
}
open $fh, '<', $hunkfile
- or die "failed to open hunk edit file for reading: " . $!;
+ or die sprintf(__("failed to open hunk edit file for reading: %s"), $!);
my @newtext = grep { !/^#/ } <$fh>;
close $fh;
unlink $hunkfile;
@@ -1236,7 +1236,7 @@ sub apply_patch_for_checkout_commit {
sub patch_update_cmd {
my @all_mods = list_modified($patch_mode_flavour{FILTER});
- error_msg "ignoring unmerged: $_->{VALUE}\n"
+ error_msg sprintf(__("ignoring unmerged: %s\n"), $_->{VALUE})
for grep { $_->{UNMERGED} } @all_mods;
@all_mods = grep { !$_->{UNMERGED} } @all_mods;
@@ -1418,7 +1418,8 @@ sub patch_update_file {
chomp $response;
}
if ($response !~ /^\s*\d+\s*$/) {
- error_msg "Invalid number: '$response'\n";
+ error_msg sprintf(__("Invalid number: '%s'\n"),
+ $response);
} elsif (0 < $response && $response <= $num) {
$ix = $response - 1;
} else {
@@ -1460,7 +1461,7 @@ sub patch_update_file {
if ($@) {
my ($err,$exp) = ($@, $1);
$err =~ s/ at .*git-add--interactive line \d+, <STDIN> line \d+.*$//;
- error_msg "Malformed search regexp $exp: $err\n";
+ error_msg sprintf(__("Malformed search regexp %s: %s\n"), $exp, $err);
next;
}
my $iy = $ix;
@@ -1625,18 +1626,18 @@ sub process_args {
$patch_mode = $1;
$arg = shift @ARGV or die __("missing --");
} else {
- die "unknown --patch mode: $1";
+ die sprintf(__("unknown --patch mode: %s"), $1);
}
} else {
$patch_mode = 'stage';
$arg = shift @ARGV or die __("missing --");
}
- die "invalid argument $arg, expecting --"
- unless $arg eq "--";
+ die sprintf(__("invalid argument %s, expecting --"),
+ $arg) unless $arg eq "--";
%patch_mode_flavour = %{$patch_modes{$patch_mode}};
}
elsif ($arg ne "--") {
- die "invalid argument $arg, expecting --";
+ die sprintf(__("invalid argument %s, expecting --"), $arg);
}
}
--
2.11.0.rc0.33.gec17dab
^ permalink raw reply related
* [PATCH v6 00/16] Mark strings in Perl scripts for translation
From: Vasco Almeida @ 2016-11-11 12:45 UTC (permalink / raw)
To: git
Cc: Vasco Almeida, Jiang Xin, Ævar Arnfjörð Bjarmason,
Jean-Noël AVILA, Jakub Narębski, David Aguilar,
Junio C Hamano
In-Reply-To: <20161005172110.30801-1-vascomalmeida@sapo.pt>
Mark messages in some perl scripts for translation.
Changes in this re-roll v6:
- Change implementation of prefix_lines subroutine to allow arbitrary
number of strings as arguments.
- Change a few marks for translation hopefully to be easier on the eyes.
Interdiff included below.
Vasco Almeida (16):
Git.pm: add subroutines for commenting lines
i18n: add--interactive: mark strings for translation
i18n: add--interactive: mark simple here-documents for translation
i18n: add--interactive: mark strings with interpolation for
translation
i18n: clean.c: match string with git-add--interactive.perl
i18n: add--interactive: mark plural strings
i18n: add--interactive: mark patch prompt for translation
i18n: add--interactive: i18n of help_patch_cmd
i18n: add--interactive: mark edit_hunk_manually message for
translation
i18n: add--interactive: remove %patch_modes entries
i18n: add--interactive: mark status words for translation
i18n: send-email: mark strings for translation
i18n: send-email: mark warnings and errors for translation
i18n: send-email: mark string with interpolation for translation
i18n: send-email: mark composing message for translation
i18n: difftool: mark warnings for translation
Makefile | 3 +-
builtin/clean.c | 10 +-
git-add--interactive.perl | 329 ++++++++++++++++++++++++++++++----------------
git-difftool.perl | 22 ++--
git-send-email.perl | 191 +++++++++++++++------------
perl/Git.pm | 24 ++++
perl/Git/I18N.pm | 19 ++-
t/t0202/test.pl | 14 +-
8 files changed, 394 insertions(+), 218 deletions(-)
-- >8 --
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 56e6889..3a6d846 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -1068,22 +1068,24 @@ sub edit_hunk_manually {
my $fh;
open $fh, '>', $hunkfile
or die sprintf(__("failed to open hunk edit file for writing: %s"), $!);
- print $fh Git::comment_lines __("Manual hunk edit mode -- see bottom for a quick guide\n");
+ print $fh Git::comment_lines __("Manual hunk edit mode -- see bottom for a quick guide.\n");
print $fh @$oldtext;
my $is_reverse = $patch_mode_flavour{IS_REVERSE};
my ($remove_plus, $remove_minus) = $is_reverse ? ('-', '+') : ('+', '-');
my $comment_line_char = Git::config("core.commentchar") || '#';
- print $fh Git::comment_lines sprintf(__(
-"---
+ print $fh Git::comment_lines sprintf(__ <<EOF, $remove_minus, $remove_plus, $comment_line_char),
+---
To remove '%s' lines, make them ' ' lines (context).
To remove '%s' lines, delete them.
Lines starting with %s will be removed.
-\n"), $remove_minus, $remove_plus, $comment_line_char) .
-__($edit_hunk_manually_modes{$patch_mode}) ."\n". __(
+EOF
+__($edit_hunk_manually_modes{$patch_mode}),
# TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
-"If it does not apply cleanly, you will be given an opportunity to
+__ <<EOF2 ;
+If it does not apply cleanly, you will be given an opportunity to
edit again. If all lines of the hunk are removed, then the edit is
-aborted and the hunk is left unchanged.\n");
+aborted and the hunk is left unchanged.
+EOF2
close $fh;
chomp(my $editor = run_cmd_pipe(qw(git var GIT_EDITOR)));
diff --git a/git-send-email.perl b/git-send-email.perl
index bbeb9fb..068d60b 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -585,12 +585,13 @@ sub is_format_patch_arg {
if (defined($format_patch)) {
return $format_patch;
}
- die sprintf(__(
-"File '%s' exists but it could also be the range of commits
+ die sprintf(__ <<EOF, $f, $f);
+File '%s' exists but it could also be the range of commits
to produce patches for. Please disambiguate by...
- * Saying \"./%s\" if you mean a file; or
- * Giving --format-patch option if you mean a range."), $f, $f);
+ * Saying "./%s" if you mean a file; or
+ * Giving --format-patch option if you mean a range.
+EOF
} catch Git::Error::Command with {
# Not a valid revision. Treat it as a filename.
return 0;
@@ -654,7 +655,7 @@ sub get_patch_subject {
return "GIT: $1\n";
}
close $fh;
- die sprintf(__("No subject line in %s ?"), $fn);
+ die sprintf(__("No subject line in %s?"), $fn);
}
if ($compose) {
@@ -697,10 +698,10 @@ EOT3
}
open my $c2, ">", $compose_filename . ".final"
- or die sprintf(__("Failed to open %s.final : %s"), $compose_filename, $!);
+ or die sprintf(__("Failed to open %s.final: %s"), $compose_filename, $!);
open $c, "<", $compose_filename
- or die sprintf(__("Failed to open %s : %s"), $compose_filename, $!);
+ or die sprintf(__("Failed to open %s: %s"), $compose_filename, $!);
my $need_8bit_cte = file_has_nonascii($compose_filename);
my $in_body = 0;
@@ -1304,8 +1305,8 @@ Message-Id: $message_id
if ($needs_confirm eq "inform") {
$confirm_unconfigured = 0; # squelch this message for the rest of this run
$ask_default = "y"; # assume yes on EOF since user hasn't explicitly asked for confirmation
- print __(
-" The Cc list above has been expanded by additional
+ print __ <<EOF ;
+ The Cc list above has been expanded by additional
addresses found in the patch commit message. By default
send-email prompts before sending whenever this occurs.
This behavior is controlled by the sendemail.confirm
@@ -1313,7 +1314,9 @@ Message-Id: $message_id
For additional information, run 'git send-email --help'.
To retain the current behavior, but squelch this message,
- run 'git config --global sendemail.confirm auto'."), "\n\n";
+ run 'git config --global sendemail.confirm auto'.
+
+EOF
}
# TRANSLATORS: Make sure to include [y] [n] [q] [a] in your
# translation. The program will only accept English input
diff --git a/perl/Git.pm b/perl/Git.pm
index 17be59f..69cd1dd 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -1438,19 +1438,20 @@ sub END {
} # %TEMP_* Lexical Context
-=item prefix_lines ( PREFIX, STRING )
+=item prefix_lines ( PREFIX, STRING [, STRING... ])
Prefixes lines in C<STRING> with C<PREFIX>.
=cut
sub prefix_lines {
- my ($prefix, $string) = @_;
+ my $prefix = shift;
+ my $string = join("\n", @_);
$string =~ s/^/$prefix/mg;
return $string;
}
-=item comment_lines ( STRING )
+=item comment_lines ( STRING [, STRING... ])
Comments lines following core.commentchar configuration.
-- >8 --
--
2.11.0.rc0.33.gec17dab
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox