Re: On blame/pickaxe
- From
Junio C Hamano <junkio@cox.net>
- Date
- Oct 21, 2006, 03:20 UTC
- Message-ID
- <7vods6icc9.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20061017004429.GC20017@pasky.or.cz>
Petr Baudis <pasky@suse.cz> writes:
Show 8 quoted lines
>> >> If the user is not prepared to see code movement, pickaxe can be >> >> run without -M nor -C to get the classic blame output. > > Ok, so in this case -M and -C does not mean just looking for > copies/movements in other files but inside the same file as well. > > Perhaps we might want to differentiate those two cases since searching > in all files might be significantly slower.
I do not personally worry about people confusing -M/-C to pickaxe with -M/-C given to diff (to pickaxe, use of diff is purely an internal implementation issue), and reused -M and -C to mean quite different things. -M is to detect line movement inside a file (it is not strictly limited to "line movement", though. It _is_ about "copies and moves within the same file"). On the other hand, -C (and its stronger form -C -C) is to detect copies and moves across file boundaries (but wholesale "file rename" comes as part of the basic algorithm so you do not have to ask for it with -M nor -C). So in that sense pronouncing M "move" and C "copy" is not accurate. Their differences is already what you said "we might want".
However they match the cost expectation people are used to in diff options pretty well. -M is not so expensive and -C is somewhat. -C -C is like find-copies-harder and is quite expensive.
Also currently the code does not do "move" detection at all. Contrary to intuition, move detection is more expensive than copy detection in this case.