Re: Finding a branch point in git

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

 



On Thu, May 31, 2012 at 8:27 AM, Felipe Contreras
<felipe.contreras@xxxxxxxxx> wrote:
> On Wed, May 30, 2012 at 11:54 PM, Jeff King <peff@xxxxxxxx> wrote:
>> On Wed, May 30, 2012 at 07:07:39PM +0200, Felipe Contreras wrote:
>>
>>> On Mon, May 28, 2012 at 9:06 PM, Jeff King <peff@xxxxxxxx> wrote:
>>> > 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".
>>>
>>> If you look from the context that I explained in the first mail; it
>>> would be from *any* branch; IOW; find the first commit from branch X
>>> (G), and then find the parent. That would be the first commit where
>>> branch X started.
>>
>> I'm not sure that's possible, though, in the face of criss-cross merges.
>> How do we distinguish the history above from one in which branch Y was
>> forked from master at G, and then branch X was forked from branch Y at
>> H?
>
> That is true, but we could use the algorithm used by name-rev: G would
> have a distance 3 from branch X, and distance 2 from Y, so it would be
> considered part of branch Y.
>
> Sure, it's not possible to know _for sure_, but this is a bit like
> renames; we don't really know if a file was renamed or not, but we can
> make a good guess.

Obviously G is part of branch Y, branch X, and branch master.  I'm
sure I'm missing the whole point of this exercise, because it seems to
me that it's just needlessly confusing to say anything else.

-PJ

Gehm's Corollary to Clark's Law: Any technology distinguishable from
magic is insufficiently advanced.
--
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]