Skip to content

fix(ship): require a main-based checkout, drop the stash/pop#394

Open
shirgoldbird wants to merge 1 commit into
mainfrom
fix-ship-branch-handling
Open

fix(ship): require a main-based checkout, drop the stash/pop#394
shirgoldbird wants to merge 1 commit into
mainfrom
fix-ship-branch-handling

Conversation

@shirgoldbird

@shirgoldbird shirgoldbird commented Jul 8, 2026

Copy link
Copy Markdown
Member

ship.py stashed the working tree, branched off main, then popped the stash back onto the new branch. On a divergent branch (e.g. running the full pipeline locally on a feature branch mid-restructure) the git stash pop conflicted → the step crashed → conflict markers got committed into docs.json, and the user's uncommitted work was stranded in a dangling stash.

Fix (strict, main-based)

  1. No stash. The promoted working-tree changes carry onto the new branch directly.
  2. Guard: refuse to ship unless HEAD == origin/main. A PR is always built on the correct base. On a feature/stale branch, ship stops with a clear message (run from a fresh main checkout, or run.py --skip ship post_review) instead of crashing or silently building off the wrong base.

CI always runs on main, so the guard is a no-op there — it only catches accidental local runs on the wrong branch.

Verified

  • Refuse path: on a non-main HEAD, ship prints the guard error, exits 1, creates no branch, and leaves state untouched.
  • Branch/commit mechanics: confirmed separately — branches and commits the run's docs with no stash.

🤖 Generated with Claude Code

@mintlify

mintlify Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
deepl-c950b784 🟢 Ready View Preview Jul 8, 2026, 9:37 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

ship.py stashed the working tree, branched off main, then popped the stash back.
On a divergent branch the pop conflicted, crashed the step, and committed conflict
markers into docs.json — while stranding the user's real work in a dangling stash.

Now:
1. No stash — the promoted working-tree changes carry onto the new branch directly.
2. A guard that refuses unless HEAD == origin/main, so a PR is always built on the
   correct base. On a feature or stale branch ship stops with a clear message
   instead of crashing or silently building off the wrong base. CI runs on main,
   so the guard is a no-op there.

Verified: refuses on a non-main HEAD (exit 1, no branch created, no state change).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@shirgoldbird shirgoldbird force-pushed the fix-ship-branch-handling branch from bbfeb41 to 9a5dafc Compare July 8, 2026 21:40
@shirgoldbird shirgoldbird changed the title fix(ship): branch off HEAD without stashing fix(ship): require a main-based checkout, drop the stash/pop Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant