On 12/21/2010 10:50 AM, Justin Clift wrote:
On 22/12/2010, at 4:40 AM, Eric Blake wrote:
<snip>
> 'git diff' is so awesome with renames :)
Hmmm.... recently had a problem with it where it *insisted* that one of the 100+ files
in a git repo I'd been messing with was a rename of a different file... even when it
wasn't.
(significantly different file contents)
Didn't find an option to force it to recognise the file *wasn't* a rename, so
from memory
just had to leave it with it's incorrect rename entry in history. :(
Surprisingly, git doesn't track renames (seriously, there's no metadata
in the .git directory that tells you when a file was moved). It merely
uses heuristics and a similarity index to guess when a rename exists.
There are ways to tighten the similarity index (git diff -M90% instead
of git diff -M), as well as disable similarity checking altogether (git
diff -l1, and various settings in git config).
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org