From: Junio C Hamano <gitster@pobox.com>
To: "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com>
Cc: git@vger.kernel.org
Subject: Re: Interaction between pre-commit hook and git commit <pathspec>
Date: Tue, 03 Nov 2026 12:38:53 -0800 [thread overview]
Message-ID: <xmqqmrrp646a.fsf@gitster.g> (raw)
In-Reply-To: <de4f4f35-500f-4d82-acfd-ca601444f2d2@app.fastmail.com> (Kristoffer Haugsbakk's message of "Tue, 03 Nov 2026 21:13:37 +0100")
"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:
> Reading githooks documentation for pre-commit. To me it reads like
> the use case is validation/checking, not any mutation.
Yes, the hook was written exactly for validation, to preempt an
undesirable commit from being created.
We might want to do two things:
(1) clarify the documentation to say that the hook should not try
mutation, and
(2) detect and error out when the hook does try to make any
mutation.
I am not sure if (2) is feasible, though.
Thanks.
next prev parent reply other threads:[~2026-11-03 20:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 19:58 Interaction between pre-commit hook and git commit <pathspec> Kevin Lyles
2026-11-03 20:13 ` Kristoffer Haugsbakk
2026-11-03 20:38 ` Junio C Hamano [this message]
2026-11-03 20:43 ` Chris Torek
2026-11-04 16:34 ` Kevin Lyles
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=xmqqmrrp646a.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kristofferhaugsbakk@fastmail.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox