"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: abort commit if merged log messages are left as-is
To:
Stefan Sperling <stsp@stsp.name>
Cc:
gameoftrees@openbsd.org
Date:
Sat, 28 Jan 2023 19:23:29 +0100

Download raw body.

Thread
On 2023/01/28 15:07:55 +0100, Stefan Sperling <stsp@stsp.name> wrote:
> Unless commit -F was used, it should be possible to abort a commit
> operation by exiting the log message editor without making any
> modifications to the log message.
> 
> This currently does not work as expected in the presence of our new
> cherrypic/backout log messages, because the prepared_log variable
> was overloaded for this purpose. Use a different variable, and add
> merged log messages to the initial log message content buffer.
> This makes it possible to abort commits as expected.
> 
> Erroring out if merged messages are not modified is probably a good
> thing in any case. I suspect that in virtually all cases the merged
> log messages should be edited, because the reason for cherrypick or
> backout should be explained.

Agreed, and if one really wants to keep the original message (why?)
they can do it with with -F.

IMHO it's handy being able to abort commit messages this way.

ok op@

> A related question is whether merged messages should be added to the
> initial content even if -F is used. Currently, they are not added and
> will be discarded. My patch keeps this behaviour as-is.
> I am unsure about this. Users will probably expect that -F messages
> are left as-is. However, merged log messages will be discarded and the
> user might be unaware of their presence.
> Let's hope if someone uses -F, they really mean -F?

fwiw I agree with the current behaviour, seems sensible.  If I type -F
I probably mean -F :)

(note: i never used -F in any VCS so I'm not the target audience)