Skip to content

Commit 44e119a

Browse files
committed
Add a readme
1 parent 30ed252 commit 44e119a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## git diff-blame
2+
3+
Annotates each line in a diff hunk with author and commit information like blame.
4+
5+
## Example:
6+
7+
$ git diff-blame HEAD^
8+
diff --git c/git-diff-blame w/git-diff-blame
9+
--- c/git-diff-blame
10+
+++ w/git-diff-blame
11+
ed3dc1d5 (Desmond Brand 2014-01-09 12:08:57 -0800 52) my $n_end = $n_ofs + $n_cnt - 1;
12+
^275a5e3 (Desmond Brand 2014-01-09 12:04:26 -0800 53) if (!$create) {
13+
^275a5e3 (Desmond Brand 2014-01-09 12:04:26 -0800 54) open($pre, '-|', 'git', 'blame', '-M', "-L$o_ofs,$o_end",
14+
ed3dc1d5 (Desmond Brand 2014-01-09 12:08:57 -0800 55) - "-l",
15+
^275a5e3 (Desmond Brand 2014-01-09 12:04:26 -0800 56) $oldrev, '--', $prefilename) or die;
16+
^275a5e3 (Desmond Brand 2014-01-09 12:04:26 -0800 57) }
17+
^275a5e3 (Desmond Brand 2014-01-09 12:04:26 -0800 58) if (!$delete) {
18+
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 59) if ($newrev) {
19+
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 60) open($post, '-|', 'git', 'blame', '-M', "-L$n_ofs,$n_end",
20+
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 61) - "-l",
21+
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 62) $newrev, '--', $postfilename) or die;
22+
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 63) } else {
23+
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 64) open($post, '-|', 'git', 'blame', '-M', "-L$n_ofs,$n_end",
24+
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 65) - "-l",
25+
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 66) '--', $postfilename) or die;
26+
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 67) }
27+
^275a5e3 (Desmond Brand 2014-01-09 12:04:26 -0800 68) }
28+
29+
Original version by @toddlipcon taken [from here](https://github.com/toddlipcon/tlipcon-bin/blob/master/git-diff-blame).

0 commit comments

Comments
 (0)