git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] [PATCH 0/5] Implement 'prior' commit object links (and

From
Junio C Hamano <junkio@cox.net>
Date
May 1, 2006, 06:58 UTC
Message-ID
<7vlktms02x.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<4455638A.3070802@vilain.net>
Sam Vilain <sam@vilain.net> writes:
Show 13 quoted lines
> Junio C Hamano wrote:
>
>>To David, the commits he has in the chain between 6b426e to
>>18118c obviously suited the purpose of his tree better, and that
>>was why these commits were made.  And the fact Linus fast
>>forwarded to the tip of David is an implicit statement by Linus
>>that that results suits the purpose of Linus tree better as well
>>compared to his old tip, presumably 6b426e.
>
> Aha, now I see reason in the madness. So, the "prior" head is not stored
> in the trees, and tracking the progress of actual head transitions is
> loosely defined / a research topic. But demonstrably derivable. That
> works for me.

I do not think there is any madness involved here, but I should point out that the above example happens to work only because Linus and David are two different people. If Linus did the David's work in a separate repository, or even in the same repository but on a separate branch, people following the Linus tip might still want to know about the fast-forward, but that is something you cannot truly tell by the digging like what I did in the previous message.

That is why I earlier said this:
    *1* IOW, we _are_ losing some information by not recording the
    fact that fast-forward was done while doing so.  
    That record should _not_ be in the commit chain.  At the
    mechanical level, recording that in the commit chain means two
    criss-crossing branches never converge at the commit chain
    level, which is already bad.  At the philosophical level, the
    commit chain is a mesh of many possible "global" histories, and
    the record that somebody (a particular branch in a particular
    repository) was at what point in the mesh at given time does not
    belong there.
    But from the repository-owner's point of view, that _might_ be a
    useful information to keep.  I am just saying this preemptively
    so that if somebody wants to record it, that should not be
    recorded in the commit object.

I do not think the commit object is the place to record it, even with a purely-comment field like "note prior". The commit ancestry DAG is global in nature, and the information under discussion, "before pointing at this commit, the branch that made this commit happened to point at this other commit", is not. That information describes only one-branch's view of the world, and would not work in the fast-forward case because no new commit is created. An important property of a fast-forward is that we do not create an extra commit object that makes it impossible for two criss-crossing branches to ever converge.

On the other hand, a "note" field that records on which branch of which repository each commit was made (you need to give each repository-branch an UUID) when you do create a new commit would be a sensible thing to have if somebody cares deeply enough. It is an information that is global in nature, and with that, you could do the digging like I did without relying on the committer identity, but instead using the branch identity.

Previous: Jakub NarebskiNext: Sam Vilain
Message 13 of 16 in “Re: [RFC] [PATCH 0/5] Implement 'prior' commit object links (and”
  1. linux@horizon.comApr 29, 2006
  2. Linus TorvaldsApr 29, 2006
  3. Jakub NarebskiApr 29, 2006
  4. Junio C HamanoApr 29, 2006
  5. Jakub NarebskiApr 29, 2006
  6. Junio C HamanoApr 29, 2006
  7. Jakub NarebskiApr 29, 2006
  8. Jakub NarebskiApr 30, 2006
  9. Junio C HamanoApr 30, 2006
  10. Junio C HamanoMay 1, 2006
  11. Sam VilainMay 1, 2006
  12. Jakub NarebskiMay 1, 2006
  13. Junio C HamanoMay 1, 2006
  14. Sam VilainMay 2, 2006
  15. Martin LanghoffMay 2, 2006
  16. Sam VilainMay 1, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.