From: Rafael Santiago <voidbrainvoid@tutanota.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: Rafael Santiago via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH] Give support for hooks based on platform
Date: Sun, 22 Aug 2021 01:11:27 +0200 (CEST) [thread overview]
Message-ID: <Mheyv1D--3-2@tutanota.com> (raw)
In-Reply-To: <YSF1GfpHXRrXebsB@camp.crustytoothpaste.net>
In my opinion "binary hooks" (hooks that execute specific binaries not present in the system as a default tool) should be versioned and built as a support tool into the repository or in the worst case downloaded from somewhere, even because versioning binaries into git repos is considered a bad practice that could make bloated repos.
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.
There is no problem on using cygwin on windows, you should use standard hook and do all the effort to make it unique for cygwin environments and true unix boxes (in other words: you would continue doing what you are doing, because it attends yours requirements). Notice that everything that have been working will stay working as before. Anyway, if cygwin becomes a point of incompatibility at some point, you could use the "_windows" version by coding your "cygwin script" there.
Maybe this would add more possibilities in git-hook tooling by making them less plastered, I think.
Rafael Santiago
--
21 de ago. de 2021 18:50 por sandals@crustytoothpaste.net:
> On 2021-08-21 at 20:00:07, Rafael Santiago via GitGitGadget wrote:
>
>> From: rafael-santiago <voidbrainvoid@tutanota.com>
>>
>> The idea behind this commit can be useful for teams
>> that share git-hooks into a custom directory and
>> dealing with projects that must be developed,
>> built, maintained on several different platforms.
>>
>> This commit allows the execution of git hooks
>> based on the current operating system.
>> A "native hook" is defined in the form:
>> hooks/hook-name_platform
>> Where platform must be equivalent to the
>> content returned in sysname field in utsname
>> struct when calling uname() [but all normalized
>> in lowercase].
>>
>> On Windows, independent of version, flavor, SP,
>> whatever it is simply "windows".
>>
>
> I'm not sure that this is going to work out very well. The MINGW
> environment used by Git for Windows and Cygwin are quite different. I
> would fully expect to write shell scripts and Unix tooling in Cygwin,
> whereas users using Git for Windows might not want that at all. That
> also doesn't take into effect using Git for Windows in WSL, which
> introduces some interesting logistical challenges.
>
> In addition, I have a few concerns about the grouping of Linux
> altogether. While in many cases it is possible to write tooling that
> works natively across Linux distros, most binaries will not. Therefore,
> binary hooks that might run fine on Debian would fail on a Fedora or Red
> Hat system, especially if those binaries link to any of a number of
> different shared libraries (e.g., OpenSSL).
>
> There's also work to move hooks into the config and out of the hooks
> directory, and I don't think this will mesh well with it.
>
>> The main motivation of this extension is to
>> reduce dependency of scripting languages,
>> logical trinkets etc just to execute minor
>> tasks during scm events that could be done
>> natively but differently from a platform
>> to another. Less dependencies, cleaner
>> repos: a small step for a better world
>> for any software developer.
>>
>
> Is there a reason that the proper hooks couldn't be copied or symlinked
> into place with a script? I think that would resolve this concern with
> a lot less work.
> --
> brian m. carlson (he/him or they/them)
> Toronto, Ontario, CA
>
next prev parent reply other threads:[~2021-08-21 23:19 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 [this message]
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
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=Mheyv1D--3-2@tutanota.com \
--to=voidbrainvoid@tutanota.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=sandals@crustytoothpaste.net \
/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).