Word-by-word blame/annotate in version control?
Is it possible to reconstruct a word-by-word history in version control? Ideally, I’d like to do is something like 1) I indicate the range of lines of interest, 2) have the program figure out the corresponding line numbers in previous versions, as code often moved up or down between versions (potentially limiting the range of versions, say since revision 19, or since a week ago), 3) print out a word-by-word history, either the versions that groups of words were last changed, or the authors by which groups of words were changed. So it’s kind of like
svn blame or
git blame in a word-by-word level.
Failing that, are there tools that can do #1 and #2 above? That is, 1) I indicate the range of lines of interest, 2) have the program figure out the corresponding line numbers in previous versions, 3) the program would print out the history of these lines (when there were changes).
Either svn or git would be really helpful for me.
One Solution collect form web for “Word-by-word blame/annotate in version control?”
I looked for something like this and ended up hacking up my own solution. You can find it here:
Basically, it creates a new repository directory in which all spaces are replaced by a newline and unique string signalling that there was a space. Then, “git blame” is executed and the result is reinterpreted.