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

Re: Can I have this, pretty please?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Aug 12, 2007, 20:21 UTC
Message-ID
<alpine.LFD.0.999.0708121315310.30176@woody.linux-foundation.org>
In-Reply-To
<85k5s0msei.fsf@lola.goethe.zz>
On Sun, 12 Aug 2007, David Kastrup wrote:
Show 5 quoted lines
> >
> > rev-list doesn't try to draw a line from each commit to its parents.
> 
> Well, that's what --topo-order is somewhat about, but it might
> actually not do much together with --all.

No, --topo-order works with --all too. In fact, to some degree, it's *especially* useful with --all, since having multiple tips makes the whole topological sort all the more interesting, and also usually makes the end result more interesting (ie it's often much more interestign to visualize two or more branches together, just to see the *relationships* between the branches, and see what is shared.

And yes, it keeps track of every single commit, and computes the relationships between them. So it does indeed "draw the line", except it can do so in a rather dense and optimized set of data structures.

(That's one reason I love coding in C: it may be more effort, but you can tune your data structures in ways you seldom can in higher-level languages, and git-rev-list and the object representation is some of the most tuned code in git).

> 20 bytes of payload for a commit number.  Make a usable hashing data
> structure for it, adds perhaps another 20 bytes.  Links to all parents
> are 4 bytes each.  All in all, we won't need more than 64 bytes per
> commit.

Yeah, that's the rough ballpark (except for 64-bit architectures, the links are all 8 bytes, but we're pretty careful). See "object.h" for most of the details.

			Linus
Previous: David KastrupNext: Linus Torvalds
Message 12 of 29 in “Can I have this, pretty please?”
  1. David KastrupAug 12, 2007
  2. Steven GrimmAug 12, 2007
  3. David KastrupAug 12, 2007
  4. Linus TorvaldsAug 12, 2007
  5. Linus TorvaldsAug 12, 2007
  6. Jon SmirlAug 12, 2007
  7. Linus TorvaldsAug 12, 2007
  8. David KastrupAug 12, 2007
  9. David KastrupAug 12, 2007
  10. Uwe Kleine-KönigAug 12, 2007
  11. David KastrupAug 12, 2007
  12. Linus TorvaldsAug 12, 2007
  13. Linus TorvaldsAug 12, 2007
  14. David KastrupAug 12, 2007
  15. Paul MackerrasAug 13, 2007
  16. David KastrupAug 13, 2007
  17. David KastrupAug 12, 2007
  18. Linus TorvaldsAug 12, 2007
  19. David KastrupAug 12, 2007
  20. Linus TorvaldsAug 12, 2007
  21. David KastrupAug 12, 2007
  22. Govind SalinasAug 12, 2007
  23. David KastrupAug 12, 2007
  24. Martin LanghoffAug 12, 2007
  25. David KastrupAug 12, 2007
  26. Jeff KingAug 12, 2007
  27. Jeff KingAug 12, 2007
  28. David KastrupAug 12, 2007
  29. Jeff KingAug 12, 2007

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.