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

Re: Best method of detecting if list of commit refs is a parent

From
Thomas Harning <harningt@gmail.com>
Date
Aug 18, 2008, 13:37 UTC
Message-ID
<17B524E9-FDF9-4585-AFBD-A5304E3A4AA6@gmail.com>
In-Reply-To
<7vfxp3ndec.fsf@gitster.siamese.dyndns.org>
On Aug 18, 2008, at 12:41 AM, Junio C Hamano wrote:
Show 18 quoted lines
>
> If you have bunch of commits A B C D E F and if you would want to know
> which one of them is reachable from X, you could of course run merge- 
> base
> once for each of A..F.  Another way to do this would be to run:
>
> 	git rev-list A B C D E F ^X
>
> and look at the output.  The ones among A..F that appear in the  
> output are
> not reachable from X.  The ones that are reachable from X do not  
> appear in
> the output.
>
> This is because "rev-list" outputs everything reachable from the given
> commits without ^ prefix, excluding the ones that are reacahble from  
> the
> ones prefixed with ^.

Perfect! Now... is there built-in way to invert this to list those that 'are' reachable..... Or would the inverse really end up calculating the difference between input list and output list?

Previous: Junio C HamanoNext: Thomas Harning
Message 3 of 4 in “Best method of detecting if list of commit refs is a parent”
  1. Thomas Harning Jr.Aug 18, 2008
  2. Junio C HamanoAug 18, 2008
  3. Thomas HarningAug 18, 2008
  4. Thomas HarningAug 23, 2008

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.