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

Re: [PATCH v5] doc: add an explanation of Git's data model

From
Julia Evans <julia@jvns.ca>
Date
Nov 5, 2025, 16:26 UTC
Message-ID
<7217ae44-5ad5-468c-b76b-c485247fb2f4@app.fastmail.com>
In-Reply-To
<7E8706EF-6C15-43AD-A847-5C896D9235AA@gmail.com>
On Tue, Nov 4, 2025, at 10:21 PM, Ben Knoble wrote:
Show 35 quoted lines
>> Le 4 nov. 2025 à 19:02, Julia Evans <julia@jvns.ca> a écrit :
>> 
>> 
>> 
>>> On Tue, Nov 4, 2025, at 6:45 PM, Junio C Hamano wrote:
>>> "Julia Evans" <julia@jvns.ca> writes:
>>>> I do not see the point of implying that the commit ID is not "special", or that
>>>> it's only one of many ways to find a commit because to me it seems very special,
>>>> since there is no way I know of to retrieve a commit that doesn't ultimately
>>>> end up using the commit ID at some point. (though that ID might not be encoded
>>>> in hexadecimal)
>>> That is not what I am trying to say.  The hexadecimal name is the
>>> most neutral way to refer to a commit object, and in that sense it
>>> is special.  It is the way ref subsystem uses to record the name of
>>> objects, and that makes it special enough.
>>> But that does not mean that the name _is_ the object.  The
>>> hexadecimal name is a way you use to name the object, but is not the
>>> object itself, and the special-ness of that name does not change it.
>> 
>> Okay. I still do not understand at all why this is so important to you
>> (for the reasons I mentioned before) but I'll see if there's anything I can do.
>
> Perhaps one way to look at is, what diagram would I draw given 
> different textual explanations?
>
> The diagram we _want_ folks to draw (?) is the one where a branch 
> points at a commit [a circle, perhaps], which points to a tree 
> [triangle] and recursively blobs [squares], like I’ve seen Stolee draw 
> for GitHub blogs.
>
> We might also want folks to label the arrows with names, or not.
>
> One way to interpret the “branch refers to a commit ID” might be to 
> draw a diagram where the branch points to an ID label, and to find the 
> circle you have to separately consult a different part of the diagram.

Yes, the most common type of Git diagram I see is something like this: https://git-scm.com/book/en/v2/images/head-to-master.png which only includes references, commits, and HEAD.

That's the diagram I have in mind when writing this text, and I think it's a useful and accurate diagram to keep in mind, and it's one that you see very often when using Git tools, including in `git log --graph`. (it's not a _complete_ diagram of every type of object, but diagrams do not need to be complete to be accurate)

