Michał
Michał

Reputation: 711

How to get authors of changes between 2 commits?

I am trying to get authors of changes between 2 commits.

What would be the best for me is something like:

git diff --name-only master

but instead of

--name-only 

parameter like

--authors-only

But unfortunately diff does not have such one. There is no restriction I have to use diff command, git log or others are also fine.

I need to it to blame people who caused tests to fail.

Upvotes: 11

Views: 1648

Answers (3)

DAle
DAle

Reputation: 9127

git log --pretty=format:"%an" prevTestCommit..lastTestCommit | sort | uniq

Upvotes: 9

Srgrn
Srgrn

Reputation: 1825

you can use something like

git log --pretty=format:"%an %aE" f398e997ea9ad81e586b1f751693cd336963ba6a ^bb69eb11d979437a0b390ac9333342e7594c211c

where the format will print the author name and email and than the commits see List commits between 2 commit hashes in git

for more information on how to use get the commits between two given commits.

Upvotes: 4

Alderath
Alderath

Reputation: 3874

Not sure if this exists per default, but you could specify a custom output format for git log:

git log --pretty="format:%an"

This would print only author names. For more details, see the section PRETTY FORMATS in git log --help

Upvotes: 0

Related Questions