From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
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 10:59:28 -0700 [thread overview]
Message-ID: <xmqqfsv0qby7.fsf@gitster.g> (raw)
In-Reply-To: <YSPLnWshLsWlXwUn@coredump.intra.peff.net> (Jeff King's message of "Mon, 23 Aug 2021 12:23:57 -0400")
Jeff King <peff@peff.net> writes:
> On Sun, Aug 22, 2021 at 10:07:41PM +0000, brian m. carlson wrote:
>
>> > The point is that in many cases a dependency with a script language is
>> > created only to make the hook actions portable from a platform to
>> > other, but what this script in its essence does is a thing that could
>> > be done with basic tools delivered with the current operating system.
>>
>> 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.
>
> This is my gut feeling, too (whether users know it or not, even on
> Windows most programs specified by config are being run by the shell).
>
> However, I do think there is room for Git to make this case a bit
> easier: conditional config includes. Once we are able to specify hooks
> via config (which is being worked on elsewhere), then we ought to be
> able to implement an includeIf like:
>
> [includeIf "uname_s:linux"]
> path = linux-hooks.config
> [includeIf "uname_s:windows"]
> path = windows-hooks.config
>
> The advantage being that this could apply to _all_ config, and not just
> hooks.
Heh, it seems great minds think alike.
next prev parent reply other threads:[~2021-08-23 17:59 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 [this message]
2021-08-23 18:32 ` Jeff King
2021-08-23 16:35 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqfsv0qby7.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=peff@peff.net \
--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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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).