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

Re: [RFC PATCH 1/2] notes: support fetching notes from an external repo

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 2, 2022, 15:40 UTC
Message-ID
<xmqqczdiirh8.fsf@gitster.g>
In-Reply-To
<20220802075401.2393-1-vegard.nossum@oracle.com>
Vegard Nossum <vegard.nossum@oracle.com> writes:
Show 7 quoted lines
> Notes are currently always fetched from the current repo. However, in
> certain situations you may want to keep notes in a separate repository
> altogether.
>
> In my specific case, I am using cgit to display notes for repositories
> that are owned by others but hosted on a shared machine, so I cannot
> really add the notes directly to their repositories.

My gut reaction is that I am not interested at all in the above approach, even though the problem you are trying to solve is interesting. Mostly because notes are not the only decorations your users may want. What if you want to "log --decorate" their repository contents with your own tags that annotate their commits? A notes-only approach to mix repositories is way too narrow.

A usable alternative _might_ be to introduce a way to "borrow" refs and objects from a different repository as if you cloned from and continuously fetching from them. We already have a mechanism to borrow objects from another repository in the form of "alternate object database" that lets us pretend objects in their repository are locally available. We can invent a similar mechanism that lets any of their ref as if it were our local ref, e.g. their "main" branch at their refs/heads/main might appear to exist at our refs/borrowed/X/heads/main.

Once the mechanism for doing so is in place, setting up such a parasite repository might be

    $ git clone --local-parasite=X /path/to/theirs mine

which would create an empty repository 'mine' that uses /path/to/theirs/.git/objects as one of its alternate object store, and their refs are borrowed under our refs/borrowed/X/.

Then you can tell your cgit to show refs/borrowed/X/{heads,tags} hierarchies as if they are the branches and tags, and use your own refs/notes/ hiearchy to store whatever notes they do not let you store in theirs.

Previous: Vegard NossumNext: Vegard Nossum
Message 3 of 8 in “notes: support fetching notes from an external repo”
  1. 1/2 notes: support fetching notes from an external repoVegard Nossum, Aug 2, 2022
  2. 2/2 notes: create interface to iterate over notes for a given oidVegard Nossum, Aug 2, 2022
  3. Junio C HamanoAug 2, 2022
  4. Vegard NossumAug 3, 2022
  5. Junio C HamanoAug 3, 2022
  6. Philip OakleyAug 30, 2022
  7. Vegard NossumOct 17, 2022
  8. Philip OakleyOct 19, 2022

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.