git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frans Pop <elendil@planet.nl>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: git@vger.kernel.org
Subject: Re: Testing if a certain commit is in the current branch
Date: Wed, 27 Jan 2010 09:47:40 +0100	[thread overview]
Message-ID: <201001270947.41480.elendil@planet.nl> (raw)
In-Reply-To: <vpqiqaonec1.fsf@bauges.imag.fr>

On Wednesday 27 January 2010, Matthieu Moy wrote:
> Frans Pop <elendil@planet.nl> writes:
> > I'm currently using the following command for this:
> >    git log --pretty=format:%H | grep -q "^<commit id>"
> >
> > Problem is that with large repos that can be quite slow.
> >
> > Is there a faster way to do the test?
>
> Not answering the question exactly, but "git branch --contains
> <commitid>" does almost this and a bit more.

Thanks. That would work as:
   git branch --contains <commitid> | grep -q "^\*"

It's a lot slower than Junio's solution though (and even slower than my 
original solution).

Cheers,
FJP

  reply	other threads:[~2010-01-27  8:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-27  7:19 Testing if a certain commit is in the current branch Frans Pop
2010-01-27  7:24 ` Junio C Hamano
2010-01-27  8:36   ` Frans Pop
2010-01-27 10:19     ` Jonathan Nieder
2010-01-27 13:26       ` Frans Pop
2010-01-27 15:15         ` Dale Farnsworth
2010-01-27 15:39           ` Frans Pop
2010-01-27 15:08     ` Petr Baudis
2010-01-27 15:27       ` Frans Pop
2010-01-27  8:26 ` Matthieu Moy
2010-01-27  8:47   ` Frans Pop [this message]
2010-01-27  8:56 ` Johannes Schindelin

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=201001270947.41480.elendil@planet.nl \
    --to=elendil@planet.nl \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --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).