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

Re: [RFC/PATCHv10 08/11] Notes API: get_note(): Return the note annotating the given object

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 7, 2009, 20:52 UTC
Message-ID
<7vk4wy1p8d.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1260185254-1523-9-git-send-email-johan@herland.net>
Johan Herland <johan@herland.net> writes:
Show 18 quoted lines
> Created by a simple cleanup and rename of lookup_notes().
>
> Signed-off-by: Johan Herland <johan@herland.net>
> ---
>  notes.c |   15 ++++++++-------
>  notes.h |    3 +++
>  2 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/notes.c b/notes.c
> index 79bfa24..110404a 100644
> --- a/notes.c
> +++ b/notes.c
> @@ -379,12 +379,13 @@ void add_note(const unsigned char *object_sha1, const unsigned char *note_sha1)
>  	note_tree_insert(&root_node, 0, l, PTR_TYPE_NOTE);
>  }
>  
> -static unsigned char *lookup_notes(const unsigned char *object_sha1)
> +const unsigned char *get_note(const unsigned char *object_sha1)

Is there a need to find "note for this commit in the set of notes 3 days ago"? IOW, reading note for the given commit not from the tip of the history of the refs/notes/commits but from say refs/notes/commits~4? Similarly, is there a need to ask for a history of notes for a given commit, something like "git log refs/notes/commit/$this_commit" in a world without any fanout?

Obviously, "there is no need because..." is the best answer I'd be happy with. "There may be in the future but we haven't identified a good use case and we don't implement what we do not need now." is also perfectly acceptable.

IOW, I am not suggesting to change it---I just want to know how much thought went in before deciding to implement the interface this way.

Previous: Johan HerlandNext: Johan Herland
Message 23 of 28 in “[RFC/PATCHv10 00/11] git notes”
  1. Johan HerlandDec 7, 2009
  2. 01/11 fast-import: Proper notes tree manipulationJohan Herland, Dec 7, 2009
  3. Shawn O. PearceDec 7, 2009
  4. Johan HerlandDec 8, 2009
  5. Shawn O. PearceDec 8, 2009
  6. Johan HerlandDec 8, 2009
  7. Johan HerlandDec 10, 2009
  8. Shawn O. PearceDec 10, 2009
  9. Johan HerlandDec 10, 2009
  10. Junio C HamanoDec 11, 2009
  11. Shawn O. PearceDec 7, 2009
  12. Johan HerlandDec 8, 2009
  13. Shawn O. PearceDec 8, 2009
  14. Junio C HamanoDec 7, 2009
  15. Johan HerlandDec 8, 2009
  16. 02/11 Rename t9301 to t9350, to make room for more fast-import testsJohan Herland, Dec 7, 2009
  17. 03/11 Add more testcases to test fast-import of notesJohan Herland, Dec 7, 2009
  18. 04/11 Minor style fixes to notes.cJohan Herland, Dec 7, 2009
  19. 05/11 Notes API: get_commit_notes() -> format_note() + remove the commit restrictionJohan Herland, Dec 7, 2009
  20. 06/11 Notes API: init_notes(): Initialize the notes tree from the given notes refJohan Herland, Dec 7, 2009
  21. 07/11 Notes API: add_note(): Add note objects to the internal notes tree structureJohan Herland, Dec 7, 2009
  22. 08/11 Notes API: get_note(): Return the note annotating the given objectJohan Herland, Dec 7, 2009
  23. Junio C HamanoDec 7, 2009
  24. Johan HerlandDec 8, 2009
  25. 09/11 Notes API: for_each_note(): Traverse the entire notes tree with a callbackJohan Herland, Dec 7, 2009
  26. 10/11 Notes API: Allow multiple concurrent notes trees with new struct notes_treeJohan Herland, Dec 7, 2009
  27. 11/11 Refactor notes concatenation into a flexible interface for combining notesJohan Herland, Dec 7, 2009
  28. Junio C HamanoDec 8, 2009

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.