From: Junio C Hamano <gitster@pobox.com>
To: Dmytro Lymarenko <dmytro.lymarenko@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC] Optional per-repository consent before running local hooks
Date: Tue, 29 Sep 2026 11:27:09 -0700 [thread overview]
Message-ID: <xmqqjyo3hq0y.fsf@gitster.g> (raw)
In-Reply-To: <CAF1QGTmK=WY_AODsfETOtzOSuwpZ_4KV5SiNPoRv0SAYeJ7T5A@mail.gmail.com> (Dmytro Lymarenko's message of "Tue, 29 Sep 2026 07:23:43 +0300")
Dmytro Lymarenko <dmytro.lymarenko@gmail.com> writes:
> I’d like to propose an optional safety setting for Git hooks. When
> enabled, Git would check for an active hook before running it in a
> repository that the user has not approved. It would show the hook’s
> path and ask whether to run it once, trust the current hooks for this
> repository, or decline.
> This would help when a tool or setup step installs hooks from files
> supplied by a project. The check should happen immediately before
> execution, so it also covers hooks installed after a repository was
> cloned. For scripts inside the working tree, Git should ask again if
> the approved script changes.
> The default behavior could remain unchanged, with this protection
> enabled by an explicit user setting.
One thing that immediately comes to mind is that, if the "tool or
setup step" is allowed to install hooks from files supplied by a
project, it is unclear what prevents it from also approving these
hooks on the user's behalf (or, rather, leaving the same "clue" that
your proposed mechanism uses to record that the user approved
execution of these hooks).
next prev parent reply other threads:[~2026-09-29 18:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 4:23 [RFC] Optional per-repository consent before running local hooks Dmytro Lymarenko
2026-09-29 18:27 ` Junio C Hamano [this message]
2026-09-29 21:32 ` brian m. carlson
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=xmqqjyo3hq0y.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=dmytro.lymarenko@gmail.com \
--cc=git@vger.kernel.org \
/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