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

Re: git diff --exit-code misbehaving in 2.46.x

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2024, 16:58 UTC
Message-ID
<xmqqbk0bpt5e.fsf@gitster.g>
In-Reply-To
<e3da5c9b-c208-4937-a2b4-e1028f3e6841@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 9 quoted lines
> Am 25.09.24 um 16:27 schrieb Jan Wendland:
>>
>> git diff --exit-code in 2.46.x is unexpectedly returning a zero exit
>> code for files marked as binary in .gitattributes where 2.45.x would
>> correctly produce a non-zero exit code.
>> ...
> Thanks for the report!  This is a known bug.  The "next" branch contains
> a fix, 9a41735af6 (diff: report modified binary files as changes in
> builtin_diff(), 2024-09-21).
I just noticed something curious.

9a41735a (diff: report modified binary files as changes in builtin_diff(), 2024-09-21) explains that since 1aaf69e6 (diff: shortcut for diff'ing two binary SHA-1 objects, 2014-08-16) added binary comparison, the code path always used a quick hash-only comparison. But the above report claims it is a behaviour change between 2.45 and 2.46.

It does seem to say things are different with 2.45 when binary changes were checked with --quiet/--exit-code from my manual testing, though.

Thanks.
Previous: René ScharfeNext: René Scharfe
Message 3 of 4 in “git diff --exit-code misbehaving in 2.46.x”
  1. Jan WendlandSep 25, 2024
  2. René ScharfeSep 25, 2024
  3. Junio C HamanoSep 25, 2024
  4. René ScharfeSep 25, 2024

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.