git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Brian Foster <brian.foster@maxim-ic.com>
Cc: git mailing list <git@vger.kernel.org>
Subject: Re: [Q] Determing if a commit is reachable from the HEAD ?
Date: Fri, 20 Jan 2012 15:13:58 +0100	[thread overview]
Message-ID: <m2ehuu8nrt.fsf@igel.home> (raw)
In-Reply-To: <201201201433.30267.brian.foster@maxim-ic.com> (Brian Foster's message of "Fri, 20 Jan 2012 14:33:29 +0100")

Brian Foster <brian.foster@maxim-ic.com> writes:

>  In a script, how can I determine commit Y is reachable
>  from the current HEAD ?

test $(git merge-base HEAD Y) = $(git rev-parse Y)

>  And, much more importantly
>  for my purposes, that commit N is _not_-reachable from
>  the current HEAD ?

test $(git merge-base HEAD N) != $(git rev-parse N)

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2012-01-20 14:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-20 13:33 [Q] Determing if a commit is reachable from the HEAD ? Brian Foster
2012-01-20 14:13 ` Andreas Schwab [this message]
2012-01-20 18:06   ` David Brown
2012-01-20 19:18     ` Junio C Hamano
2012-01-20 23:33       ` David Brown
2012-01-21  0:04         ` Junio C Hamano
2012-01-21  4:58           ` David Brown
2012-01-20 22:50 ` Sitaram Chamarty
2012-01-23  9:20   ` Brian Foster
2012-01-23 16:09     ` Junio C Hamano
2012-01-24  8:16       ` Brian Foster
2012-01-24  8:56       ` Brian Foster

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=m2ehuu8nrt.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=brian.foster@maxim-ic.com \
    --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).