Re: git-log vs git-rev-list
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- May 30, 2008, 17:25 UTC
- Message-ID
- <alpine.LFD.1.10.0805301021310.3141@woody.linux-foundation.org>
- In-Reply-To
- <20080530165641.GG18781@machine.or.cz>
On Fri, 30 May 2008, Petr Baudis wrote:
> > * git log --pretty=format is actually sane and does not pollute the > output with spurious 'commit' lines
Why would you want to use "git-rev-list" at all?
The common case for git-rev-list is for things that git log simply won't do, ie things like "git rev-list --all --objects" that is a nonsensical operation to do on "git log".
So if you use "--pretty" or anything like that, you generally shouldn't use rev-list. Sure, it works, but it works for mainly historical reasons.
> I think that having two commands that by now do essentially the same > thing, but slightly differently, is rather messy UI. Thus, I'm wondering > if it would be worthwhile to make rev-list a thin git-log wrapper and > start phasing it out?
It already is. It's already phased out in the sense that I don't see why you complain. If you don't like it, don't use it. It has legacy reasons for existing, and it does *some* things that are simply not sensible at all for "git log" (ie the non-commit things).
> Yes, git-rev-list is supposed to be a plumbing thing, but from my > porcelain, I actually have to use git-log anyway [..]
So why do you care?
No, git-rev-list is *not* the same as "git log".
Yes, git rev-list can do a lot of the same things, for historical reasons.
Yes, they share most of the code. No, they're not the same.
Linus