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

What is an efficient way to get all blobs / trees that have notes attached?

From
Sebastian Schuberth <sschuberth@gmail.com>
Date
Apr 1, 2016, 10:51 UTC
Message-ID
<ndljs8$vj3$1@ger.gmane.org>
Hi,

I'm curious whether there's a more efficient way to get a list of blobs / trees (and their names) that have notes attached than doing this:

1) Get all notes refs I'm interested in (git-for-each-ref).
2) For each notes ref, get the list of notes (git-notes list) and store 
them in a hash table that maps object hashes to notes.
3) Recursively list all blobs / trees (git-ls-tree) and look whether an 
object's hash is conatined in our table to get its notes.

In particular 3) could be expensive for repos with a lot of files as we're looking at all of them just to see whether they have notes attached.

Regards, Sebastian

Next: Johan Herland
Message 1 of 5 in “What is an efficient way to get all blobs / trees that have notes attached?”
  1. Sebastian SchuberthApr 1, 2016
  2. Johan HerlandApr 1, 2016
  3. Johan HerlandApr 1, 2016
  4. Sebastian SchuberthApr 4, 2016
  5. Johan HerlandApr 4, 2016

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.