git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "René Scharfe" <l.s.r@web.de>, "Git List" <git@vger.kernel.org>
Subject: Re: [PATCH RESEND] diff-files: fix copy detection
Date: Tue, 16 Dec 2025 00:02:13 +0100	[thread overview]
Message-ID: <aUCTdUMKslSo3XR9@szeder.dev> (raw)
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

> @@ -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


  reply	other threads:[~2025-12-15 23:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-14 15:57 [PATCH RESEND] diff-files: fix copy detection René Scharfe
2025-12-15 23:02 ` SZEDER Gábor [this message]
2025-12-16  1:21   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aUCTdUMKslSo3XR9@szeder.dev \
    --to=szeder.dev@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=l.s.r@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).