# RE: 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/1811

## Luck, Tony, 2005-09-15 19:21

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

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

I can add the "^linus", but I think that with my workflow it
will never make a difference.  Any commits that got into your
tree with a committer line by me will already be in my "oldhead"
(how else did you get them?).  So "^oldhead ^linus" should always
be identical to "^oldhead".

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

Great ... I suspected that everything I needed was already there
(after all, all GIT problems are solvable with the right arguments to
git-rev-list!)

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

But "git-shortlog" doesn't like the output from this, so I need
a script (or another tip on arguments to git commands).

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

Oh happy day when I have sub-lieutenants :-)

-Tony

```

## Linus Torvalds, 2005-09-15 19:54

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

```


On Thu, 15 Sep 2005, Luck, Tony wrote:
> 
> I can add the "^linus", but I think that with my workflow it
> will never make a difference.  Any commits that got into your
> tree with a committer line by me will already be in my "oldhead"
> (how else did you get them?).  So "^oldhead ^linus" should always
> be identical to "^oldhead".

No. "oldhead" has to be the point where you did the last email thing.

So any time you merge from me, next time your email cron-job (or whatever)  
hits, ^linus _will_ make a difference. Without it, you'd email out all the 
stuff that came through my tree.

> Great ... I suspected that everything I needed was already there
> (after all, all GIT problems are solvable with the right arguments to
> git-rev-list!)

Good man.

> But "git-shortlog" doesn't like the output from this, so I need
> a script (or another tip on arguments to git commands).

Ehh. This is getting ugly, but hey, that's my middle name.

	git-rev-list --header newhead ^oldhead |
		grep -z "committer .*tony\.luck" |
		tr '\0' '\n' |
		git-shortlog


and btw, this depends on "git-shortlog" also understanding non-pretty log 
messages, with a patch like below.

Junio?

		Linus "ugly" Torvalds

---
Subject: Teach git-shortlog about raw log format too

This teaches "git-shortlog" to understand the non-prettified author format 
too, so you can use it with "--pretty=raw" or "--header" output too.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
diff --git a/git-shortlog.perl b/git-shortlog.perl
--- a/git-shortlog.perl
+++ b/git-shortlog.perl
@@ -108,7 +108,7 @@ sub changelog_input {
 		if ($pstate == 1) {
 			my ($email);
 
-			next unless /^Author: (.*)<(.*)>.*$/;
+			next unless /^Author: (.*)<(.*)>.*$/ || /^author (.*)<(.*)>.*$/;
 	
 			$n_records++;
 	

```
