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

Re: logging disjoint sets of commits in a single command

From
Carlos Martín Nieto <carlos@cmartin.tk>
Date
Feb 1, 2012, 00:39 UTC
Message-ID
<1328056769.31804.217.camel@centaur.lab.cmartin.tk>
In-Reply-To
<CB4DC442.72F%bryano@fb.com>
On Wed, 2012-02-01 at 00:27 +0000, Bryan O'Sullivan wrote:
Show 19 quoted lines
> On 2012-01-31 16:15 , "Bryan O'Sullivan" <bryano@fb.com> wrote:
> 
> >I'm trying to use "git log" to display only a handful of commits, where
> >the commits are not necessarily linearly related to each other.
> 
> And I beautifully fat-fingered the "send" key. Oops.
> 
> What I was *going* to say was that it looks like revision.c:limit_list is
> (whether intentionally or not) getting in the way of this.
> 
> Here's a sample command line against a kernel tree:
> 
> git log 373af0c^..373af0c 590dfe2^..590dfe2
> 
> I want git to log those two specific commits, but in fact it looks like
> limit_list is marking 590dfe2 as UNINTERESTING while processing 373af0c,
> and so it gets pruned.
> 
> Is there some way around this, or would a patch to fix it be acceptable?

From my reading of the manpage (and the way most git commands work) log accepts one range of commits. They all get bunched up together.

You might find cat-file's --batch mode interesting.
    git rev-list 373af0c^..373af0c | git cat-file --batch
    git rev-list 590dfe2^..590dfe2 | git cat-file --batch
looks a lot like what you're looking for.
   cmn
Previous: Bryan O'SullivanNext: Jeff King
Message 3 of 8 in “logging disjoint sets of commits in a single command”
  1. Bryan O'SullivanFeb 1, 2012
  2. Bryan O'SullivanFeb 1, 2012
  3. Carlos Martín NietoFeb 1, 2012
  4. Jeff KingFeb 1, 2012
  5. Bryan O'SullivanFeb 1, 2012
  6. Jeff KingFeb 1, 2012
  7. Bryan O'SullivanFeb 1, 2012
  8. Junio C HamanoFeb 1, 2012

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.