Add 'merge' command to complete issue workflow from main repo #174
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#174
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add an
iw merge <issue-id>command that can be run from the main repository to complete the full issue lifecycle - merging the PR, closing the issue, and cleaning up the worktree.Problem
Currently, after an issue implementation is complete and the final PR is ready:
gh pr merge)iw rmThis is error-prone and leaves orphaned worktrees if we forget the cleanup step.
Proposed Solution
A single command that handles the full completion flow:
What it should do:
IW-100→ main)rmcommand logicFlags:
--no-squash- Use merge commit instead of squash--keep-worktree- Don't remove the worktree after merge--dry-run- Show what would happen without doing itExample Flow
Acceptance Criteria
rmcommand logic)Notes
rmcommand for worktree cleanupiw finishcommand: merge final PR and remove worktree #249Intake: needs-input
1. Do we build #174 as its own command, or do we put it into
iw finishfrom #249?Open issue #249 asks for
iw finish <issue-id>. That command also merges the final PR and removes the worktree, from the main repository. #174 asks for that same work under the nameiw merge, plus three items that #249 does not have: close the tracker issue,--dry-run, and--keep-worktree. Question 4 on #249 asks the same thing from the other side and has no answer yet. If we do both issues as they are written, we get two commands that do the same work.iw finish, and #249 becomes larger.iw finish, after #249 lands. #249 stays the same size. #174 must then wait for #249.iw mergeand close #249. We get one command with the namemerge, and the scope of #174.Recommended: b): #249 stays the same size, and we lose none of the items in #174. Please give the same answer to question 4 on #249.
2. Must the command merge the final PR with a squash or with a merge commit?
#174 asks for a squash by default, with
--no-squashfor a merge commit. But each final PR onmainmerges with a merge commit now, for example33e14e5f"Merge pull request 'IW-681: …' (#798)". The forge code already has the two merge types: ForgeGateway.scala L75-L105.--squashflag. This is how the project merges now, and the history of each phase stays.--no-squash. This is what the issue says. Each issue becomes one commit onmain.Recommended: a): it is how the project merges now. Question 1 on #249 asks the same thing, so please give the same answer to both.
Answer in a comment on this issue, per number, for example "1: a", or in your own words; intake reads it on its next iteration.