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

Re: [git patches] libata updates, GPG signed (but see admin notes)

From
Johan Herland <johan@herland.net>
Date
Nov 11, 2011, 01:17 UTC
Message-ID
<CALKQrgcJmPHZG0bbgwoH6_htQODYVJtXYyHgSb_7qRKkJkb2Yw@mail.gmail.com>
In-Reply-To
<7v39dvuca4.fsf@alter.siamese.dyndns.org>
On Thu, Nov 10, 2011 at 18:18, Junio C Hamano <junio@pobox.com> wrote:
Show 19 quoted lines
> Johan Herland <johan@herland.net> writes:
>
>> What about having one notes ref per branch? If/when the branch is merged,
>> the associated notes ref containing the annotations for the commits on that
>> branch would be merged as well (using "git notes merge").
>
> That is a crude workaround that you could (with help from users) make it
> work, but it does not change the fact that the current mechanism to
> transfer and integrate notes across repositories is a bad match for what
> the "signed commit" type annotations wants to achieve. In fact, the need
> for such a workaround is an illustration of how bad a match the mechanism
> is.
>
> When you merge a history that has commit A into another history that did
> not have that commit, the act of creating a merge commit itself should be
> enough to make the resulting history to contain that commit. The commit
> DAG already expresses it, and if a parallel "notes" mechanism needs to be
> futzed with to match that DAG, and command like "merge" needs to be told
> to help that process, that is a shortcoming of the "notes" mechanism.
[ ...and from elsewhere in this thread: ]
Show 10 quoted lines
> Note that in this thread, I am not saying that "git notes" mechanism is
> not good for anything. A tree whose node names encode an object name is a
> valid way to store the mapping from that object to a set of other objects,
> and we already agreed that as the "local" storage mechanism, "git notes"
> may be used as-is for the purpose of this thread.
>
> But the transfer and merge semantics "git notes" mechanism offers treats
> the entire "notes" that appear in _one_ repository and merging that set to
> the entire "notes" in another repository and it is not a good match for
> the purpose of this thread.
Ok. Point taken.

Given that we need an alternative way to transfer annotations between repos (using auto-follow to select the relevant set of annotations, and then transferring only those annotations): Can we leverage existing functionality in "notes" where useful (e.g. using existing notes merge strategies to deal with colliding annotations), while at the same time extending the current "notes" feature with this alternative transfer mechanism? FWIW, I expect there are other "notes" use cases that would also prefer the auto-follow only-relevant transfer behavior.

So, how can we use "notes" to better support the transfer semantics you suggest? The mapping from the object being annotated to the annotation object is already contained in the notes tree, but the "timestamp" you describe (needed to efficiently calculate the set of annotations to auto-follow) is not [1]. However, we could easily enough add a sorted list of (timestamp, annotated object name) pairs, to allow fast lookup of annotations created after a given timestamp. We could even store this list in a blob or tree object referenced directly from the notes tree [2].

Have fun! :)
...Johan

