I want to be able to see changes in a branch, since I last reviewed it, but ignoring the changes in master that happened in the meantime.
F - G H - I
/ /
A - B - C - D - E
I have two commit ranges c3af8fc5..7ccc4b49
(represented by B - G
) and 4dfdabdd..301a443c
(represented by E - I
).
Imagine, you're doing code review for your colleague, you checkout his branch on local and your HEAD
is now pointing to G
. You do the code review and move on to something else.
Some time passes, new commits appeared in master (C
, D
and E
) and your colleague have resolved the comments from your review. He squashed the changes to commits F
and G
, because he renamed method introduced in F
and fixed its usage in G
. He also rebased the branch on master, to make sure everything works.
Now you want to make code review again, but you're lazy to do a code review of the whole branch again, so you wanna only see what changed from the last time. You still have the old refs fetched locally. What do you do?
You could do something like git-diff G I
, but that would also show you what changed in master which doesn't help you at all.
You could also rebase the old refs on the current master and then diff them. That might help, but there also might be a lot of conflicts, which could make just reviewing the whole branch again easier.
I've tried diffing patches
diff <(git-diff c3af8fc5...7ccc4b49) <(git-diff 4dfdabdd...301a443c)
it helps me to direct my attention somewhere, but it is very crude.
Do you know any nicer, more native way to solve this problem? Thanks.
Edit: I've just discovered interdiff, which makes diffing two diffs much nicer
interdiff <(git-diff -U100 c3af8fc5...7ccc4b49) <(git-diff -U100 4dfdabdd...301a443c) | colordiff
but still, it lacks the context that git might provide - so... is there anything better?