From: Omar Polo Subject: Re: abort commit if merged log messages are left as-is To: Stefan Sperling Cc: gameoftrees@openbsd.org Date: Mon, 06 Feb 2023 09:41:18 +0100 On 2023/01/28 15:07:55 +0100, Stefan Sperling 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. eheh, i agreed with it and was bitten by it a couple of times in the past days. I've often committed something on a wip branch, cherrypicked in the main branch, and failed to commit because the message didn't change. not sure what this tells. I still think that the default is sane, when cherrypicking/backingout from non-local/wip branches the message should be expected to change. I also don't want to go thru the rabbit hole of deciding whether a branch should be considered local or wip. (and the resulting behaviour could be surprising / annoying.) maybe for the commit/cherrypick case we could count the initial "comment" line as part of the commit message? it'd still be possible to abort the operation and the message preserved if really desired to. just wondering.