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

Re: [PATCH v2 1/3] advice: handle "rebase" in error_resolve_conflict()

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 30, 2023, 05:06 UTC
Message-ID
<xmqqv8he9cx6.fsf@gitster.g>
In-Reply-To
<ZEzErKvmBPwP0Hsp@ugly>
Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes:
Show 41 quoted lines
> On Fri, Apr 28, 2023 at 12:01:02PM -0700, Junio C Hamano wrote:
>>Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes:
>>
>>> This makes sure that we get a properly translated message rather than
>>> inserting the command (which we failed to translate) into a generic
>>> fallback message.
>>
>>Hmph, can this be accompanied with a change to add a test to an
>>existing test script to demonstrate that the function can be called
>>with me set to "rebase" and results in a generic message?
>>
> i suppose it could, but see next paragraph.
>
>>> We now also BUG() out when encountering an unexpected command.
>>
>>This needs to be reviewed by somebody who is more familiar with the
>>rebase/chrry-pick/revert/sequencer codepaths so that they can give a
>>definitive "good--I know that we never call this function with any
>>other value in 'me'" and that person would not be me.
>>
> assuming we care only about in-tree code, i'm just about as confident
> about this as one can reasonably be - because i grepped through the
> code, recursively looking for entry points. there are several calls
> via die_resolve_conflict() which have hard-coded `me`s (none of which
> is rebase), and two from the sequencer, where `me` comes from
> action_name(), which in turn returns one of three hard-coded strings
> (one of which is rebase). the latter is also kinda the test case,
> because it is obvious that this will be actually invoked when the
> situation occurs. it's probably also how i actually ran into the
> problem in the first place (i surely wasn't *looking* for it ...).
>
>>> Arguably, it would be cleaner to pass the command as an enum in the
>>> first place ...
>>
>>True, but that can be left to a different topic, I would think.
>>
> yes, otherwise i'd have already done it. ^^
> i can make it more explicit if you prefer that.
>
> if you agree with the reasoning, i'll prepare an update to the commit
> message and leave the patch as-is.

Yeah, how you arrived the conclusion that just covering "rebase" in addition to what the code already covers would make the if/elseif cascade complete is a very helpful addition to the log message.

Previous: Oswald BuddenhagenNext: Oswald Buddenhagen
Message 19 of 21 in “Capitalization and punctuation fixes to some user visible messages”
  1. 1/3 Capitalization and punctuation fixes to some user visible messagesOswald Buddenhagen, Mar 23, 2023
  2. 3/3 advice: translate all actions in error_resolve_conflict()Oswald Buddenhagen, Mar 23, 2023
  3. Junio C HamanoMar 24, 2023
  4. 2/3 sequencer: actually translate report in do_exec()Oswald Buddenhagen, Mar 23, 2023
  5. Junio C HamanoMar 23, 2023
  6. Oswald BuddenhagenMar 23, 2023
  7. Junio C HamanoMar 23, 2023
  8. Oswald BuddenhagenMar 23, 2023
  9. Junio C HamanoMar 23, 2023
  10. Oswald BuddenhagenMar 23, 2023
  11. 1/3 advice: handle "rebase" in error_resolve_conflict()Oswald Buddenhagen, Apr 28, 2023
  12. 2/3 sequencer: actually translate report in do_exec()Oswald Buddenhagen, Apr 28, 2023
  13. Junio C HamanoApr 28, 2023
  14. 3/3 Capitalization and punctuation fixes to some user visible messagesOswald Buddenhagen, Apr 28, 2023
  15. Junio C HamanoApr 28, 2023
  16. Junio C HamanoApr 28, 2023
  17. Junio C HamanoApr 28, 2023
  18. Oswald BuddenhagenApr 29, 2023
  19. Junio C HamanoApr 30, 2023
  20. advice: handle "rebase" in error_resolve_conflict()Oswald Buddenhagen, Aug 7, 2023
  21. Junio C HamanoAug 7, 2023

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.