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

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

From
Julia Evans <julia@jvns.ca>
Date
Nov 11, 2025, 15:24 UTC
Message-ID
<2474339d-67bc-4a68-9f26-fe7edd172ec4@app.fastmail.com>
In-Reply-To
<xmqqfrakyj0w.fsf@gitster.g>

(this message got a bit long but the tl;dr is: maybe "a branch is a label for a commit ID" would work?)

On Tue, Nov 11, 2025, at 5:13 AM, Junio C Hamano wrote:
Show 9 quoted lines
> "Julia Evans" <julia@jvns.ca> writes:
>
>> Like you noticed in the tag object section, I think saying that the tag
>> object "refers to an object" works well in that context, but in the context
>> of explaining what a branch is it makes the text more confusing.
>
> Sorry, but I do not understand your objection, as I cannot see what
> confusion it would bring in in saying "a ref refers to an object"
> (or "a branch refers to a commit object"). 
Show 5 quoted lines
> A ref refers to an
> object, just like a tag field in a tag object or a tree-entry in a
> tree object refer to another object.  They do so by recording the
> name of the object they refer to.  So what's so confusing if we said
> that straight?

My main strategy for figuring out if something is confusing or not is to talk to a few different users of the software and to ask them what they think. I have a pretty empirical approach to figuring out if an explanation is clear or not, if people think it's clear, then it's clear. (the question of "accuracy" is separate of course)

From experience talking to people about references in Git I know that this particular thing is extremely easy to get wrong, I used to often try to explain branches by saying something like "A branch to a commit" and I would get kind of a blank stare, which is why I'm so cautious about the phrasing here.

The reason I started with "a branch is a name for a commit ID" initially is that I've found that people respond well to that phrasing in the past, and I don't think it gives a misleading impression about what a branch is. But I thought your point that (in the context of this document) the term "name" could perhaps be confused with "object name" was reasonable, so I've been trying to come up with an alternative.

It's always a little tricky to explain from first principles _why_ something is confusing, when I started working on explaining Git a couple of years ago I would have thought that many of your suggested phrasings would be an effective way to explain how Git branches work to people and I was very surprised to see how careful I had to be around the phrasing to get folks to understand how branches work.

Show 10 quoted lines
> Are you saying that the noun "reference" (or "ref") is a sufficient
> clue to readers that their objective is to "refer to" something, so
> "refers to" is a redundant thing to say?
>
> Maybe its just me, but I find it a quite roundabout thing to say
> that a ref refers to an object name (or "ID" if you like), simply
> because name or ID *is* a way to refer to the thing that is assigned
> that name, so you are making a ref to refer to something ("name")
> that refers to what it ("ref") originally wanted to refer to
> ("object").

My thought process is sort of like this: I have two descriptions of "a Git branch" that people have responded well to in the past in practice:

1. a branch is a name for a commit ID (you said that the use of
   "name" could be confused with "object name", which
   I thought was fair)
2. a branch is a file that contains a commit ID (people often
   respond very well to how concrete this is, but it refers to
   Git's implementation which we're trying to avoid in this context)

So I'm trying to find a different wording that's similar to one of these two phrasings that I know are effective, but that doesn't have those problems.

Some of the options we've discussed are:
- "a branch refers to a commit ID" (which as you've said has kind of a
  "type" issue since technically the branch refers to a commit, though
  when I've discussed it people they don't seem to think it's a problem
  in practice)
- "a branch refers to a commit, using its ID" (we had a long discussion
  about how "using its ID" can lead the reader to think "wait, how else
  could you refer to a commit", which in the context of trying to learn
  what a branch is an unproductive distraction)
- "a branch records a commit ID" (from my discussions I'm pretty sure the
  word "records" does not work, I think it's because introducing a new
  verb like "records" is always a bit dangerous)

One idea I just had is "a branch is a label for a commit ID", which I think avoids the issue with "name" from earlier.

Show 17 quoted lines
> That is what I find the most strange in the construction "A branch
> refers to ID" at the conceptual level.  I am much less unhappy with
> "A branch records an ID", but stopping at that may make readers ask
> the obvious question "what goal does that design aim to achieve?"
> (whose answer is of course "to refer to the object that is assigned
> that ID").
>
> "A branch refers to a commit object by recording its object name",
> "A branch records the ID of a commit it refers to", "A branch
> records the ID of the commit at the tip of its history".  Any of the
> phrasing that does not make "ID" the object/target of the verb
> "refer to" would work to avoid that strange construction.
>
> By the way, Ben used a word "unwelcome", but the words that are more
> appropriate to describe my reaction were "frustrated" (for not being
> able to explain what I know to be true clearly to make others
> understand) and "disappointed".
Previous: Ben KnobleNext: Junio C Hamano
Message 75 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.