Originally Posted By: tfabris
So my questions:
- Anyone know what Visual Studio is doing to get me the "nicer" version of the results?
- Anyone know what tricky command line stuff I can use in Git that'll get me the same results?

That has to be some custom stuff on Visual Studio's end. The conversion from UTF-16 to UTF-8 threw away half the bytes in the file, so from Git's perspective, Bob did change every line in the file.

My guess is that VS is getting the list of blamed commits, and walking back earlier through the blame history. You could do similarly. Get the blame data via git blame -p -- that will output a header line in the form <commit> <orig line #> <final line #> [# lines in this group]. The first time a commit is shown, a summary of the commit is given, including the previous commit. The actual line of code follows that, indented by a tab.

Then, for every commit in that list, do a second blame, and for each of the lines of code blamed on that commit, normalize the line of code for each commit (compress whitespace to a single space; convert to UTF-8) and see if they are equal. If they are, replace the first blame data with the second blame data -- and repeat your way down the history stack.

Careful you don't blow your 6-day budget, though. smile