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

Re: Verbose commit message diff not showing changes from pre-commit hook

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 25, 2020, 15:00 UTC
Message-ID
<xmqqr1sziqrm.fsf@gitster.c.googlers.com>
In-Reply-To
<CADv3qkGq3jA8iXsjhrqfsUX=gW+KOuLyeVgDzmku1tUpsMdvtw@mail.gmail.com>
Maxime Louet <maxime@saumon.io> writes:
> Is this expected behaviour? I find it somehow confusing that the diff
> in the commit message isn't the actual commit diff.

Since the designed purpose of pre-commit hook is to examine the contents to be committed and reject the attempt to commit if there is something wrong found, and Git does not expect it to munge the contents to be committed, if the hook does so, you would get an undefined behaviour. So anything is totally expected at that point.

Thanks.
Previous: Maxime LouetNext: Junio C Hamano
Message 2 of 6 in “Verbose commit message diff not showing changes from pre-commit hook”
  1. Maxime LouetJul 25, 2020
  2. Junio C HamanoJul 25, 2020
  3. Junio C HamanoJul 25, 2020
  4. René ScharfeJul 26, 2020
  5. Maxime LouetJul 26, 2020
  6. Paolo BonziniJul 27, 2020

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.