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

Git Notes idea.

From
GSGovind Salinas <govind@sophiasuchtig.com>
Date
Dec 16, 2008, 08:15 UTC
Message-ID
<5d46db230812160015t55b4ff2fubbf1e2f826a97b98@mail.gmail.com>
Hi All,

I was thinking about possible ideas for my little pet project and I had and idea for way to tack on notes to a commit, or any object really. I know that the idea has been flying around for a long time but there has never been any implementation or a concept that people liked enough to use (unless I have missed something).

Here is my idea.

.git/refs/notes contains a tree-id (assuming that using a tree-id will not cause any problems, otherwise a commit object can be used. it does not *need* a history, but it *could* have one).

That tree has a structure similar to the layout of .git/objects, where it is 2 letter subdirectories for the notes objects.

Given a git object (commit, tree, blob, tag), use its sha as the
path/filename in this tree.
    If I have a commit 1234567890123456789012345678901234567890 then
the notes tree will have a file
12/34567890123456789012345678901234567890

That file has a list of sha1s (one per line). These shas are object IDs for blobs that have the notes or whatever that you want attached to the item.

I think you get the idea. When looking up an item, it should be fairly easy to have the notes tree and subtrees available for doing lookups. And as far as I know stuff under .git/refs can be pushed/pulled even if its not under heads or remotes or tags using already existing machinery. I am not sure, but I think that would satisfy gc operations as well. Also, these trees and blobs never have to be put in the working directory.

Does this sound like something that is workable? I thought it might appeal since it uses only features that are already present.

This could be extended so that you have different sets of notes under .git/refs/notes/<my note set> or whatever. So that you can have some notes you keep private and some that you publish or whatever.

OK, hopefully this isn't a off the wall, thats-what-you-get-for-being-up-at-2-AM idea.

Thanks, Govind.

Next: Jeff King
Message 1 of 41 in “Git Notes idea.”
  1. Govind SalinasDec 16, 2008
  2. Jeff KingDec 16, 2008
  3. Jeff KingDec 16, 2008
  4. Govind SalinasDec 16, 2008
  5. Johannes SchindelinDec 16, 2008
  6. Jeff KingDec 17, 2008
  7. Petr BaudisDec 17, 2008
  8. Jeff KingDec 17, 2008
  9. Govind SalinasDec 17, 2008
  10. Jeff KingDec 18, 2008
  11. rebasing commits that have notes, was Re: Git Notes idea.Johannes Schindelin, Dec 17, 2008
  12. Johan HerlandDec 17, 2008
  13. Stephan BeyerDec 17, 2008
  14. 0/4 Notes reloadedJohannes Schindelin, Dec 19, 2008
  15. 1/4 Introduce commit notesJohannes Schindelin, Dec 19, 2008
  16. Jeff KingDec 20, 2008
  17. Robin RosenbergDec 20, 2008
  18. Jeff KingDec 20, 2008
  19. Junio C HamanoDec 20, 2008
  20. Jeff KingDec 20, 2008
  21. Junio C HamanoDec 20, 2008
  22. 0/4 Notes, reloadedJohannes Schindelin, Dec 20, 2008
  23. 1/4 Introduce commit notesJohannes Schindelin, Dec 20, 2008
  24. 2/4 Add a script to edit/inspect notesJohannes Schindelin, Dec 20, 2008
  25. 3/4 Speed up git notes lookupJohannes Schindelin, Dec 20, 2008
  26. 4/4 Add an expensive test for git-notesJohannes Schindelin, Dec 20, 2008
  27. 2/4 Add a script to edit/inspect notesJohannes Schindelin, Dec 19, 2008
  28. 3/4 Speed up git notes lookupJohannes Schindelin, Dec 19, 2008
  29. 4/4 Add an expensive test for git-notesJohannes Schindelin, Dec 19, 2008
  30. Boyd Stephen Smith Jr.Dec 19, 2008
  31. Johannes SchindelinDec 20, 2008
  32. Jeff KingDec 17, 2008
  33. Johannes SchindelinDec 17, 2008
  34. Junio C HamanoDec 17, 2008
  35. Johannes SchindelinDec 18, 2008
  36. Govind SalinasDec 19, 2008
  37. Govind SalinasDec 19, 2008
  38. Govind SalinasDec 19, 2008
  39. Jeff KingDec 19, 2008
  40. Govind SalinasDec 19, 2008
  41. Jeff KingDec 20, 2008

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.