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

Re: Git Notes idea.

From
Jeff King <peff@peff.net>
Date
Dec 19, 2008, 21:25 UTC
Message-ID
<20081219212536.GA27168@coredump.intra.peff.net>
In-Reply-To
<5d46db230812190938r4e8ff994gfcb616c750be0f22@mail.gmail.com>
On Fri, Dec 19, 2008 at 11:38:55AM -0600, Govind Salinas wrote:
Show 15 quoted lines
> This is my concern with keeping a history of the notes pseudo-branch.  Let
> me restate what you are saying with an example
> 
> 1) on branch A commit a
> 2) add note a`
> 3) on branch B commit b
> 4) add note b`
> 5) on branch B commit c
> 6) add note c`
> 7) delete branch A
> 8) gc after a time such that a is pruned
> 
> Now either I will always have a note a` as an object forever even though
> the only commit that points to it is gone or I have to re-write the history of
> the notes branch from the point that it was added.
Yes, that's correct.
> Given this problem, is it really such a good idea to keep the history?

I think so. Otherwise how will you push and pull notes? You won't even know which one is the more recent tree, let alone handle any merges caused by editing notes in two places.

> On the other, other hand, pushing and pulling notes if a history is kept
> will have to involve a lot of rebasing/merging.

Depending on your workflow. It might just involve a lot of fast forwards if the note writer is in one place.

Show 5 quoted lines
> A possible solution is that notes are per-branch,
> 
> refs/notes/heads/master
> refs/notes/heads/foo/bar
> refs/notes/remotes/baz/bang

Sorry, I don't quite get it. You are asking for per-branch notes that keep history, or per-branch notes that don't keep history?

If the former, then you haven't solved the cruft accumulation problem. You can get obsolete notes in your note history by rebasing on a branch that is long-running (which is OK as long as you haven't published _those particular_ commits). Or are you proposing to rebase and cleanup the notes history every time you do a destructive operation?

If the latter, then I don't see how you've solved the push-pull and merge problem (which you need history for).

But in either case, I think the solution is non-intuitive. If I annotate a commit, and then merge the commit from one branch to another, shouldn't the annotation stay?

Really, I am not sure this is worth getting too concerned about. Since we are talking about cruft in the _history_ of the notes branch, it won't impact actual notes usage (which will always just deal with the most recent tree). So really we are talking about some uninteresting objects in the db, which wastes some space. In practice, I suspect this won't be that large because notes themselves are going to be relatively short and in many cases, repetitive (i.e., many annotations may have the same blob hash for several commits). And if it is a space problem, then the right solution is to periodically truncate the notes history by rewriting.

-Peff
Previous: Govind SalinasNext: Govind Salinas
Message 39 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.