threads / rfc / 636

[RFC] adding merge-node to parent lines in a commit

Subject: [RFC] adding merge-node to parent lines in a commit

## tl;dr

5 messages between May 15, 2005 and May 15, 2005.

replies: 4people: 2as markdown or json

Sean· May 15, 2005, 21:22 UTC · lore

Just a random thought presented for flamage... Would adding the merge node to each "parent" line in merge nodes be workable?

parent  SHA1-PARENT  SHA1-MERGE-NODE

It's not exactly clear cut I guess, especially in the case of multi-parent merges, but it would make descending the history slightly easier. It would let you look at any merge, and know exactly which commits were associated with that merge, without needing any repo-id or time information. This information is needed at the time of merge anyway, so recording it rather than leaving it to be calculated later makes some sense. Comments?

Cheers, Sean

Junio C Hamano· May 15, 2005, 21:30 UTC · re: Sean · lore

Re: [RFC] adding merge-node to parent lines in a commit

It is not clear to me ID of what object is being recorded as SHA1-MERGE-NODE in your proposal. Care to illustrate?

Sean· May 15, 2005, 22:07 UTC · re: Junio C Hamano · lore

Re: [RFC] adding merge-node to parent lines in a commit

On Sun, May 15, 2005 5:30 pm, Junio C Hamano said:
> It is not clear to me ID of what object is being recorded as
> SHA1-MERGE-NODE in your proposal.  Care to illustrate?
Hey Junio,
Yes, it's pretty basic unless i'm overlooking something:
Rn---\
>    Mn
>    Mn-1

Rn-1 | Rn-2 | Rn-3--/ Initial

So for this particular case it's rather simple, the Rn merge node would have:

parent Rn-1 (ommitted) parent Mn Rn-3

Essentially, you are recording in the merge commit the length of each branch that represents new commits that did not exist in this repository before this merge.

But there are more complicated cases with multiple parent merges. What this would avoid is the need to calculate common_anscestor in routines like git-rev-list, because that information would already be stored. As far as I know this information is already available at merge time anyway, so recording it shouldn't be a burden. I'm not sure it buys you a ton out the other end, but perhaps it would be slightly easier to piece the merge history back together.

Sean
Junio C Hamano· May 15, 2005, 22:36 UTC · re: Sean · lore

Re: [RFC] adding merge-node to parent lines in a commit

>>>>> "S" == Sean  <seanlkml@sympatico.ca> writes:
S> Yes, it's pretty basic unless i'm overlooking something:
    Rn---\
         Mn
         Mn-1
    Rn-1  |
    Rn-2  |
    Rn-3--/
    Initial

S> So for this particular case it's rather simple, the Rn merge S> node would have:

S> parent Rn-1 (ommitted) S> parent Mn Rn-3

Isn't that something you can obtain by scanning the parents and running merge-base across them without recording it in the commit?

Sean· May 15, 2005, 22:47 UTC · re: Junio C Hamano · lore

Re: [RFC] adding merge-node to parent lines in a commit

On Sun, May 15, 2005 6:36 pm, Junio C Hamano said:
Show 21 quoted lines
>>>>>> "S" == Sean  <seanlkml@sympatico.ca> writes:
>
> S> Yes, it's pretty basic unless i'm overlooking something:
>
>     Rn---\
>          Mn
>          Mn-1
>     Rn-1  |
>     Rn-2  |
>     Rn-3--/
>     Initial
>
> S> So for this particular case it's rather simple, the Rn merge
> S> node would have:
>
> S> parent  Rn-1  (ommitted)
> S> parent  Mn    Rn-3
>
> Isn't that something you can obtain by scanning the parents and
> running merge-base across them without recording it in the
> commit?

Yes it is, and i was mistaken to think it gave more information. It would shave some time off history traversal, but nothing else.

Sean

← back to recent threads