From: Junio C Hamano <gitster@pobox.com>
To: Yann Dirson <ydirson@altern.org>
Cc: GIT list <git@vger.kernel.org>
Subject: Re: diffcore and directory renames
Date: Mon, 01 Sep 2008 15:50:22 -0700 [thread overview]
Message-ID: <7vfxojtr9t.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080901213904.GP4985@nan92-1-81-57-214-146.fbx.proxad.net> (Yann Dirson's message of "Mon, 1 Sep 2008 23:39:04 +0200")
Yann Dirson <ydirson@altern.org> writes:
> I often found myself lost when looking at a diff where a couple of
> large dirs where renamed, and a handful of files were modified to take
> the rename into account - not a rare situation, I'd say. In such a
> case, the diffs themselves are mostly hidden among numerous rename
> entries.
Yes, I've hinted here number of times that rename detection could notice
the fact that neighbouring paths are migrating to the same directory and
boost similarity scores of leftover paths that did not otherwise made the
threshold in such a situation.
I am glad to see finally somebody got interested ;-)
> $ ./git-diff-tree 0f1027 -M
> 0f1027e1aceb4bc5fa682776ab9f72935e2cd1b3
> :040000 040000 6f6159f0245784352414ff38ffb68bae80f30bd6 6f6159f0245784352414ff38ffb68bae80f30bd6 R100 ppc moved
Yes, diff-tree can show this, and you should be able to teach diff-index
with a clean cache-tree to do similar, but this only applies to the
non-recursive 100% rename at the toplevel, which is too narrow a special
case to be interesting at all. We perhaps further could run the
similarity comparison on the raw tree objects if we wanted to so that you
can find inexact matches, but I think it is going in the wrong direction.
The thing is, diffcore is designed to be a general mechanism to unify
comparisons on two arbitrary sets of files, be they from tree-vs-tree,
tree-vs-index, tree-vs-worktree, or index-vs-worktree. The machinery
should be able to operate on any two sets of files in the same way and
produce more-or-less the same results. It is Ok for callers to give extra
hints, when available, to speed up the computation, but the core of the
algorithm should not depend on the presense of such hints to deduce the
renames.
So please aim to make the hint-less case, "diff-files --no-index", produce
a sensible result. That should be the first step.
next prev parent reply other threads:[~2008-09-01 22:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-01 21:39 diffcore and directory renames Yann Dirson
2008-09-01 22:50 ` Junio C Hamano [this message]
2008-09-02 20:48 ` Yann Dirson
2008-09-25 21:47 ` [RFC PATCH] detection of " Yann Dirson
2008-09-25 21:47 ` [PATCH] Introduce patch factorization in diffcore Yann Dirson
2008-09-25 22:39 ` Andreas Ericsson
2008-09-26 19:21 ` Yann Dirson
2008-09-25 23:19 ` [RFC PATCH] detection of directory renames Jakub Narebski
2008-09-26 19:06 ` Yann Dirson
2008-10-27 13:35 ` Jakub Narebski
2008-10-27 19:13 ` Yann Dirson
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=7vfxojtr9t.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=ydirson@altern.org \
/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).