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
Andreas Schwab <schwab@linux-m68k.org>
Date
Jan 20, 2012, 14:13 UTC
Message-ID
<m2ehuu8nrt.fsf@igel.home>
In-Reply-To
<201201201433.30267.brian.foster@maxim-ic.com>
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."
Previous: Brian FosterNext: David Brown
Message 2 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.