emacs-devel
[Top][All Lists]
Advanced

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

Re: New Git hooks for checking file names in commit messages


From: Eli Zaretskii
Subject: Re: New Git hooks for checking file names in commit messages
Date: Fri, 21 Apr 2023 18:05:05 +0300

> Date: Fri, 21 Apr 2023 13:57:22 +0000
> Cc: emacs-devel@gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> > There's one part that might be surprising, at least initially though:
> > while this is a hook to check commit messages, it actually runs in the
> > post-commit and pre-push phases. This is because we want to examine
> > the full diff of the commit in order to compare against the file
> > entries in the message.[1] As a result, you'll just get an advisory
> > message when you make the commit (it's too late to error out), and the
> > pre-push hook will prevent you from pushing a badly-formatted commit
> > message upstream.
> 
> How is this helpful?  Telling somebody they've made a mistake is only
> helpful if they can correct it.  If "it's too late to error out", it
> will just create annoyance.  Immediately after such a commit it is
> possible to use $ git commit --amend, but not later.  And preventing
> people from pushing these erroneous commits is, again, not helpful.

It is still helpful, because as long as you didn't push, you can still
do

   $ git reset HEAD^

and then fix whatever needs fixing and commit again.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]