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
MLMaxime Louet <maxime@saumon.io>
Date
Jul 26, 2020, 19:45 UTC
Message-ID
<CADv3qkHK_JO6v_jM1A3kXGnKZweJme53Eq3mSjkX0P3UEO7WqA@mail.gmail.com>
In-Reply-To
<a8c19b13-3f8c-6602-24dd-ef58af70d702@web.de>
Junio C Hamano <gitster@pobox.com> writes:
> So, in short, it is not "undefined", but rather it seems to be a
> designed behaviour that we are seeing.
Thank you for your response and the technical explanation.
René Scharfe <l.s.r@web.de> writes:
Show 6 quoted lines
> Committers review and sign off changes.  Hiding machine-made extra
> changes from them, that they then implicitly also accept responsibility
> for sounds questionable to me.  The prepare-commit-msg hook might be
> a place for such filtering.  But git commit showing the full extent of
> changes (incl. those made by the pre-commit hook) would be a better
> default, wouldn't it?

I second this. For me, the commit diff should include the "real"/full commit diff. Even if the user didn't actually make some changes, the commit they're about to make will include them, so it's completely relevant to show these changes. That's the behaviour I was expecting, and I was confused that Git didn't behave that way. To me, Git shouldn't really care where changes come from; they are part of the commit so must logically be shown in the commit diff while committing.

Thank you,

-- Maxime Louet

Previous: René ScharfeNext: Paolo Bonzini
Message 5 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.