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

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

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Dec 15, 2025, 23:02 UTC
Message-ID
<aUCTdUMKslSo3XR9@szeder.dev>
In-Reply-To
<4b06a448-0935-4f2a-9061-238c7cc800c3@web.de>
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
Show 9 quoted lines
> @@ -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.

  ~/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: René ScharfeNext: Junio C Hamano
Message 2 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.