diff --git a/get-shit-done/workflows/execute-phase.md b/get-shit-done/workflows/execute-phase.md index 86d243c6a..b50ea11f2 100644 --- a/get-shit-done/workflows/execute-phase.md +++ b/get-shit-done/workflows/execute-phase.md @@ -238,13 +238,11 @@ else else git switch --quiet "$DEFAULT_BRANCH" 2>/dev/null && git merge --ff-only --quiet "origin/$DEFAULT_BRANCH" 2>/dev/null || true fi + # Pinned base + fail-fast: on success HEAD is exactly at origin/$DEFAULT_BRANCH, + # so a post-creation merge-base or "ahead-of" guard would be unreachable. The + # explicit base argument here is the single source of correctness for #2916. git checkout -b "$BRANCH_NAME" "origin/$DEFAULT_BRANCH" \ || { echo "ERROR: Could not create '$BRANCH_NAME' from origin/$DEFAULT_BRANCH (#2916)." >&2; exit 1; } - # Warn only on fresh creation when HEAD did NOT fork from origin/$DEFAULT_BRANCH — #2916. - # Skipped on resume because origin may have advanced legitimately since first creation. - if MB=$(git merge-base HEAD "origin/${DEFAULT_BRANCH}" 2>/dev/null) && DT=$(git rev-parse --verify --quiet "refs/remotes/origin/${DEFAULT_BRANCH}" 2>/dev/null) && [ "$MB" != "$DT" ]; then - echo "WARNING: Phase branch '$BRANCH_NAME' does not fork from origin/${DEFAULT_BRANCH}; verify the base is intentional." - fi fi ``` diff --git a/get-shit-done/workflows/quick.md b/get-shit-done/workflows/quick.md index c7cf6f265..936578346 100644 --- a/get-shit-done/workflows/quick.md +++ b/get-shit-done/workflows/quick.md @@ -218,16 +218,13 @@ else || true fi - # Always pin the new branch to origin/$DEFAULT_BRANCH so the start point is + # Pin the new branch to origin/$DEFAULT_BRANCH so the start point is # deterministic regardless of which branch we are currently on (#2916). + # On success HEAD is exactly at origin/$DEFAULT_BRANCH, so a post-creation + # merge-base / "ahead-of" guard would be unreachable — the explicit base + # argument here is the single source of correctness for #2916. git checkout -b "$branch_name" "origin/$DEFAULT_BRANCH" \ || { echo "ERROR: Could not create '$branch_name' from origin/$DEFAULT_BRANCH (#2916)." >&2; exit 1; } - - # Warn only on fresh creation when HEAD did NOT fork from origin/$DEFAULT_BRANCH — #2916. - # Skipped on resume because origin may have advanced legitimately since first creation. - if MB=$(git merge-base HEAD "origin/${DEFAULT_BRANCH}" 2>/dev/null) && DT=$(git rev-parse --verify --quiet "refs/remotes/origin/${DEFAULT_BRANCH}" 2>/dev/null) && [ "$MB" != "$DT" ]; then - echo "WARNING: Quick-task branch '$branch_name' does not fork from origin/${DEFAULT_BRANCH}; verify the base is intentional before continuing." - fi fi ```