* Re: [PATCH 2/3] test-lib: add --verbose-log option
From: Junio C Hamano @ 2016-10-21 17:12 UTC (permalink / raw)
To: Jeff King; +Cc: Stefan Beller, Lars Schneider, git
In-Reply-To: <20161021104759.hx6q7u66r3ll7l44@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> This patch implements option (5), which seems to work well
> in practice.
Your journey to reach this final design and implementation may have
been painful---I really like the end result. This was an accident
waiting to happen.
Thanks for fixing it.
> @@ -319,7 +332,10 @@ fi
>
> exec 5>&1
> exec 6<&0
> -if test "$verbose" = "t"
> +if test "$verbose_log" = "t"
> +then
> + exec 3>>"$GIT_TEST_TEE_OUTPUT_FILE" 4>&3
> +elif test "$verbose" = "t"
> then
> exec 4>&2 3>&1
> else
OK, unlike "verbose" case where we give 3 (saved stdout) to 1 and 4
(saved stderr) to 2, we send 3 to the output file and 4 to the same.
Makes sense.
^ permalink raw reply
* Re: [BUG] fetch output is ugly in 'next'
From: Junio C Hamano @ 2016-10-21 16:50 UTC (permalink / raw)
To: Duy Nguyen; +Cc: Jeff King, Git Mailing List
In-Reply-To: <CACsJy8CkK8K0ty3fv9qyD7wwB+81VPB-P1UUCbDJTJ4iM0Y+Cw@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
> On Fri, Oct 21, 2016 at 7:11 PM, Duy Nguyen <pclouds@gmail.com> wrote:
>> Yeah.. replacing the 4 DEFAULT_ABBREV in fetch.c with something
>> sensible should do it.
>
> Correction (if somebody will pick this up), it's
> TRANSPORT_SUMMARY_WIDTH that needs to be adjusted, not those four.
Yes, it used to be and it still is (2 * DEFAULT_ABBREV + 3) but in
the new world order where default-abbrev is often -1 the expression
does not make much sense.
Perhaps something along this line?
transport.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/transport.h b/transport.h
index 18d2cf8275..5339fabbad 100644
--- a/transport.h
+++ b/transport.h
@@ -127,7 +127,7 @@ struct transport {
#define TRANSPORT_PUSH_CERT 2048
#define TRANSPORT_PUSH_ATOMIC 4096
-#define TRANSPORT_SUMMARY_WIDTH (2 * DEFAULT_ABBREV + 3)
+#define TRANSPORT_SUMMARY_WIDTH (2 * (DEFAULT_ABBREV < 0 ? 7 : DEFAULT_ABBREV) + 3)
#define TRANSPORT_SUMMARY(x) (int)(TRANSPORT_SUMMARY_WIDTH + strlen(x) - gettext_width(x)), (x)
/* Returns a transport suitable for the url */
^ permalink raw reply related
* Re: [PATCH 1/2] t9000-addresses: update expected results after fix
From: Junio C Hamano @ 2016-10-21 16:48 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git, Ramsay Jones
In-Reply-To: <20161021092024.15861-1-Matthieu.Moy@imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
> e3fdbcc8e1 (parse_mailboxes: accept extra text after <...> address,
> 2016-10-13) improved our in-house address parser and made it closer to
> Mail::Address. As a consequence, some tests comparing it to
> Mail::Address now pass, but e3fdbcc8e1 forgot to update the test.
>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
> ---
Thanks.
^ permalink raw reply
* Re: Problems with "git svn clone"
From: K Richard Pixley @ 2016-10-21 16:33 UTC (permalink / raw)
To: Eric Wong; +Cc: git
In-Reply-To: <20161020004956.GA8083@starla>
Thank you.
Running on debian stretch/testing it got past the 11 second mark and has
been running for a day now. I expect it will take days, perhaps longer,
so we'll see.
--rich
________________________________
- CONFIDENTIAL-
This email and any files transmitted with it are confidential, and may also be legally privileged. If you are not the intended recipient, you may not review, use, copy, or distribute this message. If you receive this email in error, please notify the sender immediately by reply email and then delete this email.
^ permalink raw reply
* Re: Prove "Tests out of sequence" Error
From: Jacob Keller @ 2016-10-21 16:15 UTC (permalink / raw)
To: Jeff King; +Cc: Stefan Beller, Lars Schneider, git
In-Reply-To: <20161021154840.pdmb5c3gjharsrxe@sigill.intra.peff.net>
On Fri, Oct 21, 2016 at 8:48 AM, Jeff King <peff@peff.net> wrote:
> On Fri, Oct 21, 2016 at 08:42:58AM -0700, Jacob Keller wrote:
>
>> > For $HARNESS_ACTIVE with _just_ "--verbose", I don't think it would be a
>> > good idea to activate it. We should either silently ignore --verbose
>> > then, or complain and die.
>>
>> We should probably do that to make sure people realize what might
>> happen. I read your series and it has a good explanation of the
>> possible alternatives. I like the approach you chose.
>
> Thanks. Do you want to make a patch on top of my series?
>
> -Peff
I am not sure I will find time to do it today, so it wouldn't be for a
few more days.
Thanks,
Jake
^ permalink raw reply
* Re: What's cooking in git.git (Oct 2016, #05; Thu, 20)
From: Lars Schneider @ 2016-10-21 16:11 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
In-Reply-To: <alpine.DEB.2.20.1610211457030.3264@virtualbox>
> On 21 Oct 2016, at 06:08, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> Hi Junio & Lars,
>
> On Thu, 20 Oct 2016, Junio C Hamano wrote:
>
>> * ls/filter-process (2016-10-17) 14 commits
>> (merged to 'next' on 2016-10-19 at ffd0de042c)
>> + contrib/long-running-filter: add long running filter example
>> + convert: add filter.<driver>.process option
>> + convert: prepare filter.<driver>.process option
>> + convert: make apply_filter() adhere to standard Git error handling
>> + pkt-line: add functions to read/write flush terminated packet streams
>> + pkt-line: add packet_write_gently()
>> + pkt-line: add packet_flush_gently()
>> + pkt-line: add packet_write_fmt_gently()
>> + pkt-line: extract set_packet_header()
>> + pkt-line: rename packet_write() to packet_write_fmt()
>> + run-command: add clean_on_exit_handler
>> + run-command: move check_pipe() from write_or_die to run_command
>> + convert: modernize tests
>> + convert: quote filter names in error messages
>>
>> The smudge/clean filter API expect an external process is spawned
>> to filter the contents for each path that has a filter defined. A
>> new type of "process" filter API has been added to allow the first
>> request to run the filter for a path to spawn a single process, and
>> all filtering need is served by this single process for multiple
>> paths, reducing the process creation overhead.
>>
>> Will merge to 'master'.
>
> This breaks in Git for Windows' SDK (I only now realized that t0060 was
> not the only thing breaking in `next` for a while now):
> ...
> -- snap --
>
> Unsurprisingly, bisect identifies "convert: add filter.<driver>.process
> option" as the first bad commit, although it only fails on the test case
> 15, but not on 17.
>
> I am unfortunately still busy with trying to figure out what exactly makes
> t6030 hang on `pu` (seems it thinks stdin is a tty and just waits for an
> answer), and then trying to reduce that insane amount of time wasted on
> running, and waiting for, the test suite, and for unrelated reasons I'll
> have to go offline for the rest of the day, so I will most likely be
> unable to assist further with this.
Hi Johannes,
thanks for reporting this. Looks like I misunderstood your comment when
you wrote the error is already fixed in GfW:
https://github.com/git-for-windows/git/issues/770#issuecomment-251426487
I think this patch series (referenced by the link above, too) should fix
the problem:
http://public-inbox.org/git/20160905211111.72956-1-larsxschneider@gmail.com/
Don't waste any time on this. I will look into it ASAP (traveling right now).
Cheers,
Lars
^ permalink raw reply
* Re: [PATCH] daemon, path.c: fix a bug with ~ in repo paths
From: Junio C Hamano @ 2016-10-21 15:58 UTC (permalink / raw)
To: Duy Nguyen; +Cc: Luke Shumaker, Git Mailing List, Jeff King
In-Reply-To: <CACsJy8AzWqJ_9JQ_BGnAB3E3GrGSTS40z8umbtO6mQJukWOooQ@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
> The amount of changes is unbelievable for fixing such a rare case
> though. I wonder if we can just detect this in daemon.c and pass
> "./~foo/bar" instead of "~foo/bar" to enter_repo() in non-strict mode
> to "disable" expand_user_path(). If it works, it's much simpler
> changes (even though a bit hacky)
Conceptually, it ought to be updating the code that says "Does it
begin with a tilde? Then try to do user-path expansion and fail if
that is not enabled and if it succeeds use the resulting directory"
to "Is user-path enabled and does it begin with a tilde? Then try
to do user-path expansion and if it succeeds use the resulting
directory". Compared to that mental model we have with this
codepath, I agree that the change does look quite invasive and
large.
It is OK for a change to be large, as long as the end result is
easier to read and understand than the original. I am undecided if
that is the case with this patch, though.
Also I am a bit worried about the change in the semantics. While it
is not the best way to achieve this, the server operators could use
it as a way to add directories whose contents need to be hidden to
give them names that begin with a tilde without enabling user-path
expansion. This change may be a new and useful feature for Luke,
but to these server operators this change can be a new bug---it is
probably a minor new bug as they can work it around by using other
means to hide these directories, though.
^ permalink raw reply
* Re: Prove "Tests out of sequence" Error
From: Jeff King @ 2016-10-21 15:48 UTC (permalink / raw)
To: Jacob Keller; +Cc: Stefan Beller, Lars Schneider, git
In-Reply-To: <CA+P7+xrix3UZDEE1swG_=jBLwWHA04KoYikWBBMNx7aa=Hevmw@mail.gmail.com>
On Fri, Oct 21, 2016 at 08:42:58AM -0700, Jacob Keller wrote:
> > For $HARNESS_ACTIVE with _just_ "--verbose", I don't think it would be a
> > good idea to activate it. We should either silently ignore --verbose
> > then, or complain and die.
>
> We should probably do that to make sure people realize what might
> happen. I read your series and it has a good explanation of the
> possible alternatives. I like the approach you chose.
Thanks. Do you want to make a patch on top of my series?
-Peff
^ permalink raw reply
* Re: Prove "Tests out of sequence" Error
From: Jacob Keller @ 2016-10-21 15:42 UTC (permalink / raw)
To: Jeff King; +Cc: Stefan Beller, Lars Schneider, git
In-Reply-To: <20161021153534.mjed3sqhxjelxzwx@sigill.intra.peff.net>
On Fri, Oct 21, 2016 at 8:35 AM, Jeff King <peff@peff.net> wrote:
> On Fri, Oct 21, 2016 at 08:29:49AM -0700, Jacob Keller wrote:
>
>> > The Travis tests do exactly this (along with --tee to actually save the
>> > output). It seems like a minor miracle that this is the first test
>> > output that has actually triggered as TAP input. I'd suggest that the
>> > problem is not in the test, though, but that our "--verbose" option is
>> > unsuitable for using with a TAP harness.
>> >
>> > The obvious fix would be to send "--verbose" output to stderr, but I
>> > suspect that would end up annoying for people who do:
>> >
>> > ./t5547-push-quarantine.sh -v | less
>> >
>> > to read long output. Probably we need some option like "--log" which
>> > logs in the same way that "--tee" does, but _without_ sending the data
>> > to stdout. Naively, that just means replacing the "tee" invocation with
>> > "cat", but I suspect it will be a lot more complicated than that,
>> > because we still need to let the TAP output go to stdout.
>>
>> Can we determine that we're running with something monitoring the TAP
>> output? Because then we could make verbose go to stderr instead
>> dynamically?
>
> I think $HARNESS_ACTIVE could tell us that. But the hard part isn't
> activating it; it's directing the verbose output to the log without
> sending it to stdout.
>
> See the patch I posted later in the thread, and my musings on
> auto-activating it. I guess we could do so safely when we see
> $HARNESS_ACTIVE along with "--tee" and "--verbose", though I don't know
> if it's worth the trouble.
>
> For $HARNESS_ACTIVE with _just_ "--verbose", I don't think it would be a
> good idea to activate it. We should either silently ignore --verbose
> then, or complain and die.
>
We should probably do that to make sure people realize what might
happen. I read your series and it has a good explanation of the
possible alternatives. I like the approach you chose.
Thanks,
Jake
> -Peff
^ permalink raw reply
* Re: [PATCH v4 20/25] sequencer: refactor write_message()
From: Junio C Hamano @ 2016-10-21 15:40 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, Jakub Narębski, Johannes Sixt, Ramsay Jones
In-Reply-To: <alpine.DEB.2.20.1610211343310.3264@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> Ah, make that four steps. The final one is:
>>
>> - add append_eol parameter that nobody uses at this step in the
>> series.
>>
>> This is a new feature to the helper. While it is OK to have it as a
>> preparatory step in this series, it is easier to understand if it
>> kept as a separate step. It is even more preferrable if it is made
>> as a preparatory step in a series that adds a caller that passes
>> true to append_eol to this helper...
>
> Done,
> Dscho
Hmm, what has been done exactly? I still see append_eol in v5 where
nobody uses it yet. Confused...
^ permalink raw reply
* Re: Prove "Tests out of sequence" Error
From: Jeff King @ 2016-10-21 15:35 UTC (permalink / raw)
To: Jacob Keller; +Cc: Stefan Beller, Lars Schneider, git
In-Reply-To: <CA+P7+xozpk2-WZUYtaKmCazG3Owzpa3bsDejyUuGj0YEQnJWJg@mail.gmail.com>
On Fri, Oct 21, 2016 at 08:29:49AM -0700, Jacob Keller wrote:
> > The Travis tests do exactly this (along with --tee to actually save the
> > output). It seems like a minor miracle that this is the first test
> > output that has actually triggered as TAP input. I'd suggest that the
> > problem is not in the test, though, but that our "--verbose" option is
> > unsuitable for using with a TAP harness.
> >
> > The obvious fix would be to send "--verbose" output to stderr, but I
> > suspect that would end up annoying for people who do:
> >
> > ./t5547-push-quarantine.sh -v | less
> >
> > to read long output. Probably we need some option like "--log" which
> > logs in the same way that "--tee" does, but _without_ sending the data
> > to stdout. Naively, that just means replacing the "tee" invocation with
> > "cat", but I suspect it will be a lot more complicated than that,
> > because we still need to let the TAP output go to stdout.
>
> Can we determine that we're running with something monitoring the TAP
> output? Because then we could make verbose go to stderr instead
> dynamically?
I think $HARNESS_ACTIVE could tell us that. But the hard part isn't
activating it; it's directing the verbose output to the log without
sending it to stdout.
See the patch I posted later in the thread, and my musings on
auto-activating it. I guess we could do so safely when we see
$HARNESS_ACTIVE along with "--tee" and "--verbose", though I don't know
if it's worth the trouble.
For $HARNESS_ACTIVE with _just_ "--verbose", I don't think it would be a
good idea to activate it. We should either silently ignore --verbose
then, or complain and die.
-Peff
^ permalink raw reply
* Re: Prove "Tests out of sequence" Error
From: Jacob Keller @ 2016-10-21 15:29 UTC (permalink / raw)
To: Jeff King; +Cc: Stefan Beller, Lars Schneider, git
In-Reply-To: <20161021084348.dp4jfpfownodl7nz@sigill.intra.peff.net>
On Fri, Oct 21, 2016 at 1:43 AM, Jeff King <peff@peff.net> wrote:
> prove t5547-push-quarantine.sh :: -v
>
> The Travis tests do exactly this (along with --tee to actually save the
> output). It seems like a minor miracle that this is the first test
> output that has actually triggered as TAP input. I'd suggest that the
> problem is not in the test, though, but that our "--verbose" option is
> unsuitable for using with a TAP harness.
>
> The obvious fix would be to send "--verbose" output to stderr, but I
> suspect that would end up annoying for people who do:
>
> ./t5547-push-quarantine.sh -v | less
>
> to read long output. Probably we need some option like "--log" which
> logs in the same way that "--tee" does, but _without_ sending the data
> to stdout. Naively, that just means replacing the "tee" invocation with
> "cat", but I suspect it will be a lot more complicated than that,
> because we still need to let the TAP output go to stdout.
>
> -Peff
Can we determine that we're running with something monitoring the TAP
output? Because then we could make verbose go to stderr instead
dynamically?
Thanks,
Jake
^ permalink raw reply
* Re: What's cooking in git.git (Oct 2016, #05; Thu, 20)
From: Pranit Bauva @ 2016-10-21 15:28 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, Lars Schneider, Git List
In-Reply-To: <alpine.DEB.2.20.1610211457030.3264@virtualbox>
Hey Johannes,
On Fri, Oct 21, 2016 at 6:38 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> I am unfortunately still busy with trying to figure out what exactly makes
> t6030 hang on `pu` (seems it thinks stdin is a tty and just waits for an
> answer), and then trying to reduce that insane amount of time wasted on
> running, and waiting for, the test suite, and for unrelated reasons I'll
> have to go offline for the rest of the day, so I will most likely be
> unable to assist further with this.
My patch series [1] is recently merged into pu which changed a lot of
things around "git bisect next" which I remember that you mention it
somewhere else too but don't exactly recollect where. There were some
*really* drastic changes and they are evident with my conversation
with Junio. Maybe you could tell a little bit more about what's
happening with t6030 so that even I could dig further.
Heads up: The changes in "git bisect next" were related to revision
walking so you might want to check it out.
Sorry for any inconvenience caused by this series.
Regards,
Pranit Bauva
^ permalink raw reply
* Re: Git context menu in Windows Exporer has a “git bash” option but it doesn't work
From: Stefan Monov @ 2016-10-21 13:11 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.2.20.1610211437510.3264@virtualbox>
On Fri, Oct 21, 2016 at 3:40 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Are you referring to Git for Windows?
> Which version? From where did you obtain it?
I'm not sure about the answer to these questions, so to clear things
up, I'm downloading it anew now. Getting it from
https://git-scm.com/download/win .
I downloaded and installed Git for Windows, version 2.10.1, 32-bit.
Indeed the context menu option is now called "Git Bash Here". I don't
know what it was called before I installed this new version of git,
but now it works fine. I.e. no more auto-closing bash window.
Thanks for (indirectly) helping me resolve the issue. :)
On Fri, Oct 21, 2016 at 3:40 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi Stefan,
>
> On Fri, 21 Oct 2016, Stefan Monov wrote:
>
>> The default git distribution for windows
>
> Are you referring to Git for Windows? Which version? From where did you
> obtain it?
>
>> contains, besides the CLI tools, a shell integration, i.e. a context
>> menu for Windows Explorer. This context menu has a "Git bash" option
>> which I suppose should open a Git bash prompt cd'd to the current
>> directory.
>
> I guess you mean either "Git Bash Here" or "Git Bash" (not "Git bash")?
>
>> But instead, the git bash window opens and immediately closes, giving me
>> no chance to even see what it says inside it. Any fix?
>
> Sorry, there is not enough information to go on here. In Git for Windows'
> bug tracker, we were careful to provide you with a template that helps
> with providing relevant information:
> https://github.com/git-for-windows/git/issues/new
>
>> Note: Opening Git Bash from the Windows Start Menu works fine, but if
>> I open it that way, then I need to manually cd to the needed dir.
>
> For me, both work fine. For the record, I use Git for Windows (64-bit)
> v2.10.1, as downloaded from https://git-for-windows.github.io/:
>
> $ git version
> git version 2.10.1.windows.1
>
> Ciao,
> Johannes
>
^ permalink raw reply
* Re: Drastic jump in the time required for the test suite
From: Matthieu Moy @ 2016-10-21 13:10 UTC (permalink / raw)
To: René Scharfe
Cc: Duy Nguyen, Johannes Schindelin, Junio C Hamano, Git Mailing List
In-Reply-To: <e0e320ce-14a1-b4a8-aa07-6bc4f3c4a424@web.de>
René Scharfe <l.s.r@web.de> writes:
> I get this on WSL with prove -j8:
>
> Files=750, Tests=13657, 906 wallclock secs ( 8.51 usr 17.17 sys + 282.62 cusr 3731.85 csys = 4040.15 CPU)
>
> And this for a run on Debian inside a Hyper-V VM on the same system:
>
> Files=759, Tests=13895, 99 wallclock secs ( 4.81 usr 1.06 sys + 39.70 cusr 25.82 csys = 71.39 CPU)
What about the same without WSL on windows?
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* Re: What's cooking in git.git (Oct 2016, #05; Thu, 20)
From: Johannes Schindelin @ 2016-10-21 13:08 UTC (permalink / raw)
To: Junio C Hamano, Lars Schneider; +Cc: git
In-Reply-To: <xmqqk2d2ein7.fsf@gitster.mtv.corp.google.com>
Hi Junio & Lars,
On Thu, 20 Oct 2016, Junio C Hamano wrote:
> * ls/filter-process (2016-10-17) 14 commits
> (merged to 'next' on 2016-10-19 at ffd0de042c)
> + contrib/long-running-filter: add long running filter example
> + convert: add filter.<driver>.process option
> + convert: prepare filter.<driver>.process option
> + convert: make apply_filter() adhere to standard Git error handling
> + pkt-line: add functions to read/write flush terminated packet streams
> + pkt-line: add packet_write_gently()
> + pkt-line: add packet_flush_gently()
> + pkt-line: add packet_write_fmt_gently()
> + pkt-line: extract set_packet_header()
> + pkt-line: rename packet_write() to packet_write_fmt()
> + run-command: add clean_on_exit_handler
> + run-command: move check_pipe() from write_or_die to run_command
> + convert: modernize tests
> + convert: quote filter names in error messages
>
> The smudge/clean filter API expect an external process is spawned
> to filter the contents for each path that has a filter defined. A
> new type of "process" filter API has been added to allow the first
> request to run the filter for a path to spawn a single process, and
> all filtering need is served by this single process for multiple
> paths, reducing the process creation overhead.
>
> Will merge to 'master'.
This breaks in Git for Windows' SDK (I only now realized that t0060 was
not the only thing breaking in `next` for a while now):
-- snip --
not ok 15 - required process filter should filter data
#
# test_config_global filter.protocol.process
# "$TEST_DIRECTORY/t002
# 1/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"
# )
#
ok 16 - required process filter takes precedence
not ok 17 - required process filter should be used only for "clean"
operation on
ly
#
# test_config_global filter.protocol.process
# "$TEST_DIRECTORY/t002
# 1/rot13-filter.pl clean" &&
# rm -rf repo &&
# mkdir repo &&
# (
# cd repo &&
# git init &&
#
# echo "*.r filter=protocol" >.gitattributes &&
# cp "$TEST_ROOT/test.o" test.r &&
# S=$(file_size test.r) &&
#
# filter_git add . &&
# cat >expected.log <<-EOF &&
# START
# init handshake complete
# IN: clean test.r $S [OK] -- OUT: $S . [OK]
# STOP
# EOF
# test_cmp_count expected.log rot13-filter.log &&
#
# rm test.r &&
#
# filter_git checkout --quiet --no-progress . &&
# # If the filter would be used for "smudge", too,
# we woul
# d see
# # "IN: smudge test.r 57 [OK] -- OUT: 57 . [OK]"
# here
# cat >expected.log <<-EOF &&
# START
# init handshake complete
# STOP
# EOF
# test_cmp_exclude_clean expected.log
# rot13-filter.log
# )
-- snap --
Unsurprisingly, bisect identifies "convert: add filter.<driver>.process
option" as the first bad commit, although it only fails on the test case
15, but not on 17.
I am unfortunately still busy with trying to figure out what exactly makes
t6030 hang on `pu` (seems it thinks stdin is a tty and just waits for an
answer), and then trying to reduce that insane amount of time wasted on
running, and waiting for, the test suite, and for unrelated reasons I'll
have to go offline for the rest of the day, so I will most likely be
unable to assist further with this.
Sorry,
Johannes
^ permalink raw reply
* Re: [BUG] fetch output is ugly in 'next'
From: Duy Nguyen @ 2016-10-21 13:07 UTC (permalink / raw)
To: Jeff King; +Cc: Git Mailing List
In-Reply-To: <CACsJy8Bxn1qV+xXNnCpuOQ7qWNsz3oLt5-VG=VXZvV9dvJVvTQ@mail.gmail.com>
On Fri, Oct 21, 2016 at 7:11 PM, Duy Nguyen <pclouds@gmail.com> wrote:
> Yeah.. replacing the 4 DEFAULT_ABBREV in fetch.c with something
> sensible should do it.
Correction (if somebody will pick this up), it's
TRANSPORT_SUMMARY_WIDTH that needs to be adjusted, not those four.
--
Duy
^ permalink raw reply
* Re: Git context menu in Windows Exporer has a “git bash” option but it doesn't work
From: Johannes Schindelin @ 2016-10-21 12:40 UTC (permalink / raw)
To: Stefan Monov; +Cc: git
In-Reply-To: <CAJtFkWur0NfvvV-QT2XmEW=MSJ7Ye=hX7HujEQhTFGiah2_yBQ@mail.gmail.com>
Hi Stefan,
On Fri, 21 Oct 2016, Stefan Monov wrote:
> The default git distribution for windows
Are you referring to Git for Windows? Which version? From where did you
obtain it?
> contains, besides the CLI tools, a shell integration, i.e. a context
> menu for Windows Explorer. This context menu has a "Git bash" option
> which I suppose should open a Git bash prompt cd'd to the current
> directory.
I guess you mean either "Git Bash Here" or "Git Bash" (not "Git bash")?
> But instead, the git bash window opens and immediately closes, giving me
> no chance to even see what it says inside it. Any fix?
Sorry, there is not enough information to go on here. In Git for Windows'
bug tracker, we were careful to provide you with a template that helps
with providing relevant information:
https://github.com/git-for-windows/git/issues/new
> Note: Opening Git Bash from the Windows Start Menu works fine, but if
> I open it that way, then I need to manually cd to the needed dir.
For me, both work fine. For the record, I use Git for Windows (64-bit)
v2.10.1, as downloaded from https://git-for-windows.github.io/:
$ git version
git version 2.10.1.windows.1
Ciao,
Johannes
^ permalink raw reply
* [PATCH v5 27/27] sequencer: mark all error messages for translation
From: Johannes Schindelin @ 2016-10-21 12:26 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jakub Narębski, Johannes Sixt, Ramsay Jones
In-Reply-To: <cover.1477052405.git.johannes.schindelin@gmx.de>
There was actually only one error message that was not yet marked for
translation.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
sequencer.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 4c10c93..a61fe76 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -479,6 +479,20 @@ static char **read_author_script(void)
return env;
}
+static const char staged_changes_advice[] =
+N_("you have staged changes in your working tree\n"
+"If these changes are meant to be squashed into the previous commit, run:\n"
+"\n"
+" git commit --amend %s\n"
+"\n"
+"If they are meant to go into a new commit, run:\n"
+"\n"
+" git commit %s\n"
+"\n"
+"In both cases, once you're done, continue with:\n"
+"\n"
+" git rebase --continue\n");
+
/*
* If we are cherry-pick, and if the merge did not result in
* hand-editing, we will hit this commit and inherit the original
@@ -505,16 +519,8 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts,
if (!env) {
const char *gpg_opt = gpg_sign_opt_quoted(opts);
- return error("you have staged changes in your working "
- "tree. If these changes are meant to be\n"
- "squashed into the previous commit, run:\n\n"
- " git commit --amend %s\n\n"
- "If they are meant to go into a new commit, "
- "run:\n\n"
- " git commit %s\n\n"
- "In both cases, once you're done, continue "
- "with:\n\n"
- " git rebase --continue\n", gpg_opt, gpg_opt);
+ return error(_(staged_changes_advice),
+ gpg_opt, gpg_opt);
}
}
--
2.10.1.583.g721a9e0
^ permalink raw reply related
* [PATCH v5 24/27] sequencer: mark action_name() for translation
From: Johannes Schindelin @ 2016-10-21 12:26 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jakub Narębski, Johannes Sixt, Ramsay Jones
In-Reply-To: <cover.1477052405.git.johannes.schindelin@gmx.de>
The definition of this function goes back all the way to 043a449
(sequencer: factor code out of revert builtin, 2012-01-11), long before a
serious effort was made to translate all the error messages.
It is slightly out of the context of the current patch series (whose
purpose it is to re-implement the performance critical parts of the
interactive rebase in C) to make the error messages in the sequencer
translatable, but what the heck. We'll just do it while we're looking at
this part of the code.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
sequencer.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index bd11db4..ff76b6f 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -168,7 +168,7 @@ int sequencer_remove_state(struct replay_opts *opts)
static const char *action_name(const struct replay_opts *opts)
{
- return opts->action == REPLAY_REVERT ? "revert" : "cherry-pick";
+ return opts->action == REPLAY_REVERT ? N_("revert") : N_("cherry-pick");
}
struct commit_message {
@@ -300,10 +300,10 @@ static struct tree *empty_tree(void)
static int error_dirty_index(struct replay_opts *opts)
{
if (read_cache_unmerged())
- return error_resolve_conflict(action_name(opts));
+ return error_resolve_conflict(_(action_name(opts)));
error(_("Your local changes would be overwritten by %s."),
- action_name(opts));
+ _(action_name(opts)));
if (advice_commit_before_merge)
advise(_("Commit your changes or stash them to proceed."));
@@ -321,7 +321,7 @@ static int fast_forward_to(const unsigned char *to, const unsigned char *from,
if (checkout_fast_forward(from, to, 1))
return -1; /* the callee should have complained already */
- strbuf_addf(&sb, _("%s: fast-forward"), action_name(opts));
+ strbuf_addf(&sb, _("%s: fast-forward"), _(action_name(opts)));
transaction = ref_transaction_begin(&err);
if (!transaction ||
@@ -397,7 +397,7 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
write_locked_index(&the_index, &index_lock, COMMIT_LOCK))
/* TRANSLATORS: %s will be "revert" or "cherry-pick" */
return error(_("%s: Unable to write new index file"),
- action_name(opts));
+ _(action_name(opts)));
rollback_lock_file(&index_lock);
if (opts->signoff)
@@ -835,14 +835,14 @@ static int read_and_refresh_cache(struct replay_opts *opts)
if (read_index_preload(&the_index, NULL) < 0) {
rollback_lock_file(&index_lock);
return error(_("git %s: failed to read the index"),
- action_name(opts));
+ _(action_name(opts)));
}
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL, NULL);
if (the_index.cache_changed && index_fd >= 0) {
if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK)) {
rollback_lock_file(&index_lock);
return error(_("git %s: failed to refresh the index"),
- action_name(opts));
+ _(action_name(opts)));
}
}
rollback_lock_file(&index_lock);
--
2.10.1.583.g721a9e0
^ permalink raw reply related
* [PATCH v5 20/27] sequencer: roll back lock file if write_message() failed
From: Johannes Schindelin @ 2016-10-21 12:26 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jakub Narębski, Johannes Sixt, Ramsay Jones
In-Reply-To: <cover.1477052405.git.johannes.schindelin@gmx.de>
There is no need to wait until the atexit() handler kicks in at the end.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
sequencer.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 745c86f..9fced42 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -241,10 +241,14 @@ static int write_message(struct strbuf *msgbuf, const char *filename)
int msg_fd = hold_lock_file_for_update(&msg_file, filename, 0);
if (msg_fd < 0)
return error_errno(_("Could not lock '%s'"), filename);
- if (write_in_full(msg_fd, msgbuf->buf, msgbuf->len) < 0)
- return error_errno(_("Could not write to %s"), filename);
- if (commit_lock_file(&msg_file) < 0)
+ if (write_in_full(msg_fd, msgbuf->buf, msgbuf->len) < 0) {
+ rollback_lock_file(&msg_file);
+ return error_errno(_("Could not write to '%s'"), filename);
+ }
+ if (commit_lock_file(&msg_file) < 0) {
+ rollback_lock_file(&msg_file);
return error(_("Error wrapping up %s."), filename);
+ }
return 0;
}
--
2.10.1.583.g721a9e0
^ permalink raw reply related
* [PATCH v5 26/27] sequencer: start error messages consistently with lower case
From: Johannes Schindelin @ 2016-10-21 12:26 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jakub Narębski, Johannes Sixt, Ramsay Jones
In-Reply-To: <cover.1477052405.git.johannes.schindelin@gmx.de>
Quite a few error messages touched by this developer during the work to
speed up rebase -i started with an upper case letter, violating our
current conventions. Instead of sneaking in this fix (and forgetting
quite a few error messages), let's just have one wholesale patch fixing
all of the error messages in the sequencer.
While at it, the funny "error: Error wrapping up..." was changed to a
less funny, but more helpful, "error: failed to finalize...".
Pointed out by Junio Hamano.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
sequencer.c | 68 +++++++++++++++++++++----------------------
t/t3501-revert-cherry-pick.sh | 2 +-
2 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 340d0ed..4c10c93 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -241,18 +241,18 @@ static int write_message(const void *buf, size_t len, const char *filename,
int msg_fd = hold_lock_file_for_update(&msg_file, filename, 0);
if (msg_fd < 0)
- return error_errno(_("Could not lock '%s'"), filename);
+ return error_errno(_("could not lock '%s'"), filename);
if (write_in_full(msg_fd, buf, len) < 0) {
rollback_lock_file(&msg_file);
- return error_errno(_("Could not write to '%s'"), filename);
+ return error_errno(_("could not write to '%s'"), filename);
}
if (append_eol && write(msg_fd, "\n", 1) < 0) {
rollback_lock_file(&msg_file);
- return error_errno(_("Could not write eol to '%s"), filename);
+ return error_errno(_("could not write eol to '%s"), filename);
}
if (commit_lock_file(&msg_file) < 0) {
rollback_lock_file(&msg_file);
- return error(_("Error wrapping up '%s'."), filename);
+ return error(_("failed to finalize '%s'."), filename);
}
return 0;
@@ -302,11 +302,11 @@ static int error_dirty_index(struct replay_opts *opts)
if (read_cache_unmerged())
return error_resolve_conflict(_(action_name(opts)));
- error(_("Your local changes would be overwritten by %s."),
+ error(_("your local changes would be overwritten by %s."),
_(action_name(opts)));
if (advice_commit_before_merge)
- advise(_("Commit your changes or stash them to proceed."));
+ advise(_("commit your changes or stash them to proceed."));
return -1;
}
@@ -415,7 +415,7 @@ static int is_index_unchanged(void)
struct commit *head_commit;
if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, head_sha1, NULL))
- return error(_("Could not resolve HEAD commit\n"));
+ return error(_("could not resolve HEAD commit\n"));
head_commit = lookup_commit(head_sha1);
@@ -435,7 +435,7 @@ static int is_index_unchanged(void)
if (!cache_tree_fully_valid(active_cache_tree))
if (cache_tree_update(&the_index, 0))
- return error(_("Unable to update cache tree\n"));
+ return error(_("unable to update cache tree\n"));
return !hashcmp(active_cache_tree->sha1, head_commit->tree->object.oid.hash);
}
@@ -505,7 +505,7 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts,
if (!env) {
const char *gpg_opt = gpg_sign_opt_quoted(opts);
- return error("You have staged changes in your working "
+ return error("you have staged changes in your working "
"tree. If these changes are meant to be\n"
"squashed into the previous commit, run:\n\n"
" git commit --amend %s\n\n"
@@ -558,12 +558,12 @@ static int is_original_commit_empty(struct commit *commit)
const unsigned char *ptree_sha1;
if (parse_commit(commit))
- return error(_("Could not parse commit %s\n"),
+ return error(_("could not parse commit %s\n"),
oid_to_hex(&commit->object.oid));
if (commit->parents) {
struct commit *parent = commit->parents->item;
if (parse_commit(parent))
- return error(_("Could not parse parent commit %s\n"),
+ return error(_("could not parse parent commit %s\n"),
oid_to_hex(&parent->object.oid));
ptree_sha1 = parent->tree->object.oid.hash;
} else {
@@ -647,7 +647,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
* to work on.
*/
if (write_cache_as_tree(head, 0, NULL))
- return error(_("Your index file is unmerged."));
+ return error(_("your index file is unmerged."));
} else {
unborn = get_sha1("HEAD", head);
if (unborn)
@@ -666,7 +666,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
struct commit_list *p;
if (!opts->mainline)
- return error(_("Commit %s is a merge but no -m option was given."),
+ return error(_("commit %s is a merge but no -m option was given."),
oid_to_hex(&commit->object.oid));
for (cnt = 1, p = commit->parents;
@@ -674,11 +674,11 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
cnt++)
p = p->next;
if (cnt != opts->mainline || !p)
- return error(_("Commit %s does not have parent %d"),
+ return error(_("commit %s does not have parent %d"),
oid_to_hex(&commit->object.oid), opts->mainline);
parent = p->item;
} else if (0 < opts->mainline)
- return error(_("Mainline was specified but commit %s is not a merge."),
+ return error(_("mainline was specified but commit %s is not a merge."),
oid_to_hex(&commit->object.oid));
else
parent = commit->parents->item;
@@ -696,7 +696,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
oid_to_hex(&parent->object.oid));
if (get_message(commit, &msg) != 0)
- return error(_("Cannot get commit message for %s"),
+ return error(_("cannot get commit message for %s"),
oid_to_hex(&commit->object.oid));
/*
@@ -935,13 +935,13 @@ static int parse_insn_buffer(char *buf, struct todo_list *todo_list)
item = append_new_todo(todo_list);
item->offset_in_buf = p - todo_list->buf.buf;
if (parse_insn_line(item, p, eol)) {
- res = error(_("Invalid line %d: %.*s"),
+ res = error(_("invalid line %d: %.*s"),
i, (int)(eol - p), p);
item->command = -1;
}
}
if (!todo_list->nr)
- return error(_("No commits parsed."));
+ return error(_("no commits parsed."));
return res;
}
@@ -954,16 +954,16 @@ static int read_populate_todo(struct todo_list *todo_list,
strbuf_reset(&todo_list->buf);
fd = open(todo_file, O_RDONLY);
if (fd < 0)
- return error_errno(_("Could not open '%s'"), todo_file);
+ return error_errno(_("could not open '%s'"), todo_file);
if (strbuf_read(&todo_list->buf, fd, 0) < 0) {
close(fd);
- return error(_("Could not read '%s'."), todo_file);
+ return error(_("could not read '%s'."), todo_file);
}
close(fd);
res = parse_insn_buffer(todo_list->buf.buf, todo_list);
if (res)
- return error(_("Unusable instruction sheet: '%s'"), todo_file);
+ return error(_("unusable instruction sheet: '%s'"), todo_file);
if (!is_rebase_i(opts)) {
enum todo_command valid =
@@ -974,9 +974,9 @@ static int read_populate_todo(struct todo_list *todo_list,
if (valid == todo_list->items[i].command)
continue;
else if (valid == TODO_PICK)
- return error(_("Cannot cherry-pick during a revert."));
+ return error(_("cannot cherry-pick during a revert."));
else
- return error(_("Cannot revert during a cherry-pick."));
+ return error(_("cannot revert during a cherry-pick."));
}
return 0;
@@ -1019,10 +1019,10 @@ static int populate_opts_cb(const char *key, const char *value, void *data)
ALLOC_GROW(opts->xopts, opts->xopts_nr + 1, opts->xopts_alloc);
opts->xopts[opts->xopts_nr++] = xstrdup(value);
} else
- return error(_("Invalid key: %s"), key);
+ return error(_("invalid key: %s"), key);
if (!error_flag)
- return error(_("Invalid value for %s: %s"), key, value);
+ return error(_("invalid value for %s: %s"), key, value);
return 0;
}
@@ -1054,7 +1054,7 @@ static int read_populate_opts(struct replay_opts *opts)
* are pretty certain that it is syntactically correct.
*/
if (git_config_from_file(populate_opts_cb, git_path_opts_file(), opts) < 0)
- return error(_("Malformed options sheet: '%s'"),
+ return error(_("malformed options sheet: '%s'"),
git_path_opts_file());
return 0;
}
@@ -1097,7 +1097,7 @@ static int create_seq_dir(void)
return -1;
}
else if (mkdir(git_path_seq_dir(), 0777) < 0)
- return error_errno(_("Could not create sequencer directory '%s'"),
+ return error_errno(_("could not create sequencer directory '%s'"),
git_path_seq_dir());
return 0;
}
@@ -1111,17 +1111,17 @@ static int save_head(const char *head)
fd = hold_lock_file_for_update(&head_lock, git_path_head_file(), 0);
if (fd < 0) {
rollback_lock_file(&head_lock);
- return error_errno(_("Could not lock HEAD"));
+ return error_errno(_("could not lock HEAD"));
}
strbuf_addf(&buf, "%s\n", head);
if (write_in_full(fd, buf.buf, buf.len) < 0) {
rollback_lock_file(&head_lock);
- return error_errno(_("Could not write to '%s'"),
+ return error_errno(_("could not write to '%s'"),
git_path_head_file());
}
if (commit_lock_file(&head_lock) < 0) {
rollback_lock_file(&head_lock);
- return error(_("Error wrapping up '%s'."), git_path_head_file());
+ return error(_("failed to finalize '%s'."), git_path_head_file());
}
return 0;
}
@@ -1200,14 +1200,14 @@ static int save_todo(struct todo_list *todo_list, struct replay_opts *opts)
fd = hold_lock_file_for_update(&todo_lock, todo_path, 0);
if (fd < 0)
- return error_errno(_("Could not lock '%s'"), todo_path);
+ return error_errno(_("could not lock '%s'"), todo_path);
offset = next < todo_list->nr ?
todo_list->items[next].offset_in_buf : todo_list->buf.len;
if (write_in_full(fd, todo_list->buf.buf + offset,
todo_list->buf.len - offset) < 0)
- return error_errno(_("Could not write to '%s'"), todo_path);
+ return error_errno(_("could not write to '%s'"), todo_path);
if (commit_lock_file(&todo_lock) < 0)
- return error(_("Error wrapping up '%s'."), todo_path);
+ return error(_("failed to finalize '%s'."), todo_path);
return 0;
}
@@ -1382,7 +1382,7 @@ int sequencer_pick_revisions(struct replay_opts *opts)
create_seq_dir() < 0)
return -1;
if (get_sha1("HEAD", sha1) && (opts->action == REPLAY_REVERT))
- return error(_("Can't revert as initial commit"));
+ return error(_("can't revert as initial commit"));
if (save_head(sha1_to_hex(sha1)))
return -1;
if (save_opts(opts))
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 51f3bbb..394f000 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -96,7 +96,7 @@ test_expect_success 'revert forbidden on dirty working tree' '
echo content >extra_file &&
git add extra_file &&
test_must_fail git revert HEAD 2>errors &&
- test_i18ngrep "Your local changes would be overwritten by " errors
+ test_i18ngrep "your local changes would be overwritten by " errors
'
--
2.10.1.583.g721a9e0
^ permalink raw reply related
* [PATCH v5 25/27] sequencer: quote filenames in error messages
From: Johannes Schindelin @ 2016-10-21 12:26 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jakub Narębski, Johannes Sixt, Ramsay Jones
In-Reply-To: <cover.1477052405.git.johannes.schindelin@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 3621 bytes --]
This makes the code consistent by fixing quite a couple of error messages.
Suggested by Jakub Narębski.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
sequencer.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index ff76b6f..340d0ed 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -252,7 +252,7 @@ static int write_message(const void *buf, size_t len, const char *filename,
}
if (commit_lock_file(&msg_file) < 0) {
rollback_lock_file(&msg_file);
- return error(_("Error wrapping up %s."), filename);
+ return error(_("Error wrapping up '%s'."), filename);
}
return 0;
@@ -954,16 +954,16 @@ static int read_populate_todo(struct todo_list *todo_list,
strbuf_reset(&todo_list->buf);
fd = open(todo_file, O_RDONLY);
if (fd < 0)
- return error_errno(_("Could not open %s"), todo_file);
+ return error_errno(_("Could not open '%s'"), todo_file);
if (strbuf_read(&todo_list->buf, fd, 0) < 0) {
close(fd);
- return error(_("Could not read %s."), todo_file);
+ return error(_("Could not read '%s'."), todo_file);
}
close(fd);
res = parse_insn_buffer(todo_list->buf.buf, todo_list);
if (res)
- return error(_("Unusable instruction sheet: %s"), todo_file);
+ return error(_("Unusable instruction sheet: '%s'"), todo_file);
if (!is_rebase_i(opts)) {
enum todo_command valid =
@@ -1054,7 +1054,7 @@ static int read_populate_opts(struct replay_opts *opts)
* are pretty certain that it is syntactically correct.
*/
if (git_config_from_file(populate_opts_cb, git_path_opts_file(), opts) < 0)
- return error(_("Malformed options sheet: %s"),
+ return error(_("Malformed options sheet: '%s'"),
git_path_opts_file());
return 0;
}
@@ -1097,7 +1097,7 @@ static int create_seq_dir(void)
return -1;
}
else if (mkdir(git_path_seq_dir(), 0777) < 0)
- return error_errno(_("Could not create sequencer directory %s"),
+ return error_errno(_("Could not create sequencer directory '%s'"),
git_path_seq_dir());
return 0;
}
@@ -1116,12 +1116,12 @@ static int save_head(const char *head)
strbuf_addf(&buf, "%s\n", head);
if (write_in_full(fd, buf.buf, buf.len) < 0) {
rollback_lock_file(&head_lock);
- return error_errno(_("Could not write to %s"),
+ return error_errno(_("Could not write to '%s'"),
git_path_head_file());
}
if (commit_lock_file(&head_lock) < 0) {
rollback_lock_file(&head_lock);
- return error(_("Error wrapping up %s."), git_path_head_file());
+ return error(_("Error wrapping up '%s'."), git_path_head_file());
}
return 0;
}
@@ -1166,9 +1166,9 @@ int sequencer_rollback(struct replay_opts *opts)
return rollback_single_pick();
}
if (!f)
- return error_errno(_("cannot open %s"), git_path_head_file());
+ return error_errno(_("cannot open '%s'"), git_path_head_file());
if (strbuf_getline_lf(&buf, f)) {
- error(_("cannot read %s: %s"), git_path_head_file(),
+ error(_("cannot read '%s': %s"), git_path_head_file(),
ferror(f) ? strerror(errno) : _("unexpected end of file"));
fclose(f);
goto fail;
@@ -1207,7 +1207,7 @@ static int save_todo(struct todo_list *todo_list, struct replay_opts *opts)
todo_list->buf.len - offset) < 0)
return error_errno(_("Could not write to '%s'"), todo_path);
if (commit_lock_file(&todo_lock) < 0)
- return error(_("Error wrapping up %s."), todo_path);
+ return error(_("Error wrapping up '%s'."), todo_path);
return 0;
}
--
2.10.1.583.g721a9e0
^ permalink raw reply related
* [PATCH v5 22/27] sequencer: teach write_message() to append an optional LF
From: Johannes Schindelin @ 2016-10-21 12:26 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jakub Narębski, Johannes Sixt, Ramsay Jones
In-Reply-To: <cover.1477052405.git.johannes.schindelin@gmx.de>
This commit prepares for future callers that will have a pointer/length
to some text to be written that lacks an LF, yet an LF is desired.
Instead of requiring the caller to append an LF to the buffer (and
potentially allocate memory to do so), the write_message() function
learns to append an LF at the end of the file.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
sequencer.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 300952f..000ce3e 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -234,7 +234,8 @@ static void print_advice(int show_hint, struct replay_opts *opts)
}
}
-static int write_message(const void *buf, size_t len, const char *filename)
+static int write_message(const void *buf, size_t len, const char *filename,
+ int append_eol)
{
static struct lock_file msg_file;
@@ -245,6 +246,10 @@ static int write_message(const void *buf, size_t len, const char *filename)
rollback_lock_file(&msg_file);
return error_errno(_("Could not write to '%s'"), filename);
}
+ if (append_eol && write(msg_fd, "\n", 1) < 0) {
+ rollback_lock_file(&msg_file);
+ return error_errno(_("Could not write eol to '%s"), filename);
+ }
if (commit_lock_file(&msg_file) < 0) {
rollback_lock_file(&msg_file);
return error(_("Error wrapping up %s."), filename);
@@ -748,13 +753,13 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
if (res < 0)
return res;
res |= write_message(msgbuf.buf, msgbuf.len,
- git_path_merge_msg());
+ git_path_merge_msg(), 0);
} else {
struct commit_list *common = NULL;
struct commit_list *remotes = NULL;
res = write_message(msgbuf.buf, msgbuf.len,
- git_path_merge_msg());
+ git_path_merge_msg(), 0);
commit_list_insert(base, &common);
commit_list_insert(next, &remotes);
--
2.10.1.583.g721a9e0
^ permalink raw reply related
* [PATCH v5 23/27] sequencer: remove overzealous assumption in rebase -i mode
From: Johannes Schindelin @ 2016-10-21 12:26 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jakub Narębski, Johannes Sixt, Ramsay Jones
In-Reply-To: <cover.1477052405.git.johannes.schindelin@gmx.de>
The sequencer was introduced to make the cherry-pick and revert
functionality available as library function, with the original idea
being to extend the sequencer to also implement the rebase -i
functionality.
The test to ensure that all of the commands in the script are identical
to the overall operation does not mesh well with that.
Therefore let's disable the test in rebase -i mode.
While at it, error out early if the "instruction sheet" (i.e. the todo
script) could not be parsed.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
sequencer.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 000ce3e..bd11db4 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -962,7 +962,10 @@ static int read_populate_todo(struct todo_list *todo_list,
close(fd);
res = parse_insn_buffer(todo_list->buf.buf, todo_list);
- if (!res) {
+ if (res)
+ return error(_("Unusable instruction sheet: %s"), todo_file);
+
+ if (!is_rebase_i(opts)) {
enum todo_command valid =
opts->action == REPLAY_PICK ? TODO_PICK : TODO_REVERT;
int i;
@@ -976,8 +979,6 @@ static int read_populate_todo(struct todo_list *todo_list,
return error(_("Cannot revert during a cherry-pick."));
}
- if (res)
- return error(_("Unusable instruction sheet: %s"), todo_file);
return 0;
}
--
2.10.1.583.g721a9e0
^ 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