> From: Paul Smith <p...@mad-scientist.net>
> I'm not sure exactly how "git blame" works: the naive implementation
> would walk back commits until it found one where each line was changed
> (using a string compare).  If that were the algorithm, the above would
> work as I want.  Obviously "git blame" is doing something more
> sophisticated.  Somehow it knows that commit A changed line 10, even
> though line 10 is identical between commit A and its parent commit
> (according to "git diff").

I don't know how "git blame" works, but we can guess what algorithm
might be used.  Since git only records the *states* of files, it has
to examine and compare versions of the file in ancestor commits to
determine which commit "introduced" the line in question.

The manual page says:

       Annotates each line in the given file with information from the
       revision which last modified the line.

which is woefully incomplete.  But it suggests that if the same change
was made in multiple ancestor commits, git-blame might be picking out
the commit with the latest modification time.


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