Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to determine whose code (according to `git blame`) was affected by each hunk output by `git diff`?

Tags:

git

I have a large cross-cutting commit that I would like to split up according to the authors whose code was affected, both to increase the reviewers' familiarity with the code they're reviewing, and to divide the review burden equitably.

I realize that the blame may be mixed within a given hunk, in which case it would be nice to either collect multiple reviewers or just choose the most "blameworthy" one (breaking ties arbitrarily is fine).

like image 524
Ben Avatar asked Apr 13 '12 00:04

Ben


1 Answers

Interesting question. I couldn't find any solution simply using git-flags but some quick googling led me to this utility: git-diff-blame. (I did not write the tool)

It displays the actual hunks + the 'blame' line for each line in the hunk.

like image 82
phb Avatar answered Nov 15 '22 22:11

phb