git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] rebase -i: demonstrate incorrect behavior of post-rewrite

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
May 22, 2015, 14:52 UTC
Message-ID
<vpqd21soead.fsf@anie.imag.fr>
In-Reply-To
<xmqq1ti8heu9.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 17 quoted lines
> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>
>> The 'exec' command is sending the current commit to stopped-sha, which is
>> supposed to contain the original commit (before rebase). As a result, if
>> an 'exec' command fails, the next 'git rebase --continue' will send the
>> current commit as <old-sha1> to the post-rewrite hook.
>>
>> The test currently fails with :
>>
>> --- expected.data       2015-05-21 17:55:29.000000000 +0000
>> +++ [...]post-rewrite.data      2015-05-21 17:55:29.000000000 +0000
>> @@ -1,2 +1,3 @@
>>  2362ae8e1b1b865e6161e6f0e165ffb974abf018 488028e9fac0b598b70cbeb594258a917e3f6fab
>> +488028e9fac0b598b70cbeb594258a917e3f6fab 488028e9fac0b598b70cbeb594258a917e3f6fab
>>  babc8a4c7470895886fc129f1a015c486d05a351 8edffcc4e69a4e696a1d4bab047df450caf99507
>
> Indent displayed material like the above a bit, please.
OK, will do.
> And please sign-off your patches.

Ah, I was testing submitGit, and forgot that send-email was usually doing this for me.

Show 14 quoted lines
>> +	cat >expected.data <<EOF &&
>> +$(git rev-parse C) $(git rev-parse HEAD^)
>> +$(git rev-parse D) $(git rev-parse HEAD)
>> +EOF
>
> By using a dash to start the here-document like this:
>
> 	cat >expect <<-\EOF &&
> 	$(git rev-parse C) $(git rev-parse HEAD^)
>         ...
>         EOF
>
> you can tab-indent the contents and the end marker at the same level
> to make it easier to read.

I usually do that but I just mimicked the surrounding code for consistency. If you really prefer the <<-\EOF I can resend with an additional "modernize style" patch before and this one properly formatted.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 7 in “rebase -i: fix post-rewrite hook with failed exec command”
  1. 2/2 rebase -i: fix post-rewrite hook with failed exec commandMatthieu Moy, May 22, 2015
  2. 1/2 rebase -i: demonstrate incorrect behavior of post-rewriteMatthieu Moy, May 22, 2015
  3. Junio C HamanoMay 22, 2015
  4. Matthieu MoyMay 22, 2015
  5. Junio C HamanoMay 22, 2015
  6. Roberto TyleyJun 1, 2015
  7. Junio C HamanoMay 22, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.