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

Re: Unexpected behavior when git-adding files in a pre-commit hook then using "git commit -o"

From
Junio C Hamano <gitster@pobox.com>
Date
May 4, 2015, 18:03 UTC
Message-ID
<xmqqvbg8rzij.fsf@gitster.dls.corp.google.com>
In-Reply-To
<463FC822-916F-4160-A1F2-B4AAEFF3A5B2@gmail.com>
Michaël Fortin <fortinmike@gmail.com> writes:
> I’ve encountered unexpected behavior performing a git add from a
> pre-commit hook, followed by performing a commit using the “-o”
> flag,...

As pre-commit is a verification (and rejection) mechanism, not a mechanism to tweak what is to be commited, it is totally expected that its behaviour is unspecified when you modify anything in it.

I think I saw a similar confusion posted to the list once in the past few years. Perhaps we would need a documentation patch to clarify this.

Thanks.
Previous: Michaël Fortin
Message 2 of 2 in “Unexpected behavior when git-adding files in a pre-commit hook then using "git commit -o"”
  1. Michaël FortinMay 4, 2015
  2. Junio C HamanoMay 4, 2015

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.