Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Word-by-word blame/annotate in version control?

Tags:

git

svn

blame

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.

like image 897
ceiling cat Avatar asked Jul 20 '13 02:07

ceiling cat


People also ask

What is annotate with git blame?

The high-level function of git blame is the display of author metadata attached to specific committed lines in a file. This is used to examine specific points of a file's history and get context as to who the last author was that modified the line.

How do you control versions in Word?

From Microsoft Office (Word, Excel, PowerPoint)From the open file, click on the File tab: You will see the current version at the top and previous versions thereafter. Click on a previous version and a new Word window will open with the previous document version.

What does * mean in git blame?

Annotations for lines modified in the current revision, are marked with bold type and an asterisk. But I think it is important to clarify that this refers to lines modified in the current revision of the file, not the current revision of the repository.


1 Answers

I looked for something like this and ended up hacking up my own solution. You can find it here:

https://github.com/d33tah/wordblame

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.

like image 187
d33tah Avatar answered Oct 06 '22 21:10

d33tah