Re: Finding a branch point in git

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

 



On Mon, May 28, 2012 at 02:36:04PM +0200, Felipe Contreras wrote:

> > What about a history with multiple branches?
> >
> > --X--A--B--C--D----E  (master)
> >      \           /
> >       G--H--I---J   (branch X)
> >           \    /
> >            K--L    (branch Y)
> [...]
> 
> Yes, but then you would need to specify a second branch. I would avoid
> that if possible.

I agree that is less nice. But I don't think the operation is
well-defined with a single branch. If you ask for "when did branch X
split", then in the above graph it is unclear if you meant "split from
master", or "split from Y".

Maybe you could assume "master", or assume "git symbolic-ref HEAD" as
the second branch?

> There's also another case that doesn't work:
> 
> -- X -- A -- B (master)
>          \
>           \
>            C (branch A)
> 
> Shouldn't be hard to add checks for those cases I think.

Actually, I think that one extends naturally. They are never merged, so
your rev-list never finds a merge commit, and you can just take the
merge base of the branch tips.

-Peff
--
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]