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

Git Hooks

From
SDSatyakiran Duggina <satya0521@gmail.com>
Date
Dec 15, 2017, 19:12 UTC
Message-ID
<CAMZug24WGWS3TaNPOVWPufGZ+67EbLggr4W3pxJtis9X375mag@mail.gmail.com>

I see that `git init` creates a .git directory and hooks are to be placed in that directory and these hooks are not tracked by version control. To achieve tracked hooks, either each developer has to copy the hooks or use tools like overcommit, pre-commit, husky etc.

I'm wondering why hooks are not made external like .gitignore. I guess it would be better to have two git configuration directories in a repo, one hosting all the metadata managed by git and the other with user configured data (hooks, ignore/exclude, repo config etc).

Kindly let me know why the current design choice is made and if the proposed change would introduce unseen issues.

Thanks, Satya

Next: Bryan Turner
Message 1 of 5 in “Git Hooks”
  1. Satyakiran DugginaDec 15, 2017
  2. Bryan TurnerDec 15, 2017
  3. Satyakiran DugginaDec 15, 2017
  4. Jeff KingDec 16, 2017
  5. Allowing remote git repos to set config & hook configurationÆvar Arnfjörð Bjarmason, Dec 19, 2017

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.