From: Junio C Hamano <gitster@pobox.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: Rafael Santiago <voidbrainvoid@tutanota.com>,
Rafael Santiago via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH] Give support for hooks based on platform
Date: Mon, 23 Aug 2021 09:35:05 -0700 [thread overview]
Message-ID: <xmqqo89oqfuu.fsf@gitster.g> (raw)
In-Reply-To: <YSLKrX/QTZtxBGDz@camp.crustytoothpaste.net> (brian m. carlson's message of "Sun, 22 Aug 2021 22:07:41 +0000")
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> Then, in general, it can be done in a shell script containing an if-then
> statement per platform using the native tools, so I'm not seeing the
> particular reason that this series is necessary if the hooks being
> executed aren't binaries. All systems on which Git runs must contain a
> POSIX-compatible shell.
When we start defining our hooks in the configuration, this may fit
with the conditional inclusion of configuration files. Current
conditions only can depend on where the repository is, but it is
easy to imagine that a conditional inclusion based on the value of
the configuration variable, so
[includeIf "var:dev.host=mac"]
path = ...
[includeIf "var:dev.host=win"]
path = ...
might be a way to say "if the dev.host configuration (presumably set
in somewhere like /etc/gitconfig or ~/.gitconfig) is set to this
value, take the configuration from the specified path.
It is up to the project to define the variable they use to switch
on; some project may ship with a set of hooks that can be used on
both windows and cygwin at the same time, in which case they do not
need the distinction between the two, and some other project may
care about the distinction. Git does not have to impose or enforce
any policy about the granularity of what "the platform" is, with
such a scheme.
prev parent reply other threads:[~2021-08-23 16:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-21 20:00 [PATCH] Give support for hooks based on platform Rafael Santiago via GitGitGadget
2021-08-21 21:50 ` brian m. carlson
2021-08-21 23:11 ` Rafael Santiago
2021-08-22 22:07 ` brian m. carlson
2021-08-23 1:07 ` Rafael Santiago
2021-08-23 16:23 ` Jeff King
2021-08-23 17:59 ` Junio C Hamano
2021-08-23 18:32 ` Jeff King
2021-08-23 16:35 ` Junio C Hamano [this message]
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=xmqqo89oqfuu.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=sandals@crustytoothpaste.net \
--cc=voidbrainvoid@tutanota.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;
as well as URLs for NNTP newsgroup(s).