rotanov
rotanov

Reputation: 87

How to display a list of git commits which are actually contributing into diff between two branches?

Let's say there are two branches a and b in a git repository.

At the tip of branch a there's foo.txt:

111
aaa
bbb
ccc

while at the tip of branch b same foo.txt is like this:

aaa
bbb
ccc
222

Consider lines aaa, bbb and ccc where introduced in three different commits, one per line for branch b. And same lines where introduced in a single commit for branch a. So the only difference which is displayed by git diff a b is in line 111 and 222.

Is there any simple way to display only commits responsible for actual diff between branches, while omitting commits respondible for aaa, bbb, ccc?

Upvotes: 0

Views: 43

Answers (1)

eftshift0
eftshift0

Reputation: 30212

You would need to use something like a tool I wrote for this kind of request called difflame that joins information from diff and blame.

https://github.com/eantoranz/difflame

Let me know if it works for you.

Upvotes: 1

Related Questions