On Thu, 14 Nov 2013 02:37:20 -0800 (PST)
Gabby Romano <omerik...@gmail.com> wrote:

[...]
> regarding a change+rename you mentioned - if you declare you are
> looking for 100% in the similarity index + the rename flag from git -
> so we are covered, as you said.

Really?  Not so fast, please. ;-)

Looking for R100 markers or passing -M100 to `git diff`/`git log`
means you're looking for files which were just renamed, with their
contents unchanged.  But what if I change a single letter in a file
*and* rename it in the same commit?  Its similarity index will be close
to 100%, but still lower, and so this rename will pass undetected.

I meant to underline (but seems like I failed at it) that what
constitutes a rename is a rather philosophical question in Git as
merely *using* `git mv` does not *record* a rename using some imaginary
metadata (as could be the case in other VCSes).

Look at it this way: while comparing two commits Git sees two identical
blobs with their filesystem names changed -- okay, that's surely a
rename.  Now it sees two blobs with similarity index of, say, 50% and
different names -- is this a rename?  That could be just a file split
into two (or three or more) other files or parts of the code contained
in the original file moved to other existing files.  Since no explicit
renames are recorded, Git does not know by itself what it really is.

I would recommend to thoroughly read this post [1] to really
understand the Git's approach to this and its implications.

So *to me,* using -M100 may pass certain renames undetected.
I would possibly use something like 80%...  I don't know.  You decide.

1. http://thread.gmane.org/gmane.comp.version-control.git/27/focus=217

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to