public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Brian Foster <brian.foster@maxim-ic•com>
To: git mailing list <git@vger•kernel.org>
Cc: Sitaram Chamarty <sitaramc@gmail•com>
Subject: Re: [Q] Determing if a commit is reachable from the HEAD ?
Date: Mon, 23 Jan 2012 10:20:03 +0100	[thread overview]
Message-ID: <201201231020.04041.brian.foster@maxim-ic.com> (raw)
In-Reply-To: <CAMK1S_gkZYpK3nrNMsnmFzi=tzjyEjVwOo_j4Z=d0hqjdF7r_w@mail.gmail.com>

On Friday 20 January 2012 23:50:23 Sitaram Chamarty wrote:
> On Fri, Jan 20, 2012 at 7:03 PM, Brian Foster <brian.foster@maxim-ic•com> wrote:
>[ ... ]
> >                         x---Y---y---y---y  HEAD
> >                        /
> >  ...--o---o---C---o---S
> >                        \
> >                         n---n---N---*---*  other
> >
> >  In a script, how can I determine commit Y is reachable
> >  from the current HEAD ?   [ ... ]
> 
> I've been using 'git rev-list HEAD..Y'.  If it produces any output,
> Y is not reachable from HEAD (there is something in Y that is not
> in HEAD).

 What's interesting about this solution, at least
 with GIT v1.7.6.1 (I haven't tried other versions),
 is ‘git rev-list HEAD..Y’ does seem to work (if
 there is any output, then Y is not reachable from
 HEAD), but ‘git rev-list --quiet HEAD..Y’ does _not_
 work (it seems to always(?) exit status 0).

 I am probably misunderstanding ‘--quiet’, which the
 man page cryptically describes as “... allow the
 caller to test the exit status to see if a range
 of objects is fully connected (or not).”  What is
 meant here by “fully connected” ?

cheers!
	-blf-

-- 
Brian Foster
Principal MTS, Software        |  La Ciotat, France
Maxim Integrated Products      |  Web:  http://www.maxim-ic.com/

  reply	other threads:[~2012-01-23  9:20 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
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 [this message]
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=201201231020.04041.brian.foster@maxim-ic.com \
    --to=brian.foster@maxim-ic$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=sitaramc@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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