[prev in list] [next in list] [prev in thread] [next in thread]
List: git
Subject: Re: Determining if two commits are on a separate branch
From: "=?ISO-8859-1?Q?Santi_B=E9jar?=" <sbejar () gmail ! com>
Date: 2008-06-27 15:17:39
Message-ID: 8aa486160806270817j1cab369eyc2d74996e9a3286f () mail ! gmail ! com
[Download RAW message or body]
On Fri, Jun 27, 2008 at 16:55, Adr3nal D0S <adr3nald0s@gmail.com> wrote:
[...]
> 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?
You can compute the merge-base of these two commits and if the base is
one of them then it is a fast-forward.
For example, in git.git:
$ git merge-base origin/next origin/master
d54467b8c319571b5dc433b1f7e471c4b0f21caf
$ git rev-parse origin/next origin/master
3e7d305293ce93d00d5e0e6371311f7caa94f497
d54467b8c319571b5dc433b1f7e471c4b0f21caf
The merge-base is origin/master so it is an ancestor of origin/next.
HTH
Santi
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic