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

Re: Problem: git Notes not discoverable (+proposed solutions)

From
Jacob Keller <jacob.keller@gmail.com>
Date
Sep 4, 2024, 20:03 UTC
Message-ID
<CA+P7+xop8OY18nQaREFk6LeDdnn53oSGnigN-ddSHAU7mAMO8g@mail.gmail.com>
In-Reply-To
<m0wmjto8aq.fsf@epic96565.epic.com>
On Mon, Sep 2, 2024 at 6:06 PM Sean Allred <allred.sean@gmail.com> wrote:
>
> I agree that git-notes is an under-utilized idea. There's a lot of
> potential to add context where it matters.
>
I also agree with this.
Show 32 quoted lines
> sideshowbarker <mike@w3.org> writes:
> > I’d be 100% happy to do the work of writing a patch to implement a solution
> > (a git behavior change) for this — if I could get confirmation that the git
> > maintainers would actually be open to reviewing such a patch.
>
> Best way to determine that in my experience is to just propose some kind
> of patch -- especially if the actual change is simple even if
> controversial.
>
> > As far as what the change would be: I realize this has been brought up
> > before — but it seems the obvious solutions are to “just” change git so:
> >
> > - Proposed solution #1: git auto-fetches all Notes when a repo is first cloned,
> >   and then auto re-fetches them again for every “git fetch” or“git pull”.
> >
> >   I think that auto-fetching-of-Notes would ideally be the _default_ git
> >   behavior — but short of that, at least a new [notes] _option_ for enabling
> >   that behavior would help. That would seem somewhat more “approachable” to
> >   than “git config --add remote.origin.fetch '+refs/notes/*:refs/notes/*'”.
>
> This would certainly be the most turnkey approach -- but what could go
> wrong here? I can think of at least one potential danger: that your own
> notes would be wiped out on fetch if you don't remember to push them
> first. Laying out the risks involved with each approach would help the
> conversation by showing the effort you've put into the design.
>
> It's my understanding that the git-notes feature is considered a little
> under-baked to 'turn on' more broadly like this. There are simply too
> many sharp edges:
>
> - the 'push before fetch' footgun I mentioned above
> - merge conflict resolution workflow for the notes themselves

I had use cases involving notes in the past and this was the biggest dealbreaker. There is not standardized way to fetch notes in such a way that you can perform conflict resolution.

This sort of fits into a bigger problem in that any non-branch refs don't have the equivalent "refs/remotes/<blah>" area to fetch into for comparison, but changing refs/remotes is a big backwards compatibility issue. I considered in the past to add things like refs/remote-notes/, but that also ended up not going very far.

I would love to see some of these problems solved, but unfortunately have not had motivation or time to work on them, as we ended up not using notes. The problems are quite tricky to find suitable solutions and get folks to agree.

Previous: Sean AllredNext: Junio C Hamano
Message 3 of 7 in “Problem: git Notes not discoverable (+proposed solutions)”
  1. sideshowbarkerJul 23, 2024
  2. Sean AllredSep 3, 2024
  3. Jacob KellerSep 4, 2024
  4. Junio C HamanoSep 3, 2024
  5. Michal SuchánekSep 4, 2024
  6. Junio C HamanoSep 4, 2024
  7. Kristoffer HaugsbakkSep 4, 2024

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.