views:

55

answers:

2

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".

A: 

How about piping the output through grep or something like that?

tdammers
The length of a log entry is variable, which makes a single-pass `grep` solution a bit awkward.
RobM
@RobM: Use a one-line log format: `git log --pretty=format:'%h - %cn -%d %s' --abbrev-commit`
bstpierre
@bstpierre: But what if you don't want just a one-line format? Like RobM said, it's awkward.
Jefromi
@Jefromi - It certainly is awkward, but RobM did just ask to "list all the commits" so I thought maybe it would be sufficient.
bstpierre
A: 

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.

Jefromi
Not a bad idea! Do you know what flavor of regex `git log` uses?
RobM
@RobM: Git treats regex basically like grep - with all the commands that use it, it's basic regex by default, then there are `-i` (ignore case), `-E` (extended regex), and `-F` (fixed strings) options.
Jefromi