From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Brooke Kuhlmann <brooke@alchemists.io>
Cc: git@vger.kernel.org
Subject: Re: Git 2.45.1 - What is the right way to clone with global hooks disabled?
Date: Wed, 15 May 2024 22:25:25 +0000 [thread overview]
Message-ID: <ZkU2Vao8yBHYdUmJ@tapette.crustytoothpaste.net> (raw)
In-Reply-To: <FAFA34CB-9732-4A0A-87FB-BDB272E6AEE8@alchemists.io>
[-- Attachment #1: Type: text/plain, Size: 1853 bytes --]
On 2024-05-15 at 15:53:26, Brooke Kuhlmann wrote:
> Hello. 👋
>
> With the release of Git 2.45.1, I can no longer do this when cloning trusted repositories (my own) for build and deployment purposes:
>
> git clone --config core.hooksPath=/dev/null https://github.com/bkuhlmann/infusible
>
> I have automation in place where I want my global Git Hooks to be ignored when cloning like this. The solution is to do this:
>
> GIT_CLONE_PROTECTION_ACTIVE=false git clone --config core.hooksPath=/dev/null https://github.com/bkuhlmann/infusible
>
> ...but is there a better, more secure, way to clone a repository while ignoring any global Git Hooks from firing without a lot of effort?
I think the solution you have is the best one for 2.45.1 right now. The
patches which introduced this change also introduced a regression with
Git LFS, and I've proposed two revert patches, which would also restore
the old behaviour for you.
My reverts are somewhat controversial and there's been two different
approaches proposed, but I don't believe they will solve your problem,
so if the reverts are not merged, then I think the solution you have is
the best one for now. It's possible someone could send a different
patch to address your use case, but I don't know of any plans to do so
at the moment.
I didn't see my patches in seen earlier, but it's possible that Junio
has just been busy with other things and may pick them up (or not) in
the future.
If they're not adopted, while I'm not personally planning to send
patches for your use case, I do think it's a valuable and useful use
case for us to have and consider, so I hope someone does send a patch
separately.
[0] https://lore.kernel.org/git/ZkO-b6Nswrn9H7Ed@tapette.crustytoothpaste.net/T/
--
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2024-05-15 22:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-15 15:53 Git 2.45.1 - What is the right way to clone with global hooks disabled? Brooke Kuhlmann
2024-05-15 22:25 ` brian m. carlson [this message]
2024-05-16 14:59 ` Junio C Hamano
2024-05-16 12:13 ` Johannes Schindelin
2024-05-16 13:05 ` Brooke Kuhlmann
2024-05-16 14:56 ` Junio C Hamano
2024-05-17 13:08 ` Johannes Schindelin
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=ZkU2Vao8yBHYdUmJ@tapette.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=brooke@alchemists.io \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).