Re: On blame/pickaxe

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Sunday, October 15, 2006 - 11:43 pm

Petr Baudis <pasky@suse.cz> writes:


Well, this part is the classic blame algorithm.  The beauty of
it is that a merge case falls out as a natural consequence of
the one-parent case and you do not have to do anything special.
You either inherited a line from your parent (or one or more of
your parents) or you created the line yourself.  If you subtract
what you can blame your parents for, the remainder is what you
introduced.  The number of parents you have does not have any
effect on that logic.


That's exactly why we have -f and -n options, so that the
program that reads from blame output can tell where things came
from.  It is not about "who wrote it" vs "who put it here";
pickaxe gives a lot more than that: "where did this originally
come from", i.e. "by whom in which file at what line number was
the line created".

If the user is not prepared to see code movement, pickaxe can be
run without -M nor -C to get the classic blame output.

By the way, We would not want to do the code movement (or
copying from unrelated file) for very trivial lines.  E.g. you
would not want to blame the following three lines:

        +	}
        +}
        +#endif

to a random file that happens to have the exact copy of the
above that is not related at all.  Something like the above can
happen almost anywhere.  The current implementation of -M/-C
does not do this very well.  find_copy_in_blob() currently
passes blame to the parent when it finds nontrivial copies, but
instead it should inspect the patch and return a score, and the
caller should take the parent with the best match and assign
blame to it.



-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
On blame/pickaxe, Junio C Hamano, (Thu Oct 12, 6:43 pm)
Re: On blame/pickaxe, Junio C Hamano, (Fri Oct 13, 12:54 am)
Re: On blame/pickaxe, Junio C Hamano, (Sat Oct 14, 3:26 am)
Re: On blame/pickaxe, Junio C Hamano, (Sat Oct 14, 4:43 pm)
Re: On blame/pickaxe, Petr Baudis, (Sun Oct 15, 7:21 pm)
Re: On blame/pickaxe, Junio C Hamano, (Sun Oct 15, 11:43 pm)
Re: On blame/pickaxe, Josef Weidendorfer, (Mon Oct 16, 7:02 am)
Re: On blame/pickaxe, Andy Whitcroft, (Mon Oct 16, 7:15 am)
Re: On blame/pickaxe, Luben Tuikov, (Mon Oct 16, 4:45 pm)
Re: On blame/pickaxe, Petr Baudis, (Mon Oct 16, 5:44 pm)
Re: On blame/pickaxe, Junio C Hamano, (Tue Oct 17, 2:03 am)
Re: On blame/pickaxe, Junio C Hamano, (Fri Oct 20, 8:20 pm)