docs(bin): state main as the default-branch convention, master as legacy fallback - #2697
Open
patrick-j-vera wants to merge 1 commit into
Open
docs(bin): state main as the default-branch convention, master as legacy fallback#2697patrick-j-vera wants to merge 1 commit into
patrick-j-vera wants to merge 1 commit into
Conversation
All repos use 'main' as the default branch moving forward; the resolver machinery already prefers main with master as a fallback. Reword the default-branch error messages, the fm-tangle-lib comment, and the architecture doc so main is stated as the primary convention and master is the accepted legacy fallback. No behavior change.
Owner
|
Speaking as Kun's firstmate: Reviewed the full diff. This only rewords comments and architecture docs: resolvers still prefer origin/HEAD, then local main, then legacy master. No default-branch behavior change. I approved fork CI. Waiting on green checks including no-mistakes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
The captain changed the fleet's branch convention: moving forward, all repos use 'main' as the default branch instead of 'master'. They asked to update the internal docs as needed. The firstmate repo itself is already on main (local checkout, remote HEAD, and CI workflows all use main), and every default-branch resolver already prefers main first with master as a legacy fallback (for branch in main master). The change rewords the five spots that still named 'master' as an equal alternative so the docs, comments, and error messages state main as the primary convention and master as an accepted legacy fallback: the cannot-determine-default-branch error messages in bin/fm-teardown.sh, bin/fm-review-diff.sh, and bin/fm-merge-local.sh now read 'expected origin/HEAD, or a local main (legacy master also accepted)'; the fm-tangle-lib.sh comment says 'local main (legacy master as a secondary fallback)'; docs/architecture.md says 'local main (legacy master as a secondary fallback)'. The resolver loops themselves are unchanged - they already resolve main first. No behavior change; pure message/comment/documentation wording.
What Changed
bin/fm-teardown.sh,bin/fm-review-diff.sh, andbin/fm-merge-local.shto read "expected origin/HEAD, or a local main (legacy master also accepted)".bin/fm-tangle-lib.shand the matching passage indocs/architecture.mdto describemainas the primary local fallback withmasteras a legacy secondary fallback.mainfirst; only message/comment/documentation wording was adjusted.Risk Assessment
✅ Low: The change is a five-line, non-functional rewording of error messages, a comment, and a doc line that accurately matches the unchanged resolver behavior and the stated intent, with no test or behavior impact.
Testing
Exercised the real end-user error paths: triggered the cannot-determine-default-branch failure in bin/fm-review-diff.sh, bin/fm-merge-local.sh, and bin/fm-teardown.sh against sandbox repos with no resolvable default branch and confirmed each emits the exact new wording; confirmed the fm_default_branch resolver behavior is unchanged (main first, master legacy fallback, origin/HEAD priority, failure rc=1); confirmed docs/architecture.md renders the new sentence; confirmed no equal-alternative 'main or master' wording remains and no tests assert the old messages; existing tangle-guard suite passes 6/6. This is a pure message/comment/doc wording change with no behavior delta, and all evidence is captured in CLI transcripts.
Evidence: End-to-end transcript: new default-branch error wording from all three scripts
### bin/fm-review-diff.sh t1 error: cannot determine default branch for /tmp/fm-sandbox-01M0GHAZR/proj; expected origin/HEAD, or a local main (legacy master also accepted) exit=1 ### bin/fm-merge-local.sh t2 error: cannot determine default branch for /tmp/fm-sandbox-01M0GHAZR/proj; expected origin/HEAD, or a local main (legacy master also accepted) exit=1 ### bin/fm-teardown.sh t3 (worktree with unlanded commits, local-only mode) REFUSED: cannot determine default branch for /tmp/fm-sandbox-01M0GHAZR/proj3; expected origin/HEAD, or a local main (legacy master also accepted). exit=1Evidence: Resolver behavior unchanged (main first, master legacy fallback)
repo with main+master, no origin/HEAD -> main (expect main) repo with origin/HEAD=master, main exists -> master (expect master, origin/HEAD wins) repo with only master (legacy fallback) -> master (expect master) repo with neither main nor master -> rc=1 (expect non-zero)Evidence: docs/architecture.md rendered wording
fm-tangle-lib.shresolves the default branch fromorigin/HEAD, then localmain(legacymasteras a secondary fallback), and classifies that named non-default primary branch as the tangle.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
Ranbin/fm-review-diff.sh t1(FM_GATE_REFUSE_BYPASS=1, sandbox FM_HOME/FM_STATE_OVERRIDE) against a project with only fm/* branches, no origin/HEAD/main/master -> new error wording, exit 1Ranbin/fm-merge-local.sh t2with mode=local-only meta and existing fm/t2 branch in the no-default-branch project -> new error wording, exit 1Ranbin/fm-teardown.sh t3with local-only meta and a worktree holding unlanded commits in a no-default-branch project -> new REFUSED wording, exit 1Sourced. bin/fm-tangle-lib.shand exercisedfm_default_branch: main+master->main, origin/HEAD=master with local main->master, master-only->master, neither->rc=1 (resolver unchanged)Ranbash tests/fm-tangle-guard.test.sh-> 6/6 ok (resolver regression sanity)Grepped repo: no remaining 'main, or master' / 'main or master' / 'local main/master' equal-alternative phrasing; new 'legacy master' phrasing present in exactly the five intended spots;grep -rln 'cannot determine default branch' tests/finds no test asserting the old messagesRead docs/architecture.md section context to confirm rendered sentence: 'resolves the default branch from origin/HEAD, then local main (legacy master as a secondary fallback)'✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.