[1]: Although I did at some point experiment with using timestamps in the internal organization of the notes tree (see for example http://article.gmane.org/gmane.comp.version-control.git/127966 ), I ended up using only the annotated object name (with flexible fanout). I don't think that reintroducing timestamps in the notes tree organization will pay off, because we need both lookup by annotated SHA1 and lookup by newer-than-given-timestamp to be fast, and there's AFAIK no way to get both from a single notes tree organzation.

[2]: E.g. accessible with "git cat-file refs/notes/foo:timestamps". When a notes tree contains an entry that is obviously not an object name (SHA1), the notes code will leave it alone/untouched in the tree (see "struct non_note" and associated code in notes.c for further details).

-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Junio C HamanoNext: Junio C Hamano
Message 65 of 81 in “Re: [git patches] libata updates, GPG signed (but see admin notes)”
  1. Ingo MolnarOct 31, 2011
  2. Junio C HamanoOct 31, 2011
  3. Ingo MolnarOct 31, 2011
  4. Junio C HamanoOct 31, 2011
  5. Ted Ts'oOct 31, 2011
  6. Junio C HamanoOct 31, 2011
  7. Linus TorvaldsOct 31, 2011
  8. H. Peter AnvinOct 31, 2011
  9. Linus TorvaldsOct 31, 2011
  10. H. Peter AnvinOct 31, 2011
  11. Linus TorvaldsOct 31, 2011
  12. Junio C HamanoOct 31, 2011
  13. Linus TorvaldsOct 31, 2011
  14. Ingo MolnarNov 2, 2011
  15. Jochen StriepeNov 2, 2011
  16. Junio C HamanoOct 31, 2011
  17. Junio C HamanoOct 31, 2011
  18. H. Peter AnvinOct 31, 2011
  19. Ted Ts'oOct 31, 2011
  20. H. Peter AnvinOct 31, 2011
  21. Linus TorvaldsOct 31, 2011
  22. H. Peter AnvinOct 31, 2011
  23. Linus TorvaldsOct 31, 2011
  24. James BottomleyNov 1, 2011
  25. Jeff GarzikOct 31, 2011
  26. H. Peter AnvinNov 1, 2011
  27. Jiri KosinaOct 31, 2011
  28. Junio C HamanoNov 1, 2011
  29. Linus TorvaldsNov 1, 2011
  30. Junio C HamanoNov 1, 2011
  31. Linus TorvaldsNov 2, 2011
  32. Junio C HamanoNov 2, 2011
  33. Shawn PearceNov 3, 2011
  34. Linus TorvaldsNov 3, 2011
  35. Linus TorvaldsNov 3, 2011
  36. Shawn PearceNov 3, 2011
  37. Linus TorvaldsNov 3, 2011
  38. Jochen StriepeNov 3, 2011
  39. Linus TorvaldsNov 3, 2011
  40. David WoodhouseNov 10, 2011
  41. Marc BranchaudNov 10, 2011
  42. Linus TorvaldsNov 3, 2011
  43. Linus TorvaldsNov 3, 2011
  44. Junio C HamanoNov 4, 2011
  45. Junio C HamanoNov 4, 2011
  46. Linus TorvaldsNov 4, 2011
  47. Jeff KingNov 5, 2011
  48. Junio C HamanoNov 5, 2011
  49. Junio C HamanoNov 3, 2011
  50. Junio C HamanoNov 3, 2011
  51. Linus TorvaldsNov 3, 2011
  52. Ted Ts'oNov 4, 2011
  53. Linus TorvaldsNov 4, 2011
  54. valdis.kletnieks@vt.eduNov 7, 2011
  55. Linus TorvaldsNov 7, 2011
  56. Junio C HamanoNov 5, 2011
  57. Linus TorvaldsNov 5, 2011
  58. Junio C HamanoNov 5, 2011
  59. Linus TorvaldsNov 6, 2011
  60. Junio C HamanoNov 9, 2011
  61. Johan HerlandNov 10, 2011
  62. Junio C HamanoNov 10, 2011
  63. Johan HerlandNov 10, 2011
  64. Junio C HamanoNov 10, 2011
  65. Johan HerlandNov 11, 2011
  66. Junio C HamanoNov 11, 2011
  67. Junio C HamanoNov 10, 2011
  68. Linus TorvaldsNov 3, 2011
  69. Junio C HamanoNov 4, 2011
  70. Linus TorvaldsNov 4, 2011
  71. Jeff KingNov 3, 2011
  72. Robin H. JohnsonNov 3, 2011
  73. Junio C HamanoNov 3, 2011
  74. Ted Ts'oNov 1, 2011
  75. Junio C HamanoNov 2, 2011
  76. david@lang.hmNov 2, 2011
  77. Linus TorvaldsNov 2, 2011
  78. David WoodhouseNov 10, 2011
  79. Michael J GruberNov 2, 2011
  80. Junio C HamanoNov 2, 2011
  81. Michael J GruberNov 2, 2011

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.