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

Re: [PATCH RESEND] diff-files: fix copy detection

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 16, 2025, 01:21 UTC
Message-ID
<xmqqecov5ihw.fsf@gitster.g>
In-Reply-To
<aUCTdUMKslSo3XR9@szeder.dev>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 22 quoted lines
> On Sun, Dec 14, 2025 at 04:57:06PM +0100, René Scharfe wrote:
>> Fix copy detection by queuing up-to-date and skip-worktree entries using
>> diff_same().
>
>> diff --git a/diff-lib.c b/diff-lib.c
>> index 8e624f38c6..5307390ff3 100644
>> --- a/diff-lib.c
>> +++ b/diff-lib.c
>
>> @@ -272,8 +276,10 @@ void run_diff_files(struct rev_info *revs, unsigned int option)
>>  		if (!changed && !dirty_submodule) {
>>  			ce_mark_uptodate(ce);
>>  			mark_fsmonitor_valid(istate, ce);
>> -			if (!revs->diffopt.flags.find_copies_harder)
>> -				continue;
>> +			if (revs->diffopt.flags.find_copies_harder)
>> +				diff_same(&revs->diffopt, newmode,
>> +					  &ce->oid, ce->name);
>
> Junio, this patch should be queued on top of 38f88051da
> (diff-index: don't queue unchanged filepairs with diff_change(),
> 2025-11-30), because diff_same() was introduced in that commit.
Very true.  Thanks.
Show 12 quoted lines
>
>   ~/src/git ((7077c385f9...) %)$ git log --oneline -1
>   7077c385f9 (HEAD) diff-files: fix copy detection
>   ~/src/git ((7077c385f9...) %)$ make diff-lib.o
>       CC diff-lib.o
>   diff-lib.c: In function ‘run_diff_files’:
>   diff-lib.c:231:33: error: implicit declaration of function ‘diff_same’; did you mean ‘diff_free’? [-Werror=implicit-function-declaration]
>     231 |                                 diff_same(&revs->diffopt, ce->ce_mode,
>         |                                 ^~~~~~~~~
>         |                                 diff_free
>   cc1: all warnings being treated as errors
>   make: *** [Makefile:2862: diff-lib.o] Error 1
Previous: SZEDER Gábor
Message 3 of 3 in “diff-files: fix copy detection”
  1. diff-files: fix copy detectionRené Scharfe, Dec 14, 2025
  2. SZEDER GáborDec 15, 2025
  3. Junio C HamanoDec 16, 2025

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.