Hi Kristoffer, On Fri, Nov 20, 2026 at 9:25 AM Kristoffer Haugsbakk <kris…@fastmail.com> wrote:
> I don’t use multiple computers right now. But I do have both private and > public Git notes. In the work repository I have this > > [remote "o"] > [...] > # NOTE “tracking” idea came from the Git mailing list > # NOTE We cannot use a negative refspec to exclude branch things here > # (what I wanted) because neg. refspecs cannot have > # the destination part > fetch = +refs/*:refs/tracking/o/refs/* > > This is from some email thread(s) about using a namespace for tracking > all remote refs instead of just branches. Now I have the state of the > remote notes in case there is a divergence.
Thanks, that's a neat idea. I think where I overcomplicate by trying to simplifying is fetching the remote notes into the same local ref that I write notes to ':D
> > The "usual" stuff to make my notes important, but still show amlog > > notes when browsing history. (The origin remote section is in addition > > to the normal remote section with it's url and heads->origin/ > > mapping.) > > > > [remote] > > pushDefault = benknoble > > > > Push to my remote. > > > > [remote "benknoble"] > > fetch = refs/notes/*:refs/notes/benknoble/* > > push = refs/heads/*:refs/heads/* > > push = refs/notes/benknoble/*:refs/notes/* > > push = ^refs/notes/origin/amlog > > > > In addition to the usual config added by "git remote add", fetch > > remote notes into a local hierarchy, and push them out, but ignore > > amlog, and don't forget to also be able to push heads. Without the > > heads map, "git push" will not push branches! > > > > Now, maybe I'm holding something in a way it wasn't intended and > > that's made my life harder, I dunno.
> > I haven’t tried the above but it doesn’t look like you have made it > harder for yourself than you need to, considering your needs. ;)
What's painful is the extra reconfiguration of the push spec, hence my interest in refmaps :) If we omit the heads map, *bare* "git push" won't push a branch (but being explicit still works). With it, bare "git push" works a bit like push.default=matching, which is *also* not what I want :/ I usually want to push the current branch (push.default=current) + my notes. In most cases, there's no harm done, but I end up having to be more explicit than usual. With a refmap for pushes, I imagine I could say "when pushing, here's how to rewrite" without having to spell out what the default push refspec is manually---I might need some additional support to say "push notes in *addition* to the push.default stuff", but it would get me closer, I think.
> > When "git fetch" > > fails to fetch notes because of divergence with local, I end up saying > > > > git fetch benknoble refs/notes/commits > > git range-diff refs/notes/benknoble/commits...FETCH_HEAD > > git notes merge FETCH_HEAD > > > > or something. > > > > It's *almost* like we need remote-tracking branches for notes, ahaha… > > at that point, Scott's git-meta work becomes possibly more appealing > > to me, even if a part of me wants to "fix" notes so everyone can use > > them easily.
> > I don’t know what git-meta is.
https://git-meta.com/ [LLM warning]
> But in any case, I haven’t seen a > forcing-use case for making Notes simpler to use. Right now they are > okay-enough for the simple needs that I have seen, which is > single-author (program or person) or automatic-merge (git-appraise(1) > uses json-lines so that cat-sort-uniq merge strategy works). > > But imagine some kind of collaborative Notes usage, like multiple people > posting commentaries on commits. In that case one would need better > tooling, for sure. But collaborative metadata on commits is a bit like > the ideas like “history of history”.[1] It’s probably not going to > happen. > > [1] https://lwn.net/Articles/914041/
I think git-meta is intended for collaboration to be possible. My case is actually the single-author case, repeated: I'm interested in multiple author's notes but keep them separate. I read both but only write one :)
-- D. Ben Knoble