Re: [PATCH v2] git-commit.txt: clarify -t requires editing message

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v2] git-commit.txt: clarify -t requires editing message

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:25

Adam Monsen [off-list ref] writes:
I *cannot* just save and quit my editor (unless I supply
--allow-empty-message). That's the behavior I find confusing...
The root cause of the confusion is that the entire "--template" code piggy
backs on the non-templated case, where we would want to error out if the
user leaves the editor without explaining the commit. And an appropriate
diagnosis message for the "normal" case is "you gave me an empty message",
but "--template" code did not bother updating that to suit what it tries
to do better, e.g. "you did not edit the template I gave you".

The check to see if the message the user left matches that came from the
template was tacked into a wrong function message_is_empty(); it should be
made into its own helper function and called from the same caller where
it calls message_is_empty() only when template_file is not NULL.  Also its
honoring "--allow-empty" needs to be reconsidered.

In other words, I think that is something that needs fixing the broken
code to behave less confusingly, not documenting its wrong behaviour.

Re: [PATCH v2] git-commit.txt: clarify -t requires editing message

From: Adam Monsen <hidden>
Date: 2016-06-15 22:53:25

Junio C Hamano wrote:
I think that is something that needs fixing the broken code to behave
less confusingly, not documenting its wrong behaviour.
Excellent! I concur.

I wish I wanted to do this enough to make time to work on it. Ivan, how
are your C chops? :)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help