I personally would not use a graph diagram to explain how commits relate to trees and blobs (normally I use `git cat-file -p` instead, like I did in this `gitdatamodel` document. You can see this comic for a "visual" example of how I've approached discussing trees and blobs in the past with `git cat-file -p` https://wizardzines.com/comics/explore-a-commit/).

> Both seem useful to me, though as the former has fewer moving pieces 
> might be better for the model this document describes? I dunno.
Previous: Ben KnobleNext: Ben Knoble
Message 59 of 89 in “doc: add a explanation of Git's data model”
  1. doc: add a explanation of Git's data modelJulia Evans via GitGitGadget, Oct 3, 2025
  2. Kristoffer HaugsbakkOct 3, 2025
  3. Julia EvansOct 6, 2025
  4. D. Ben KnobleOct 6, 2025
  5. Julia EvansOct 6, 2025
  6. D. Ben KnobleOct 6, 2025
  7. Julia EvansOct 9, 2025
  8. Kristoffer HaugsbakkOct 8, 2025
  9. Junio C HamanoOct 6, 2025
  10. Julia EvansOct 6, 2025
  11. Kristoffer HaugsbakkOct 7, 2025
  12. Junio C HamanoOct 7, 2025
  13. Patrick SteinhardtOct 7, 2025
  14. Junio C HamanoOct 7, 2025
  15. Julia EvansOct 7, 2025
  16. Junio C HamanoOct 7, 2025
  17. D. Ben KnobleOct 7, 2025
  18. Julia EvansOct 7, 2025
  19. Patrick SteinhardtOct 8, 2025
  20. Junio C HamanoOct 8, 2025
  21. Julia EvansOct 8, 2025
  22. doc: add a explanation of Git's data modelJulia Evans via GitGitGadget, Oct 8, 2025
  23. Patrick SteinhardtOct 10, 2025
  24. Junio C HamanoOct 13, 2025
  25. Patrick SteinhardtOct 14, 2025
  26. Julia EvansOct 14, 2025
  27. Patrick SteinhardtOct 14, 2025
  28. Junio C HamanoOct 14, 2025
  29. doc: add a explanation of Git's data modelJulia Evans via GitGitGadget, Oct 14, 2025
  30. Patrick SteinhardtOct 15, 2025
  31. Junio C HamanoOct 15, 2025
  32. Julia EvansOct 15, 2025
  33. Junio C HamanoOct 15, 2025
  34. Julia EvansOct 16, 2025
  35. Junio C HamanoOct 15, 2025
  36. Julia EvansOct 16, 2025
  37. Junio C HamanoOct 16, 2025
  38. Julia EvansOct 16, 2025
  39. Junio C HamanoOct 16, 2025
  40. Kristoffer HaugsbakkOct 16, 2025
  41. Kristoffer HaugsbakkOct 20, 2025
  42. Junio C HamanoOct 20, 2025
  43. doc: add an explanation of Git's data modelJulia Evans via GitGitGadget, Oct 27, 2025
  44. Junio C HamanoOct 27, 2025
  45. Julia EvansOct 28, 2025
  46. Junio C HamanoOct 28, 2025
  47. doc: add an explanation of Git's data modelJulia Evans via GitGitGadget, Oct 30, 2025
  48. Junio C HamanoOct 31, 2025
  49. Patrick SteinhardtNov 3, 2025
  50. Junio C HamanoNov 3, 2025
  51. Julia EvansNov 3, 2025
  52. Junio C HamanoNov 4, 2025
  53. Julia EvansNov 4, 2025
  54. Junio C HamanoNov 4, 2025
  55. Julia EvansNov 4, 2025
  56. Junio C HamanoNov 4, 2025
  57. Julia EvansNov 5, 2025
  58. Ben KnobleNov 5, 2025
  59. Julia EvansNov 5, 2025
  60. Ben KnobleNov 6, 2025
  61. Junio C HamanoOct 31, 2025
  62. Patrick SteinhardtNov 3, 2025
  63. Julia EvansNov 3, 2025
  64. doc: add an explanation of Git's data modelJulia Evans via GitGitGadget, Nov 7, 2025
  65. Junio C HamanoNov 7, 2025
  66. Junio C HamanoNov 7, 2025
  67. Julia EvansNov 7, 2025
  68. Junio C HamanoNov 7, 2025
  69. Junio C HamanoNov 8, 2025
  70. Ben KnobleNov 9, 2025
  71. Junio C HamanoNov 9, 2025
  72. Julia EvansNov 10, 2025
  73. Junio C HamanoNov 11, 2025
  74. Ben KnobleNov 11, 2025
  75. Julia EvansNov 11, 2025
  76. Junio C HamanoNov 12, 2025
  77. Junio C HamanoNov 12, 2025
  78. Julia EvansNov 13, 2025
  79. Junio C HamanoNov 13, 2025
  80. Julia EvansNov 13, 2025
  81. Chris TorekNov 13, 2025
  82. Junio C HamanoNov 13, 2025
  83. doc: add an explanation of Git's data modelJulia Evans via GitGitGadget, Nov 12, 2025
  84. Junio C HamanoNov 12, 2025
  85. Junio C HamanoNov 23, 2025
  86. Patrick SteinhardtDec 1, 2025
  87. Junio C HamanoDec 2, 2025
  88. Julia EvansOct 9, 2025
  89. Ben KnobleOct 10, 2025

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.