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

Re: [PATCH v2] hooks: propose project configured hooks

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 7, 2021, 22:23 UTC
Message-ID
<877dldka3k.fsf@evledraar.gmail.com>
In-Reply-To
<xmqqh7khzwv1.fsf@gitster.g>
On Wed, Apr 07 2021, Junio C Hamano wrote:
Show 26 quoted lines
> Albert Cui <albertqcui@gmail.com> writes:
>
>>> Here are the hard lines I draw:
>>>
>>> 1. This should not happen in "git clone" (other than maybe a message
>>>    over stderr that hooks are available to be configured through a
>>>    different command).
>>>
>>> 2. Hooks should not update in "git checkout" (other than a message
>>>    that hooks have updated).
>>>
>>
>> To Ævar's point, maybe it would help to separate the two user bases of
>> project configured hooks.
>> (1) Employee working at BigCorp. They are cloning from a trusted
>> remote on company machines where the company controls what gets
>> installed and how Git is configured. Their motivation is to make
>> changes to their local clone and submit changes to a central
>> repository.
>
> Hmph.
>
> If the assumption is that their configuration is controlled by
> BigCorp when they arrive at their desk, why do you even need any
> change to upstream Git, especially with Emily's "configuration file
> tells Git what hook scripts to run" in sight?

FWIW I've been assuming that this is wanted for BigCorp people who have devs using vanilla OS's / XCode etc. Having managed laptops with a managed /etc/gitconfig certainly makes some things easier...

> Wouldn't it be just a matter of the BigCorp installing
> /etc/gitconfig on their BigCorpLinux installations?

Whether you're at BigCorp or not you've got the problem with such a /etc/gitconfig that it applies to all repos, but someone at BigCorp might clone both a BigCorp repo (wants custom config, hooks etc.), and also some random node.js github.com project (should have no such custom config).

Having a .gitconfig or otherwise making the repo suggest/control the config/hooks is an elegant way around that issue.

You otherwise need to do something like have config includes apply a rule to ~/work/, and then hope your users follow your suggestion to clone repos in the ~/work/ folder.

I think extending config includes to e.g. operate on a glob of the remote URI was suggested at some point, which would make use-cases like that easier than they are now, and would be a less invasive change than what's being discussed here.

But right now we don't have that, so we have a gap there...
Previous: Junio C HamanoNext: Ed Maste
Message 24 of 39 in “hooks: propose repository owner configured hooks”
  1. hooks: propose repository owner configured hooksAlbert Cui via GitGitGadget, Mar 18, 2021
  2. Junio C HamanoMar 18, 2021
  3. Albert CuiMar 18, 2021
  4. brian m. carlsonMar 19, 2021
  5. Ævar Arnfjörð BjarmasonMar 19, 2021
  6. Albert CuiApr 6, 2021
  7. Ævar Arnfjörð BjarmasonApr 7, 2021
  8. Jonathan TanJun 21, 2021
  9. Ævar Arnfjörð BjarmasonJun 21, 2021
  10. hooks: propose project configured hooksAlbert Cui via GitGitGadget, Mar 26, 2021
  11. Emily ShafferMar 29, 2021
  12. Albert CuiApr 1, 2021
  13. Derrick StoleeMar 30, 2021
  14. Albert CuiApr 5, 2021
  15. Junio C HamanoApr 5, 2021
  16. Albert CuiApr 5, 2021
  17. Junio C HamanoApr 6, 2021
  18. Albert CuiApr 6, 2021
  19. brian m. carlsonApr 6, 2021
  20. Ævar Arnfjörð BjarmasonApr 7, 2021
  21. Derrick StoleeApr 7, 2021
  22. Albert CuiApr 7, 2021
  23. Junio C HamanoApr 7, 2021
  24. Ævar Arnfjörð BjarmasonApr 7, 2021
  25. Ed MasteApr 15, 2021
  26. Junio C HamanoApr 15, 2021
  27. Ed MasteApr 15, 2021
  28. Junio C HamanoApr 15, 2021
  29. brian m. carlsonApr 15, 2021
  30. Ævar Arnfjörð BjarmasonApr 2, 2021
  31. Albert CuiApr 5, 2021
  32. Ævar Arnfjörð BjarmasonApr 2, 2021
  33. Albert CuiApr 3, 2021
  34. hooks: propose project configured hooksAlbert Cui via GitGitGadget, Apr 24, 2021
  35. Junio C HamanoApr 28, 2021
  36. hooks: propose project configured hooksAlbert Cui via GitGitGadget, May 5, 2021
  37. Jonathan TanJun 3, 2021
  38. Albert CuiJun 3, 2021
  39. Jonathan TanJun 3, 2021

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.