Skip to content

Fast-forward the Launch directory's Base branch with launch.pull - #125

Merged
JacobStephens2 merged 3 commits into
mainfrom
issue-74
Sep 29, 2026
Merged

JacobStephens2 merged 3 commits into
mainfrom
issue-74

Conversation

@JacobStephens2

Copy link
Copy Markdown
Owner

Summary

New User config setting: [launch] pull = true fast-forwards the Launch directory's Base branch before the worktree is created. Off by default.

 run(issue, goal, launch_pull)
   preflight::check
   branch::select
   preflight::check_base_branch      # fetches origin/<base>, rejects local ahead
+  if launch_pull
+    pull_base_branch
+      skip unless checked-out branch == Base branch (detached HEAD skips)
+      skip quietly if already up to date
+      progress: "updating <base> in the Launch directory from origin/<base>"
+      git merge --ff-only origin/<base>
+        on error → git's error, then "warning: … git pull --ff-only origin <base>"; Run carries on
   interrupt check
   Worktree::create_* (still from origin/<base>)
  • src/config.rs: parses [launch], with the same rules as [merge]. An unknown key, a non-boolean value, or a non-table launch is an error that names the file and key.
  • CONTEXT.md: defines Launch directory, uses it in Origin match and Base branch, and mentions the setting under User config.
  • The README and the help text document launch.pull.

Evidence

  • Before: with origin's main one commit ahead, a Run left the Launch directory's main behind.
    After: tests/launch_pull.rs, 8 end-to-end tests, all pass:
    • pull = true: the Launch directory's main equals origin's head, and the Run succeeds.
    • No config, pull = false, or an empty [launch]: main is unchanged.
    • Already up to date: no progress line and no warning.
    • An uncommitted edit to a file origin changed: a warning: line on stderr, exit 0, the PR URL on stdout, and the edit intact.
    • A Continuation whose open PR targets main while develop is checked out: develop is not moved.
    • A closed issue, or an Origin match failure: main is not moved.
    • pul = true, pull = "yes", or launch = true: the Run stops before any work, naming the file and the key.
  • Config unit tests launch_pull_is_read and errors_name_the_file_and_the_offending_key pass.
  • The full cargo test run passes, and cargo clippy --all-targets is clean.

Merge Danger

Door: two-way

The setting is opt-in, and reverting the PR removes it. The update is fast-forward only, so it never discards anything in the Launch directory.

Blast Radius: opt-in

Users who don't set launch.pull see no change. The config parser was restructured to share one path for merge.* and launch.* keys, and the merge.always error messages are unchanged (covered by tests).

Unaddressed findings

Standards

  • Bare bool parameter on run (Primitive Obsession / Data Clumps). Skipped because there is only one setting. The spec asks for the value to reach the Run "alongside its Goal", and an options type can come with the next setting.
  • Section names repeated across match arms in config.rs (Repeated Switches). Skipped because the reviewer rated it mild. There are two sections, and the setting lookup is already a single table.
  • "launch clone" in older tests/support/mod.rs comments now conflicts with the glossary. Skipped because those lines predate this change. The new comment uses "Launch directory".

Spec

  • The warning: line doesn't itself carry git's error. git's error goes on the stderr line just before it. Skipped because this is the Self-merge warning: convention that the spec says to follow.
  • No progress line when the branch is already up to date. Skipped on purpose, to meet story 16 ("a quiet no-op … nothing alarming is printed"). Nothing is attempted in that case.

Closes #74

🤖 Generated with Claude Code

JacobStephens2 and others added 3 commits September 29, 2026 20:24
A new User config setting, [launch] pull = true, brings the checked-out
Base branch up to date with origin after pre-flight and before the
worktree is created. It is fast-forward only, skipped when the checked-out
branch isn't the Base branch, and a failure is a warning, never a Failed
run. Launch directory joins the glossary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts skip

pull_base_branch now decides for itself whether the checked-out branch
is the Base branch, the setting is launch_pull everywhere, and the test
harness shares one seed-clone helper between origin_has_branch and
origin_has_commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	CONTEXT.md
#	README.md
#	src/config.rs
#	src/main.rs
#	src/run.rs
@JacobStephens2
JacobStephens2 merged commit 55eb404 into main Sep 29, 2026
13 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-74 branch September 29, 2026 20:38
@JacobStephens2 JacobStephens2 mentioned this pull request Sep 30, 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.

have thirdshift <github issue url> run git pull first in the dir you run it in

1 participant