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

Re: [PATCH] diff: report modified binary files as changes in builtin_diff()

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2024, 21:52 UTC
Message-ID
<xmqq7cazo0z8.fsf@gitster.g>
In-Reply-To
<3192d8f4-4c7f-4b32-b564-7e075132c41c@virtuell-zuhause.de>
Thomas Braun <thomas.braun@virtuell-zuhause.de> writes:
Show 33 quoted lines
> Am 21.09.2024 um 17:09 schrieb René Scharfe:
>
> Hi René,
>
>> diff --git a/diff.c b/diff.c
>> index 3be927b073..84a6bb0868 100644
>> --- a/diff.c
>> +++ b/diff.c
>> @@ -3675,6 +3675,7 @@ static void builtin_diff(const char *name_a,
>>   			emit_diff_symbol(o, DIFF_SYMBOL_BINARY_FILES,
>>   					 sb.buf, sb.len, 0);
>>   			strbuf_release(&sb);
>> +			o->found_changes = 1;
>>   			goto free_ab_and_return;
>>   		}
>>   		if (fill_mmfile(o->repo, &mf1, one) < 0 ||
>
> I poked at the same issue in parallel and had the same fix, but ...
>
>> ...
>>   	test_expect_success "git diff $option returns 1 for copied file" "
>>   		git reset --hard &&
>>   		cp a copy &&
>
> your test is nicer.
>
> The patch works here locally.
>
> For what it's worth:
>
> Reviewed-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
>
> Thomas
Thanks.
Previous: Thomas Braun
Message 4 of 4 in “git diff --exit-code returns 0 when binary files differ”
  1. Kohei ShibataSep 21, 2024
  2. diff: report modified binary files as changes in builtin_diff()René Scharfe, Sep 21, 2024
  3. Thomas BraunSep 25, 2024
  4. Junio C HamanoSep 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.