# getting a list of changes I commited

2 messages from 2005-09-15 to 2005-09-15. Participants: Luck, Tony, Linus Torvalds.
Thread: https://gitlist.dev/t/1810

## Luck, Tony, 2005-09-15 18:14

Subject: getting a list of changes I commited
Message-ID: <B8E391BBE9FE384DAA4C5C003888BE6F046625FC@scsmsx401.amr.corp.intel.com>
URL: https://gitlist.dev/e/B8E391BBE9FE384DAA4C5C003888BE6F046625FC%40scsmsx401.amr.corp.intel.com

```
I've been asked whether I can provide e-mail notification
when I take patches into my tree.  I took a look at the
existing hooks, and I don't think that I want to do this
when I first make a commit ... sometimes I back these out
again if there is a problem when I test.

So I think that what I want is to produce a list of changes
that I commited when I push a new tree out to kernel.org.
But ... such a push usually contains lots of flow-through
changes that I pulled from Linus ... so a simple:

 $ git-rev-list --no-merges newhead ^oldhead

gives a long list of changes.  I'd like to filter out
all the ones that weren't commited by me.  Is there an
argument to git-rev-list that will just print the entries
where I'm listed as the commiter, or do I have to use
"--pretty-full" and write a little script to do the trim?

Or is there some other way to do this?

-Tony

```

## Linus Torvalds, 2005-09-15 18:38

Subject: Re: getting a list of changes I commited
Message-ID: <Pine.LNX.4.58.0509151128170.26803@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.58.0509151128170.26803%40g5.osdl.org
In-Reply-To: <B8E391BBE9FE384DAA4C5C003888BE6F046625FC@scsmsx401.amr.corp.intel.com>

```


On Thu, 15 Sep 2005, Luck, Tony wrote:
> 
> So I think that what I want is to produce a list of changes
> that I commited when I push a new tree out to kernel.org.
> But ... such a push usually contains lots of flow-through
> changes that I pulled from Linus ... so a simple:
> 
>  $ git-rev-list --no-merges newhead ^oldhead
> 
> gives a long list of changes.

Why not just _also_ limit it by what is already merged in my tree?

Ie just do

	git fetch linus
	git-rev-list --no-merges newhead ^oldhead ^linus

The problem with your approach:

>				 I'd like to filter out
> all the ones that weren't commited by me.  Is there an
> argument to git-rev-list that will just print the entries
> where I'm listed as the commiter, or do I have to use
> "--pretty-full" and write a little script to do the trim?

This is what "--header" (and it's zero termination) is designed for: you
can do

	git-rev-list --header --no-merges newhead ^oldhead |
		grep -z "committer .*tony\.luck"

and it will give a nice NUL-terminated output list of just your commits. 
No complex script necessary.

HOWEVER. The reason I suggest adding the ^linus instead is that I suspect
people really wants to see the development stuff, and that's what they'd
get if you just run the script often enough (and daily is certainly often
enough). Also, the "grep the committer" approach fundamentally doesn't
work if you ever plan on having sub-lieutenants that work with you and
that you use git to merge with.

But hey, that grep thing certainly works too. The output is trivial to 
parse.

(Oh, and I think "-z" is a GNU grep extension.)

			Linus

```
