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

Re: kernel.org now has gitweb installed

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 28, 2005, 18:55 UTC
Message-ID
<Pine.LNX.4.58.0504281149330.18901@ppc970.osdl.org>
In-Reply-To
<1114680199.12012.363.camel@baythorne.infradead.org>
On Thu, 28 Apr 2005, David Woodhouse wrote:
Show 7 quoted lines
> 
> Walk the tree once. For each commit, count the number of _children_.
> That's not hard -- each new commit you find below HEAD has one child to
> start with, then you increment that figure by one each time you find
> another path to the same commit.
> 
> When printing, you walk the tree depth-first, remote-parent-first.
No, that really sucks. 

Realize that "remote" and "local" parents don't really exist. They have no meaning. I've considered sorting the parents by the sha1 name, but I've left that for now.

Anyway, the reason remote and local don't matter is that if somebody else merges with me, and I just pull the result without having any changes in my tree, we just "fast-forward" to that other side, because otherwise you can never "converge" on anything (people merging each others trees would always create a new commit, for no good reason).

What does that mean? It means that my local tree now became the _remote_ parent, even though it was always local to my tree.

So if you look at remote vs local, you're _guaranteed_ to mess up. It has no meaning.

So what you can do is:
 - if there is one parent, just always walk straight down
 - if it's a merge, add the parents _in_date_order_ to the list of things 
   to do, and then pop the most recent one.

Really. You say that dates don't matter, but they _do_ actually matter a lot more than "remote/local" does. At least they have meaning.

		Linus
Previous: David WoodhouseNext: David Woodhouse
Message 7 of 23 in “kernel.org now has gitweb installed”
  1. H. Peter AnvinApr 28, 2005
  2. Daniel JacobowitzApr 28, 2005
  3. David WoodhouseApr 28, 2005
  4. Petr BaudisApr 28, 2005
  5. David WoodhouseApr 28, 2005
  6. David WoodhouseApr 28, 2005
  7. Linus TorvaldsApr 28, 2005
  8. David WoodhouseApr 28, 2005
  9. Linus TorvaldsApr 28, 2005
  10. David WoodhouseApr 28, 2005
  11. H. Peter AnvinApr 28, 2005
  12. H. Peter AnvinApr 28, 2005
  13. Linus TorvaldsApr 28, 2005
  14. David WoodhouseApr 28, 2005
  15. Jan HarkesApr 29, 2005
  16. Junio C HamanoApr 28, 2005
  17. David WoodhouseApr 28, 2005
  18. Junio C HamanoApr 28, 2005
  19. Linus TorvaldsApr 28, 2005
  20. Gerhard SchrenkApr 28, 2005
  21. David WoodhouseApr 28, 2005
  22. Junio C HamanoApr 28, 2005
  23. Linus TorvaldsApr 28, 2005

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.