On Mon, Sep 2, 2024 at 6:06 PM Sean Allred <allred.sean@xxxxxxxxx> 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. > sideshowbarker <mike@xxxxxx> 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.