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

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

From
Ben Knoble <ben.knoble@gmail.com>
Date
Oct 10, 2025, 00:42 UTC
Message-ID
<F485A91C-2F1E-44DD-9179-0B47426DA3B7@gmail.com>
In-Reply-To
<b2a9b8ca-8f2a-40f0-a724-0da707902985@app.fastmail.com>
Show 6 quoted lines
> Le 9 oct. 2025 à 10:21, Julia Evans <julia@jvns.ca> a écrit :
> 
> I collected some feedback from Git users on this v2 document. I'm expecting more
> feedback, but here's an initial brain dump of my notes. I mostly wrote this for
> my own use but I thought it might be interesting to other folks too.
> 
[snip]
Show 12 quoted lines
> references:
> 
> - Two people pointed out that because references are often stored as files,
>  you can't have two references named `julia/ticket-number` and
>  `julia/ticket-number/task-name`.
>  I'm not sure if this is a fundamental limit of the refs data model
>  (does the reftable backend have the same limitation?), but it could be
>  a good reason to mention that refs are often stored as files, because
>  it makes it obvious that you can't have a file and a directory with
>  the same name.
>  Obviously this is an issue that is affecting people relatively often
>  in practice though so I think it's worth mentioning in some way.
I don’t think the reftable backend has this limitation (?), but it reminded me of another important one: on case-insensitive filesystems you cannot have both « julia » and « JULIA » branches!
This occasionally creates problems where someone cannot fetch/clone what has been pushed.
Anyway: it’s worth mentioning the files for that purpose. It would be nice to improve the UI as you describe below to continue to be able to naturally interrogate Git without needing to know about all the storage formats (recall that cat-file works just fine with packs and MIDXs!). 
Show 47 quoted lines
> Overall: several people suggested mentioning more about where things
> are stored in the `.git` directory, which I just removed.
> 
> I think I want to avoid this (not sure yet), but I'm going to think
> about the underlying motivation for this suggestion and see if it can be
> addressed in a different way.
> 
> Some ideas for what functions discussing the `.git` directory has:
> 
> 1. Like I mentioned above with branches, sometimes the implementation causes
>   some extra constraints like "you can't have branches `julia/ticket`
>   and `julia/ticket/task`". So often people like to know a little
>   about the implementation because it can help predict some of the
>   holes in the abstractions you're using.
> 2. It lets you view the "raw" data, so you can be totally sure about
>   what Git is storing. This is nice because Git's UI can be very
>   inconsistent sometimes, so looking at the raw data gives a sense of
>   certainty about what's actually there.
> 
> I tried to put together a list of ways to look at the "raw" data without
> looking in the `.git` directory. The ways for objects and the index are great,
> but for references and the reflog they involve these pretty complex format
> strings, I'm not confident I've gotten the format strings right and IMO
> they don't inspire a lot of confidence.
> 
> View an object with:
> ----
> git cat-file -p <object-id>
> ----
> 
> View a reference with:
> 
> ----
> git for-each-ref <ref-name> --include-root-refs  --format="%(refname) %(if)%(symref)%(then)%(symref)%(else)%(objectname:short)%(end)"
> ----
> 
> View the index with:
> 
> ----
> git ls-files --stage
> ----
> 
> View the reflog for a reference with:
> 
> ----
> git reflog show <refname> --format="%h | %gd | %gn <%ge> | %gs" --date=iso
> ----
[kept for context]
Previous: Julia Evans
Message 89 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.