Re: Automatically identifying the "split" point of a merged branch.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 30, 2011 at 10:53 PM, Jeff King <peff@xxxxxxxx> wrote:
> On Sat, Jul 30, 2011 at 05:54:59PM -0700, Conrad Irwin wrote:
>
> If you know M, then B is the merge-base of M^1 and M^2 (i.e., the
> parents of M). If you don't know M, but do know D, you can find it by
> walking backwards from "integration" until you find a merge commit with
> D as its second parent (e.g., by grepping "rev-list --parents").
>
> Make sense?

Yup. git rev-list was definitely the tool I was missing, thank you :).

Conrad

merge=$(git rev-list --parents integration |\
                 grep " $(git rev-parse topic)" | cut -d' ' -f 1)
split=$(git merge-base $merge^ $merge^2)
git rebase --onto master $split
git checkout master
git merge --no-ff topic
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]