threads / discuss / 1810

getting a list of changes I commited

Subject: getting a list of changes I commited

## tl;dr

2 messages between Sep 15, 2005 and Sep 15, 2005.

replies: 1people: 2as markdown or json

Luck, Tony· Sep 15, 2005, 18:14 UTC · lore

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· Sep 15, 2005, 18:38 UTC · re: Luck, Tony · lore

Re: getting a list of changes I commited

On Thu, 15 Sep 2005, Luck, Tony wrote:
Show 9 quoted lines
> 
> 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:
Show 5 quoted lines
>				 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

← back to recent threads