From: Jeff King <peff@peff.net>
To: "Carlos Martín Nieto" <carlos@cmartin.tk>
Cc: Bryan O'Sullivan <bryano@fb.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: logging disjoint sets of commits in a single command
Date: Tue, 31 Jan 2012 19:53:33 -0500 [thread overview]
Message-ID: <20120201005332.GC30969@sigill.intra.peff.net> (raw)
In-Reply-To: <1328056769.31804.217.camel@centaur.lab.cmartin.tk>
On Wed, Feb 01, 2012 at 01:39:29AM +0100, Carlos Martín Nieto wrote:
> > 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.
Right. That command is equivalent to:
373af0c 590dfe2 --not 373af0c^ 590dfe2^
So the limiting for one range you're interested in ends up marking part
of the other as uninteresting, and that's by design. This topic came up
recently, and I think the general consensus is that it would be cool to
be able to do totally independent ranges, but that would be backwards
incompatible with the current behavior.
In the general case, you can emulate this with:
{ git log 373af0c^..373af0c
git log 590dfe2^..590dfe2
} | $PAGER
which is of course slightly more annoying to type. If you're just
interested in _single_ commits, though, you can just give the commits
and turn off walking:
git log --no-walk 373af0c 590dfe2
> 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.
I think you could even drop the rev-lists in this case, since he just
wants a single commit. However, cat-file lacks the niceties of "log",
like fancy --pretty formatting and automatic diffing against parents.
-Peff
next prev parent reply other threads:[~2012-02-01 0:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-01 0:15 logging disjoint sets of commits in a single command Bryan O'Sullivan
2012-02-01 0:27 ` Bryan O'Sullivan
2012-02-01 0:39 ` Carlos Martín Nieto
2012-02-01 0:53 ` Jeff King [this message]
2012-02-01 1:02 ` Bryan O'Sullivan
2012-02-01 3:03 ` Jeff King
2012-02-01 22:01 ` Bryan O'Sullivan
2012-02-01 0:48 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120201005332.GC30969@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=bryano@fb.com \
--cc=carlos@cmartin.tk \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).