git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Petr BaudisNext: Petr Baudis
Message 2 of 7 in “git-log vs git-rev-list”
  1. Petr BaudisMay 30, 2008
  2. Linus TorvaldsMay 30, 2008
  3. Petr BaudisMay 30, 2008
  4. Linus TorvaldsMay 30, 2008
  5. Petr BaudisMay 30, 2008
  6. Linus TorvaldsMay 30, 2008
  7. Junio C HamanoMay 30, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.