From 38d426dfd981d6392f7e2b97f42ef56ce0a08171 Mon Sep 17 00:00:00 2001 From: firstmate Date: Thu, 20 Aug 2026 17:30:45 -0400 Subject: [PATCH] docs: state main as the default-branch convention, master as legacy 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. --- bin/fm-merge-local.sh | 2 +- bin/fm-review-diff.sh | 2 +- bin/fm-tangle-lib.sh | 2 +- bin/fm-teardown.sh | 2 +- docs/architecture.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/fm-merge-local.sh b/bin/fm-merge-local.sh index fdc8011488..b6ac888050 100755 --- a/bin/fm-merge-local.sh +++ b/bin/fm-merge-local.sh @@ -44,7 +44,7 @@ default_branch() { BRANCH="fm/$ID" git -C "$PROJ" rev-parse --verify --quiet "refs/heads/$BRANCH" >/dev/null || { echo "error: branch $BRANCH does not exist in $PROJ" >&2; exit 1; } -DEFAULT=$(default_branch) || { echo "error: cannot determine default branch for $PROJ; expected origin/HEAD, main, or master" >&2; exit 1; } +DEFAULT=$(default_branch) || { echo "error: cannot determine default branch for $PROJ; expected origin/HEAD, or a local main (legacy master also accepted)" >&2; exit 1; } # The project's main checkout must be on its default branch and clean, so the # fast-forward lands predictably (firstmate never writes here otherwise). diff --git a/bin/fm-review-diff.sh b/bin/fm-review-diff.sh index 06e0efb5bd..b081300a90 100755 --- a/bin/fm-review-diff.sh +++ b/bin/fm-review-diff.sh @@ -65,7 +65,7 @@ default_branch() { return 1 } -DEFAULT=$(default_branch) || { echo "error: cannot determine default branch for $PROJ; expected origin/HEAD, main, or master" >&2; exit 1; } +DEFAULT=$(default_branch) || { echo "error: cannot determine default branch for $PROJ; expected origin/HEAD, or a local main (legacy master also accepted)" >&2; exit 1; } BRANCH="fm/$ID" if ! git -C "$WT" rev-parse --verify --quiet "refs/heads/$BRANCH" >/dev/null; then diff --git a/bin/fm-tangle-lib.sh b/bin/fm-tangle-lib.sh index a8554fbd60..b7a3c28e03 100644 --- a/bin/fm-tangle-lib.sh +++ b/bin/fm-tangle-lib.sh @@ -18,7 +18,7 @@ # primary checkout is the alarm. # Resolve the default branch name of the git repo at : prefer origin/HEAD, -# then fall back to a local main/master. Echoes the name, or returns 1. +# then fall back to a local main (legacy master as a secondary fallback). Echoes the name, or returns 1. fm_default_branch() { local dir=$1 ref branch ref=$(git -C "$dir" symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null || true) diff --git a/bin/fm-teardown.sh b/bin/fm-teardown.sh index 4178217c91..b9879b0223 100755 --- a/bin/fm-teardown.sh +++ b/bin/fm-teardown.sh @@ -1163,7 +1163,7 @@ validate_worktree_teardown_safety() { unpushed=$(printf '%s\n' "$unpushed_raw" | head -5) if [ -n "$unpushed" ] && [ "$MODE" = local-only ]; then - DEFAULT=$(default_branch) || { echo "REFUSED: cannot determine default branch for $PROJ; expected origin/HEAD, main, or master." >&2; return 1; } + DEFAULT=$(default_branch) || { echo "REFUSED: cannot determine default branch for $PROJ; expected origin/HEAD, or a local main (legacy master also accepted)." >&2; return 1; } if ! unmerged_raw=$(git -C "$WT" log --oneline HEAD --not "$DEFAULT" -- 2>/dev/null); then if worktree_safety_blocked_by_lock "commits not on $DEFAULT"; then return "$TEARDOWN_WORKTREE_SAFETY_LOCK_BLOCKED" diff --git a/docs/architecture.md b/docs/architecture.md index a1d7d77753..8f6a7b7f4c 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -165,7 +165,7 @@ Its operating checkout (`FM_ROOT`) and the disposable crewmate worktrees are all The primary checkout is healthy on its default branch, and linked worktrees or secondmate homes are healthy at detached HEAD. Only a named non-default branch checked out in `FM_ROOT` is a worktree tangle. -`fm-tangle-lib.sh` resolves the default branch from `origin/HEAD`, then local `main` or `master`, and classifies that named non-default primary branch as the tangle. +`fm-tangle-lib.sh` resolves the default branch from `origin/HEAD`, then local `main` (legacy `master` as a secondary fallback), and classifies that named non-default primary branch as the tangle. `fm-guard.sh` prints the repair command on the next mutable fleet action, while `bin/fm-session-start.sh` reports the same condition through bootstrap as a `TANGLE:` line at session start. If another live session holds the fleet lock, both surfaces keep the alarm but switch to read-only wording with no repair command. Ship briefs also tell the crewmate to verify `pwd -P` and `git rev-parse --show-toplevel` before creating `fm/`, then stop with a blocked status if it landed in the primary checkout.