Re: [PATCH] commit & merge: modularize the empty message validator
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 13, 2017, 17:58 UTC
- Message-ID
- <xmqqr2xkxlpo.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <1499950837.2427.1.camel@gmail.com>
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:
Show 7 quoted lines
> 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. :)
I think many people know about and do use the "delete all lines" (i.e. ":1,$d" in vi, or \M-< \C-SPC \M-> \C-w in Emacs) to abort out of a commit or a merge. I just do not think it is likely for them to leave Sign-off lines and remove everything else, which is more work than to delete everything, hence my reaction.