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

Re: [PATCH] sequencer: don't re-read todo for revert and cherry-pick

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 25, 2019, 01:10 UTC
Message-ID
<xmqqo8x0zros.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<8c21662f-6548-a46e-9c87-eb364355cb78@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 18 quoted lines
>>> -		} else if (check_todo && !res) {
>>> +		} else if (is_rebase_i(opts) && check_todo && !res) {
>>
>> It is a bit sad that setting of check_todo is not something a single
>> helper function can decide, so that this is_rebase_i(opts) can be
>> taken into account when that helper function (the logical place
>> would be do_pick_commit()) decides to set (or not set) check_todo.
>>
>> Unfortunately, that is not sufficient, I suspect.  Why did a47ba3c7
>> ("rebase -i: check for updated todo after squash and reword",
>> 2019-08-19) decide to flip check_todo on when running TODO_EXEC?
>
> I'm not sure what you mean by this
>
> This is what I had before I saw Gábor's patch (the tests are pretty
> similar but I think we should check that the messages of all the picks
> are actually edited with --edit - that does not seem to be checked by
> the current tests)...

I first thought that unsetting *check_todo in do_pick_commit(), when !is_rebase_i(), was a clean solution. But sadly it is *not* a godo equivalent to Gábor's patch, because check_todo can be set to true without looking at is_rebase_i() in pick_commits() [*1*]. To ignore that setting where the variable's value is used, the hunk we see above in the beginning of this message is necessary.

That was what I meant. I think the "This is what I had before" patch matches my "I first thought" version, so we were on the same page and both wrong ;-)

Thanks.
[Footnote]

*1* I still do not know why a47ba3c7 ("rebase -i: check for updated todo after squash and reword", 2019-08-19) sets check_todo to true without looking at is_rebase_i(). If this unconditonal setting in TODO_EXEC did not exist, I think your "This is what I had before" patch would have been equivalent to Gábor's patch.

Previous: Phillip WoodNext: Phillip Wood
Message 15 of 16 in “git 2.24: git revert <commit1> <commit2> requires extra '--continue'?”
  1. Brian NorrisNov 22, 2019
  2. SZEDER GáborNov 23, 2019
  3. Phillip WoodNov 23, 2019
  4. sequencer: don't re-read todo for revert and cherry-pickSZEDER Gábor, Nov 23, 2019
  5. Johannes SchindelinNov 23, 2019
  6. Junio C HamanoNov 24, 2019
  7. Phillip WoodNov 24, 2019
  8. t3429: try to protect against a potential racy todo file problemSZEDER Gábor, Nov 24, 2019
  9. Junio C HamanoNov 25, 2019
  10. SZEDER GáborNov 25, 2019
  11. SZEDER GáborNov 25, 2019
  12. Phillip WoodNov 25, 2019
  13. SZEDER GáborNov 25, 2019
  14. Phillip WoodNov 25, 2019
  15. Junio C HamanoNov 25, 2019
  16. Phillip WoodNov 25, 2019

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.