Don't Call commit-msg Hooks With Empty Commit Messages

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

 



Hello,

The most common reason commit messages are left empty is to abort
them. commit-msg hooks that replace empty commit messages with
non-empty ones (i) make it impossible to abort commits, (ii) are
startling to developers joining a project configured in this manner,
and (iii) can offer no value that wouldn't be equally or better
offered another way. For instance, a default commit message would be
better implemented as a commit message template or prepare-commit-msg
hook. I propose that Git eventually cease calling commit-msg hooks
when the commit-message is empty, but I would understand if backwards
compatibility were the overriding concern. On the other hand, the
empty commit message case is easy to overlook when crafting a
commit-msg hook. One consequence of this behavior is that running the
popular pre-commit tool (https://pre-commit.com/) tends to lead to a
spew of false positives to the console on an aborted commit when
configured with commit-msg hooks.

Be well,
Kurt von Laven



[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]

  Powered by Linux