Support starting worktree from a specific git commit or ref #227

Open
opened 2026-02-26 09:02:34 +00:00 by mprihoda · 3 comments
mprihoda commented 2026-02-26 09:02:34 +00:00 (Migrated from github.com)

Problem

iw start <issue> always creates the worktree from the current checked-out branch (HEAD). Sometimes you want to start from a specific commit, tag, or ref instead — e.g., starting from a release tag, a specific main commit, or another branch's tip.

Proposal

Add an optional argument to iw start to specify the base ref:

iw start <issue> [--from <ref>]

Where <ref> can be a commit SHA, tag, branch name, or any valid git ref. When provided, the new worktree branch is created from that ref instead of HEAD.

Examples:

iw start 223                        # current behavior: branch from HEAD
iw start 223 --from v0.2.0          # branch from tag
iw start 223 --from abc123f         # branch from specific commit
iw start 223 --from origin/main     # branch from remote main

Notes

This would be especially useful for the agent workflow (#222) where the agent may want to start work from a known-good commit rather than whatever happens to be checked out.

## Problem `iw start <issue>` always creates the worktree from the current checked-out branch (HEAD). Sometimes you want to start from a specific commit, tag, or ref instead — e.g., starting from a release tag, a specific main commit, or another branch's tip. ## Proposal Add an optional argument to `iw start` to specify the base ref: ``` iw start <issue> [--from <ref>] ``` Where `<ref>` can be a commit SHA, tag, branch name, or any valid git ref. When provided, the new worktree branch is created from that ref instead of HEAD. Examples: ```bash iw start 223 # current behavior: branch from HEAD iw start 223 --from v0.2.0 # branch from tag iw start 223 --from abc123f # branch from specific commit iw start 223 --from origin/main # branch from remote main ``` ## Notes This would be especially useful for the agent workflow (#222) where the agent may want to start work from a known-good commit rather than whatever happens to be checked out.
Member

Intake: agent-ready
Workflow: waterfall
Reason: all gates passed
Analysis: project-management/issues/IW-227/analysis.md on branch IW-227

Intake: agent-ready Workflow: waterfall Reason: all gates passed Analysis: project-management/issues/IW-227/analysis.md on branch IW-227
Member

Implement: needs-human
Reason: batch-implement exit 1 — the kanon plugin did not compile against the iw-cli core of main, so no phase ran

The kanon plugin's lib/batch/ForgeCatchUp.scala expects fetchPullRequestForBranch to return Either[String, …]. The core on main returns Either[TrackerError, …] since #778. The cause is not in this issue: the plugin must be updated, and then the issue can go back to agent-ready.

[error] /home/mph/.local/share/iw/plugins/kanon/lib/batch/ForgeCatchUp.scala:143:7
[error] Found:    Either[iw.core.model.TrackerError, Option[batch.ForgeState]]
[error] Required: Either[String, Option[batch.ForgeState]]
Compilation failed
Implement: needs-human Reason: batch-implement exit 1 — the kanon plugin did not compile against the iw-cli core of main, so no phase ran The kanon plugin's `lib/batch/ForgeCatchUp.scala` expects `fetchPullRequestForBranch` to return `Either[String, …]`. The core on `main` returns `Either[TrackerError, …]` since #778. The cause is not in this issue: the plugin must be updated, and then the issue can go back to `agent-ready`. ``` [error] /home/mph/.local/share/iw/plugins/kanon/lib/batch/ForgeCatchUp.scala:143:7 [error] Found: Either[iw.core.model.TrackerError, Option[batch.ForgeState]] [error] Required: Either[String, Option[batch.ForgeState]] Compilation failed ```
Member

Release: the implement loop failed this issue for a reason outside it. The kanon plugin did not compile against iw-cli main, because the tracker port now returns TrackerError (iw-cli #778). The plugin fix is dev-docs #484, and iw-cli 0.22.1 carries the core change. The issue goes back to the implement loop.

Release: the implement loop failed this issue for a reason outside it. The kanon plugin did not compile against iw-cli main, because the tracker port now returns TrackerError (iw-cli #778). The plugin fix is dev-docs #484, and iw-cli 0.22.1 carries the core change. The issue goes back to the implement loop.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#227
No description provided.