git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Petr BaudisNext: Luben Tuikov
Message 10 of 12 in “On blame/pickaxe”
  1. Junio C HamanoOct 13, 2006
  2. Junio C HamanoOct 13, 2006
  3. Junio C HamanoOct 14, 2006
  4. Junio C HamanoOct 14, 2006
  5. Petr BaudisOct 16, 2006
  6. Junio C HamanoOct 16, 2006
  7. Josef WeidendorferOct 16, 2006
  8. Andy WhitcroftOct 16, 2006
  9. Petr BaudisOct 17, 2006
  10. Junio C HamanoOct 21, 2006
  11. Luben TuikovOct 16, 2006
  12. Junio C HamanoOct 17, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.