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

Re: bug with partial commit and pre-commit hook updating the index

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 10, 2014, 21:18 UTC
Message-ID
<xmqqy4sn4o9m.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20141010171834.GB21355@kitenet.net>
Joey Hess <joey@kitenet.net> writes:
Show 7 quoted lines
> I have found many uses for the feature that lets a pre-commit hook stage
> changes in the index that will be included in the commit. But now I seem
> to have found a bug in the support for that, involving partial commits.
>
> It seems that, after a partial commit in which the pre-commit hook
> stages a modification of a file, the index is is left without that
> staged change. This only occurs with "git commit $file", not "git commit -a".

Aren't pre-* hooks about verifications? Who told you that you are allowed to muck with the index there?

Previous: Joey Hess
Message 2 of 2 in “bug with partial commit and pre-commit hook updating the index”
  1. Joey HessOct 10, 2014
  2. Junio C HamanoOct 10, 2014

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.