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

Re: Commit f5bbc322 to git broke pre-commit hooks which read stdin

From
Joey Hess <joey@kitenet.net>
Date
Mar 4, 2008, 18:16 UTC
Message-ID
<20080304181625.GA30366@kodama.kitenet.net>
In-Reply-To
<alpine.LSU.1.00.0803041203320.22527@racer.site>
Johannes Schindelin wrote:
> Can you be even more explicit?  IOW why does this have to be a pre-commit 
> hook, and cannot be done before calling git-commit itself?

metastore adds a .metadata file that contains information (permissions, owners, etc) not normally tracked with git. The pre-commit hook updates the metadata just before committing, to ensure that the metadata included in the commit is consistent with the rest of the commit. You could do it by hand, but that would be an extra step that would have to be rememebered every time.

There's no particular reason for the pre-commit hook to interactively prompt before updating the metadata. I suspect it prompts only because it's an example.

-- 
see shy jo
Previous: Johannes SchindelinNext: David Bremner
Message 8 of 14 in “Bug#469250: Commit f5bbc322 to git broke pre-commit hooks which read stdin”
  1. David BremnerMar 4, 2008
  2. Johannes SchindelinMar 4, 2008
  3. Junio C HamanoMar 4, 2008
  4. Johannes SixtMar 4, 2008
  5. Junio C HamanoMar 4, 2008
  6. David BremnerMar 4, 2008
  7. Johannes SchindelinMar 4, 2008
  8. Joey HessMar 4, 2008
  9. David BremnerMar 4, 2008
  10. Shawn O. PearceMar 5, 2008
  11. Junio C HamanoMar 5, 2008
  12. Shawn O. PearceMar 5, 2008
  13. Jakub NarebskiMar 4, 2008
  14. Johannes SchindelinMar 4, 2008

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.