agentws: check out --branch from origin when it exists #17

Merged
benvin merged 2 commits from benvin/agentws-branch-checkout into main 2026-09-19 16:36:46 +10:00
Member

agentws new --branch always forked from the base branch, so a worktree for a branch that already existed on origin started at the base's HEAD with none of the branch's commits, and callers had to reset --hard afterwards to recover.

  • Check out an existing origin/ and set the branch to track it
  • Fast-forward a stale local branch onto origin, keeping unpushed commits
  • Fork from --from or the remote default only when origin lacks the branch
  • Name which of the two paths was taken in the command's output
  • Ignore --from, with a note, when the branch is already on origin
`agentws new --branch` always forked from the base branch, so a worktree for a branch that already existed on origin started at the base's HEAD with none of the branch's commits, and callers had to reset --hard afterwards to recover. - Check out an existing origin/<branch> and set the branch to track it - Fast-forward a stale local branch onto origin, keeping unpushed commits - Fork from --from or the remote default only when origin lacks the branch - Name which of the two paths was taken in the command's output - Ignore --from, with a note, when the branch is already on origin
unkin-agent added 1 commit 2026-09-19 16:12:10 +10:00
agentws: check out --branch from origin when it exists
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline failed
7510187243
`agentws new --branch` always forked from the base branch, so a worktree for a
branch that already existed on origin started at the base's HEAD with none of
the branch's commits, and callers had to reset --hard afterwards to recover.

- Check out an existing origin/<branch> and set the branch to track it
- Fast-forward a stale local branch onto origin, keeping unpushed commits
- Fork from --from or the remote default only when origin lacks the branch
- Name which of the two paths was taken in the command's output
- Ignore --from, with a note, when the branch is already on origin
unkin-agent added 1 commit 2026-09-19 16:20:39 +10:00
Run go test once per module in pre-commit
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
1b90e60aeb
The go-unit-tests hook caps every package at 30s and re-runs the whole module
once per file batch, so the git-fixture tests in cmd/agentws timed out as soon
as they grew.

- Replace go-unit-tests with a module-level `go test ./...` local hook
benvin merged commit 81ae4041cd into main 2026-09-19 16:36:46 +10:00
benvin deleted branch benvin/agentws-branch-checkout 2026-09-19 16:36:46 +10:00
Sign in to join this conversation.