Warn that submodule pins go backwards silently on merge #25
Loading…
Reference in a new issue
No description provided.
Delete branch "docs/submodule-pin-regression-on-merge"
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?
A long-lived branch drags every submodule pin back to where it forked, and the merge does not conflict. Nothing on the branch touched the gitlink, so from git's point of view only one side moved — and a 3-way merge takes the side that moved. That side is the branch's, which is older.
Nothing in
VCS.mdwarned about this. The only prior mention of submodules was the[skip ci]classification bullet ("a submodule bump is code"), which answers a different question entirely.What prompted it
A merge of a long-lived feature branch into
Grey.ooo/Someones.Computerreverted four gitlinks at once, bundled in with an unrelated test-coverage change:.claude/agent-standardsf917d8dfc64628agent473efd124853cbscclient9d955d9e905eeatrayee8b7761f5b885For this repo specifically, that un-shipped #22 (tea CI-status parsing pitfalls and idle-friendly loop polling) and #23 (the concise-recap Stop hook) for every consumer, and nobody noticed for hours. It survived review because a gitlink renders as a single opaque
-Subproject commit/+Subproject commitpair — no dates, no subjects, no ordering — so a reviewer reading a PR about coverage has no reason to resolve those hashes.It was eventually caught only because a different PR happened to be resolving submodule conflicts in the same area and noticed the merge base disagreeing with
main.What this adds
A
### Submodule pins go backwards silentlysection under Branching, covering:git diff --name-only <base> HEAD -- <submodule path>.git -C <submodule> merge-base --is-ancestor <old> <new>. Eyeballing two hashes cannot tell you which is newer; this can.--ours/--theirsis almost always wrong, since each silently reverts one side; and a pin move never belongs bundled with an unrelated change, because it is invisible in review and unattributable afterwards.Cross-referenced from the before-you-commit checklist and the quick reference, so it is reachable from the two places someone is actually looking when it matters.
Verification
Docs-only — one file,
docs/Topics/VCS.md, 52 insertions, no deletions. This repo ships no markdownlint config and no CI workflows, so there is no automated gate to run; checked by hand instead: both new code fences carry abashlanguage, the new#submodule-pins-go-backwards-silentlyanchor matches its heading exactly, and every new table row has balanced delimiters.Opened ready rather than draft, per Pure-docs PRs skip the draft.
Related
The consuming repo's own regression is being fixed separately in Someones.Computer#680, which moves
.claude/agent-standardsforward to this repo's current tip. That PR carries the pointer bump; this one carries the prose — the two-PR split this file already prescribes.