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

Re: [Q] Determing if a commit is reachable from the HEAD ?

From
BFBrian Foster <brian.foster@maxim-ic.com>
Date
Jan 23, 2012, 09:20 UTC
Message-ID
<201201231020.04041.brian.foster@maxim-ic.com>
In-Reply-To
<CAMK1S_gkZYpK3nrNMsnmFzi=tzjyEjVwOo_j4Z=d0hqjdF7r_w@mail.gmail.com>
On Friday 20 January 2012 23:50:23 Sitaram Chamarty wrote:
Show 14 quoted lines
> 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/
Previous: Sitaram ChamartyNext: Junio C Hamano
Message 9 of 12 in “[Q] Determing if a commit is reachable from the HEAD ?”
  1. Brian FosterJan 20, 2012
  2. Andreas SchwabJan 20, 2012
  3. David BrownJan 20, 2012
  4. Junio C HamanoJan 20, 2012
  5. David BrownJan 20, 2012
  6. Junio C HamanoJan 21, 2012
  7. David BrownJan 21, 2012
  8. Sitaram ChamartyJan 20, 2012
  9. Brian FosterJan 23, 2012
  10. Junio C HamanoJan 23, 2012
  11. Brian FosterJan 24, 2012
  12. Brian FosterJan 24, 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.