Nested collab refs are invisible to the obvious git for-each-ref pattern #89
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The patch layout nests refs —
refs/collab/patches/<id>/eventsand<id>/rev/<oid>— and the natural command to inspect them silently returns nothing:for-each-refglobs do not cross/, sorefs/collab/*matches nothing below the first level, andrefs/collab/patches/<id>*does not match<id>/events. There is no error — the empty result looks like an empty answer.The asymmetry is what makes it a footgun rather than ordinary git trivia: git2's
references_glob, which git-collab uses internally, does cross/, and the revision-refs design depends on that (it is whysync'srefs/collab/patches/*refspec carries the whole subtree). So the same-looking pattern behaves differently on either side of the library boundary. Someone readingrefs/collab/*in the README and reaching forfor-each-refgets silence.Hit twice in one session while working on this repo: once auditing local ref shapes, and once in a ref-deletion command that reported success while deleting nothing — the loop matched zero refs and the summary count was computed with a different pattern that did match, so it printed
remaining: 2after claiming to delete.Wanted, in rough order of value:
for-each-ref refs/collab(no glob) orrefs/collab/**is the way to enumerate them. The layout is documented; the way to look at it is not.git-collabshould expose the enumeration itself —git-collab refsor similar — so operators are not writing raw git patterns against an internal layout at all. It already knows how to walk them correctly.Not a code bug: nothing in the repo's own docs or messages suggests the failing pattern. This is about what a user will reach for unaided.
Migrated from git-collab issue
604b5de4f9c51a054a4bf57b4b1db9c169b3fbef.Original author: a73x dev@a73x.sh.
Close reason: merged in patch
e55d15a2