git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Vegard Nossum <vegard.nossum@oracle.com>
Cc: git@vger.kernel.org, Johan Herland <johan@herland.net>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Christian Hesse <mail@eworm.de>
Subject: Re: [RFC PATCH 1/2] notes: support fetching notes from an external repo
Date: Tue, 02 Aug 2022 08:40:19 -0700	[thread overview]
Message-ID: <xmqqczdiirh8.fsf@gitster.g> (raw)
In-Reply-To: <20220802075401.2393-1-vegard.nossum@oracle.com> (Vegard Nossum's message of "Tue, 2 Aug 2022 09:54:00 +0200")

Vegard Nossum <vegard.nossum@oracle.com> writes:

> 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.

  parent reply	other threads:[~2022-08-02 15:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02  7:54 [RFC PATCH 1/2] notes: support fetching notes from an external repo Vegard Nossum
2022-08-02  7:54 ` [RFC PATCH 2/2] notes: create interface to iterate over notes for a given oid Vegard Nossum
2022-08-02 15:40 ` Junio C Hamano [this message]
2022-08-03  8:09   ` [RFC PATCH 1/2] notes: support fetching notes from an external repo Vegard Nossum
2022-08-03 22:32     ` Junio C Hamano
2022-08-30 14:17 ` Philip Oakley
2022-10-17 13:14   ` Vegard Nossum
2022-10-19  9:15     ` Philip Oakley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqczdiirh8.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=Jason@zx2c4.com \
    --cc=git@vger.kernel.org \
    --cc=johan@herland.net \
    --cc=mail@eworm.de \
    --cc=vegard.nossum@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).