Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List commits made by others (i.e. not me)?

Is there a standard way to list all the commits made by others (i.e. not myself) in a git repository?

I tried git log --not --author=username, but it would appear that --not only applies to revisions. The manpage for git log doesn't appear to offer a way to invert predicates like --author.

(I use git-svn at work, and want a way to see what my colleagues have changed since I last ran git svn rebase, or more generally in the last X days. Generally I know what I changed, I just want to see which files have been touched by others / read their commit log messages / maybe review interesting patches / etc.)

Edit: Refined scope, I'm actually more interested in "recently" than "since last git svn rebase".

like image 687
RobM Avatar asked Aug 10 '10 10:08

RobM


2 Answers

This isn't a real solution, but for what it's worth, you could kludge something using the fact that --author uses a regex match. If your name were, say, Jefromi:

git log --author='^[^J]\|J[^e]\|Je[^f]' # and so on

It's pretty crappy, but it might be good enough for your purposes. (And it's shorter if no one else's name starts with the same letters as yours.)

As for recently, besides using branches to narrow your range (start..end, ^stop1 ^stop2 branch, etc.), you can just use the --since=<date> option.

like image 83
Cascabel Avatar answered Nov 02 '22 10:11

Cascabel


git log --perl-regexp --author='^(?!RobM)'

Explanation: anchor the regexp to the beginning of the string with ^; then use look-ahead (?!whatever) to forbid your name coming up after that position. This way, you can even exclude commits by several authors:

git log --perl-regexp --author='^(?!jack|jill)'
like image 20
Ansa211 Avatar answered Nov 02 '22 10:11

Ansa211