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

Re: Issue when changing staged files in a pre-commit hook

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 19, 2016, 18:44 UTC
Message-ID
<xmqq1t9dbe9y.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CACsJy8DhiYiie7+Cw3PkPJpSX7CGp-r2Mu98mLp4OMhhGdsXgQ@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
> I think it's the intended behavior.

Yeah, pre-commit was designed for inspecting and rejecting, not for tweaking and munging. Perhaps "git commit" can be tightened to make sure that pre-commit that returns successfully did not muck with the working tree and the index?

Previous: Duy NguyenNext: Duy Nguyen
Message 4 of 9 in “Issue when changing staged files in a pre-commit hook”
  1. Niek van der KooyDec 28, 2015
  2. Niek van der KooyJan 19, 2016
  3. Duy NguyenJan 19, 2016
  4. Junio C HamanoJan 19, 2016
  5. Duy NguyenJan 19, 2016
  6. Junio C HamanoJan 19, 2016
  7. Duy NguyenJan 20, 2016
  8. Junio C HamanoJan 20, 2016
  9. Duy NguyenJan 22, 2016

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.