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

Re: [RFC/PATCH] commit: update the index after running the pre-commit hook

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 18, 2010, 20:30 UTC
Message-ID
<7vwrrn8xz5.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1282139649-21097-1-git-send-email-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
> Change git-commit to update the index after running the pre-commit
> hook, but before it constructs the comments that'll accompany the
> commit message displayed in the $EDITOR.
Hmm.

I have always thought that "pre-commit" is about verification, just like other pre-anything hooks. We have never sanctioned it to modify the tree, and the document does not say the hook is allowed to.

Although I am not opposed to this patch, it is a change to the defined semantics that is somewhat worrysome. We probably should document what it is and is not allowed to a bit better.

Previous: Ævar Arnfjörð BjarmasonNext: Jonathan Nieder
Message 3 of 4 in “COMMIT_EDITMSG not updated after pre-commit hook”
  1. Hinrik Örn SigurðssonMay 3, 2009
  2. commit: update the index after running the pre-commit hookÆvar Arnfjörð Bjarmason, Aug 18, 2010
  3. Junio C HamanoAug 18, 2010
  4. Jonathan NiederAug 18, 2010

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.