git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Alexander Pepper <pepper@inf.fu-berlin.de>
Cc: git@vger.kernel.org
Subject: Re: Bug?: 'git log --find-copies' doesn't match 'git log --follow <rev> -- path/to/file'
Date: Sun, 2 Oct 2011 11:25:17 -0400	[thread overview]
Message-ID: <20111002152517.GA10353@sigill.intra.peff.net> (raw)
In-Reply-To: <67B22035-4B90-4A68-8960-DDB58F640CD9@inf.fu-berlin.de>

On Sun, Oct 02, 2011 at 05:10:26PM +0200, Alexander Pepper wrote:

> Using 'git log --numstat --find-copies-harder dd4e90f9' yields "immutable.java" as you expected:
> 
> $ git log --numstat --find-copies-harder dd4e90f9
> [...]
> 6       10      src/java/voldemort/annotations/concurrency/Immutable.java => contrib/ec2-testing/src/java/voldemort/utils/ClusterOperation.java

OK. That at least explains what's going on.

> So is there a way to tell --follow to only use --find-copies instead
> of --find-copies harder?

No, it's hard-coded.

> And what is the advantage of using "--find-copies-harder" over "--find-copies"?

It finds more copies. The rename detection works like this:

  --find-renames: for each newly-created file, consider any deleted
                  files as possible sources

  --find-copies: like above, but also consider any modified files as
                 possible sources

  --find-copies-harder: like above, but consider any file in the
                        repository as a possible source

So in theory --find-copies-harder is the most accurate, but it is also
the most expensive. We can afford to do it for --follow since we're only
considering a small subset of the possible destinations.

So git is saying that your immutable.java is actually a better match;
it's just that we don't usually find it because it wasn't modified in
the same commit. Have you looked at the contents? Is it actually a
better match, or is git wrong?

-Peff

      reply	other threads:[~2011-10-02 15:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-30 15:32 Bug?: 'git log --find-copies' doesn't match 'git log --follow <rev> -- path/to/file' Alexander Pepper
2011-09-30 21:38 ` Jeff King
2011-10-02 15:10   ` Alexander Pepper
2011-10-02 15:25     ` Jeff King [this message]

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=20111002152517.GA10353@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=pepper@inf.fu-berlin.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).