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

Determining if two commits are on a separate branch

From
ADAdr3nal D0S <adr3nald0s@gmail.com>
Date
Jun 27, 2008, 14:55 UTC
Message-ID
<308083c30806270755t4316be67u1f468b51bf475d28@mail.gmail.com>

We are making extensive use of submodules at work and we have created a number of extra scripts to simplify our usage. For example, there is git-rstatus, which recursively reports status of all submodules.

I am working on another script to check whether or not a change to any submodules jump branches. If we have commits like this:

A--B--C
   \--D

I don't care if a submodule moves from A to C or B to C, but I do care if a commit of the super-project would cause a jump from D to C or revert from C to B, effectively dropping previously committed code on the floor.

So, is there a "correct" or "best" way to determine if one commit's SHA follows directly from another's SHA in the commit history?

Next: Michael J Gruber
Message 1 of 3 in “Determining if two commits are on a separate branch”
  1. Adr3nal D0SJun 27, 2008
  2. Michael J GruberJun 27, 2008
  3. Santi BéjarJun 27, 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.