Re: [PATCH] Give support for hooks based on platform

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> 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.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux