Skip to content

Show a usable push command when the Base branch is missing on origin - #752

Merged
JacobStephens2 merged 1 commit into
mainfrom
issue-295
Oct 17, 2026
Merged

JacobStephens2 merged 1 commit into
mainfrom
issue-295

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

Base branch missing on origin
  local branch exists → show safely quoted push command for that branch + set upstream
  no local branch     → explain create/obtain/select recovery
  stop preflight; leave refs, checkout and configuration untouched

The push command uses explicit source and destination branch refs, so a named Base branch works from another checkout even with a same-named tag. Updates the README's quoted guidance.

Closes #295

Evidence

  • Before: cargo test --bin thirdshift launch::tests::a_local_base_branch_missing_on_origin_gets_a_working_push_command -- --exact failed: the error only said push it first.
    After: passes; the test executes the suggested command against a temporary origin and verifies the branch and upstream.
  • Before: cargo test --bin thirdshift launch::tests::a_base_branch_absent_locally_and_on_origin_gets_no_push_command -- --exact failed while developing the local-present slice: it suggested pushing a nonexistent branch.
    After: passes, including a same-named local tag and unchanged local/remote refs.
  • Named-branch coverage executes the suggested command with an apostrophe, shell metacharacters, HEAD, a shadowing tag, and a different checked-out commit. CLI coverage verifies Run, Architect run and Pickup run preflight.
  • Validation: cargo check --all-targets, cargo fmt --check, cargo clippy --all-targets -- -D warnings; full cargo test passed (1809 passed, 0 failed, 2 ignored).

Seams under test

  • LaunchDirectory::prepare_base_branch: recovery guidance and the suggested command's real Git effects against a temporary origin.
  • CLI preflight for a Run and Passes: failure before work, using the selected Base branch.

Unaddressed findings

  • Standards: none; 0 findings.
  • Spec: none; 0 findings.
  • Security: none; 0 introduced findings. Reviewed the pinned merge-base diff and supporting code for shell injection, Git argument/ref confusion, and unintended branch publication.

Both independent reviewers read every changed file: README.md, src/launch.rs, src/run.rs, tests/architect_run.rs, tests/pickup_run.rs, and tests/preflight.rs. Changed files left unread: none.

Security review outcome

No unaddressed introduced findings.

Merge Danger

Door: two-way

Revert restores the previous diagnostic. No state migration or automatic branch repair.

Blast Radius: preflight

Only missing-origin Base branch recovery guidance changes; existing local-ahead behavior stays covered.

Built with codex · gpt-6.1-sol · high

@JacobStephens2
JacobStephens2 merged commit a225cea into main Oct 17, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-295 branch October 17, 2026 09:38
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 17, 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.

tell user how to push the branch / give a sample command when base branch does not exist on origin

1 participant