git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Proposal] Clonable scripts

From
Niels Basjes <niels@basjes.nl>
Date
Sep 10, 2013, 08:35 UTC
Message-ID
<CADoiZqpT1BLpcQmTDT=mmJ=5gmQ8b-uZC_qmw8BK2db57YLOmg@mail.gmail.com>
In-Reply-To
<CALkWK0nk1KfL7YuTKuKJecPSxmu7gXmo67i2Ezb2QY5qmdN+rA@mail.gmail.com>
Hi,

On Tue, Sep 10, 2013 at 12:18 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:

Show 9 quoted lines
> Niels Basjes wrote:
>> As we all know the hooks ( in .git/hooks ) are not cloned along with
>> the code of a project.
>> Now this is a correct approach for the scripts that do stuff like
>> emailing the people responsible for releases or submitting the commit
>> to a CI system.
>
> More often than not, maintainers come with these hooks and they keep
> them private.
Yes.
Show 7 quoted lines
>> Initially I wanted to propose introducing fully clonable (pre-commit)
>> hook scripts.
>> However I can imagine that a malicious opensource coder can create a
>> github repo and try to hack the computer of a contributer via those
>> scripts. So having such scripts is a 'bad idea'.
>
> I think it's a good idea, since the contributer can look through the scripts.

What I meant to say is that having "fully functional unrestricted scripts" that are cloned is a "bad idea". Having "restricted cloned scripts" to me is a "goog idea" (or atleast, that is what I propose here).

Show 6 quoted lines
>> 3) For the regular hooks this language is also support and when
>> located in the (not cloned!) .git/hooks directory they are just as
>> powerful as a normal script (i.e. can control CI, send emails, etc.).
>
> I'm confused now; how can .git/hooks be as powerful as .githooks? The
> former users should consider uploading their code on GitHub.

The way I envisioned is is that the scripting language in .git/hooks is "pick any language you like" with the builtin language as a new addition. In the .githooks (which is under version control in the code base and cloned) is a the same builtin language, yet constrained in a sandbox.

> Which reminds me that we need to have GitTogethers. Thanks for this!
You're welcome.
-- 
Best regards / Met vriendelijke groeten,

Niels Basjes
Previous: Ramkumar RamachandraNext: Sitaram Chamarty
Message 5 of 7 in “[Proposal] Clonable scripts”
  1. Niels BasjesSep 9, 2013
  2. Hilco WijbengaSep 9, 2013
  3. Niels BasjesSep 9, 2013
  4. Ramkumar RamachandraSep 9, 2013
  5. Niels BasjesSep 10, 2013
  6. Sitaram ChamartySep 10, 2013
  7. Andreas KreySep 10, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.