Re: Summary of core GIT while you are away.
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- May 26, 2005, 01:45 UTC
- Message-ID
- <Pine.LNX.4.58.0505251826460.2307@ppc970.osdl.org>
- In-Reply-To
- <20050526004411.GA12360@vrfy.org>
On Thu, 26 May 2005, Kay Sievers wrote:
Show 15 quoted lines
> > On Mon, May 16, 2005 at 09:10:10AM -0700, Linus Torvalds wrote: > > > > Then you could just do > > > > git-rev-list -v --header HEAD | grep -z 'author[^\n]*Linus' > > > > to tell it to do the "verbose" thing (only showing the header of the > > commit, not the whole message), and grep for "Linus" in the author line. > > What happened to that idea? That's not already working in some other way I > missed, right? The pickaxe stuff is nice and was easy to call from the cgi, > but searching in commit messages would be nice too. > If it's not going to happen in the git-binaries, I may do it just in the > cgi itself.
Ok, you twisted my arm. Checked in.
git-rev-list --header HEAD | grep -z 'author[\n]*Linus'
and you will get output that is a series of commits by me (strictly speaking, that's not true, since the "author" thing might be in the non-header part).
The format is:
<commit-id> '\n' <commit-msg> '\0'
and if the full commit message is binary and contains NUL bytes in itself (only crazy people do that, but let's keep in mind that crazy people exist), we naturally truncate it at the first NUL. This makes it easy to parse, and is what makes "grep -z" work, for example.
It also has a rudimentary "stop at commit x" function, but I'm not doing any reachability analysis, so it's purely based on the commit date, and is thus _not_ equivalent to "git-rev-tree START ^END". I reserve the right to try to change that behaviour, though, if I decide I (or sombody else ;) can do a nice incremental reacability thing.
So you can do
git-rev-list --header HEAD v2.6.12-rc5
and it will print out all the commits in date order until it hits v2.6.12-rc5 (which it won't print out).
The output format is really optimized for something like "git log" or "gitweb". I suspect it's pretty much perfect for doing the "last 10" things, without having to do "git-cat-file" for each commit.
Oh, and I considered adding a "--header-lines=c" which limits the header printout to 'c' lines (probably starting at where the free-form thing starts, so that "--header-lines=0" would print out just the fixed-format header of the commit messages.
(This is slightly different from what I initially envisioned, which had "-v" and "--header", and I'm not sure it's better but it ended up being what I did. If you think my first idea was better, send me a (by now trivial) patch).
Linus