all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Arsen Arsenović" <arsen@aarsen.me>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Alan Mackenzie <acm@muc.de>, jporterbugs@gmail.com, emacs-devel@gnu.org
Subject: Re: New Git hooks for checking file names in commit messages
Date: Fri, 21 Apr 2023 17:38:19 +0200	[thread overview]
Message-ID: <865y9ptfa3.fsf@aarsen.me> (raw)
In-Reply-To: <838rel46ou.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]


Eli Zaretskii <eliz@gnu.org> writes:

>> 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^

You can also reword during a rebase, which has the advantage of not
chucking any work away.  See [1].

Everything can be changed at any point in Git, until you push, and even
then if the server agrees, so there's never a time that is too late to
error out.

Have a great day.

[1] https://git-scm.com/docs/git-rebase#_interactive_mode
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

  reply	other threads:[~2023-04-21 15:38 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21  4:55 New Git hooks for checking file names in commit messages Jim Porter
2023-04-21 12:05 ` John Yates
2023-04-21 16:44   ` Jim Porter
2023-04-21 17:44     ` Jim Porter
2023-04-22  6:11       ` Eli Zaretskii
2023-04-22  6:59         ` Jim Porter
2023-04-22  7:51           ` Eli Zaretskii
2023-04-22 19:44             ` Jim Porter
2023-04-22 23:21               ` John Yates
2023-04-21 13:57 ` Alan Mackenzie
2023-04-21 15:05   ` Eli Zaretskii
2023-04-21 15:38     ` Arsen Arsenović [this message]
2023-04-21 15:50       ` Eli Zaretskii
2023-04-21 16:20         ` Arsen Arsenović
2023-04-21 17:44           ` Eli Zaretskii
2023-04-21 17:50             ` Arsen Arsenović
2023-04-22  6:16               ` Eli Zaretskii
2023-04-21 18:25             ` Andreas Schwab
2023-04-21 19:03         ` Björn Bidar
2023-04-21 19:53           ` Jim Porter
2023-04-22  7:03           ` Eli Zaretskii
2023-04-22 19:52             ` Jim Porter
2023-04-23  6:11               ` Eli Zaretskii
2023-04-23  7:07                 ` Jim Porter
2023-04-23  7:37                   ` Eli Zaretskii
2023-04-23 19:15                     ` Jim Porter
2023-04-23 19:24                       ` Eli Zaretskii
2023-04-23  7:19                 ` Jim Porter
2023-04-23  7:39                   ` Eli Zaretskii
2023-04-23  9:51                     ` Björn Bidar
2023-04-22 23:55     ` Dmitry Gutov
2023-04-23  5:36       ` Eli Zaretskii
2023-04-23  9:47       ` Björn Bidar
2023-04-21 16:39   ` Jim Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=865y9ptfa3.fsf@aarsen.me \
    --to=arsen@aarsen.me \
    --cc=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jporterbugs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.