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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adam Monsen <haircut@xxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]