Re: [PATCH] commit & merge: modularize the empty message validator
From: Kaartic Sivaraam <hidden>
Date: 2017-07-13 13:00:32
On Tue, 2017-07-11 at 13:22 -0700, Junio C Hamano wrote:
Having said all that, I am not sure "Prevent such surprises" is a problem that is realistic to begin with. When a user sees the editor buffer in "git merge", it is pre-populated with at least a single line of message "Merge branch 'foo'", possibly followed by the summary the side branch being merged, so unless the user deliberately removes everything and then add a sign-off line (because we do not usually add one), there is no room for "such surprises" in the first place. It does not _hurt_ to diagnose such a crazy case, but it feels a bit lower priority.
It's little unfortunate that I haven't mentioned the reason I asked the question that has resulted in this patch. It would explain a little about why I thought this wasn't "meh" (I hope it stands for "who care what ever"). Sometimes I abort an commit from from the editor by providing an empty commit message. Then I came to know that 'git commit' considers commit messages with just signed-off-by lines as an empty message. I tried to take advantage of that. I once tried to abort a merge by just removing the "Merge ..." line and leaving the "Signed-off" line and was surprised to see the merge happen instead of an abort. The rest is history. :) -- Kaartic