Conversation
|
Claude finished @boneskull's task in 1m 17s —— View job Code Review
The implementation is clean and the core logic is correct. A few things worth flagging:
|
gh stack adopt to _change_ the parent branch. Previously, it would error out if the current branch was already tracked.There was a problem hiding this comment.
Pull request overview
This PR updates gh stack adopt so that re-adopting an already-tracked branch updates its configured parent branch (instead of erroring), and adds coverage to ensure reparenting and cycle prevention work end-to-end.
Changes:
- Allow
adoptto reparent already-tracked branches and print a message indicating the old and new parent. - Make
adopta no-op (successful) when the requested parent is unchanged, with a warning message. - Add E2E coverage for reparenting, no-op behavior, and cycle detection; update README docs accordingly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
cmd/adopt.go |
Implements re-adoption behavior (reparent/no-op) and user-facing messaging. |
e2e/adopt_orphan_test.go |
Adds E2E tests for reparenting, no-op adopt, and cycle detection failures. |
cmd/adopt_test.go |
Updates unit test to reflect reparenting semantics. |
README.md |
Documents that adopt can update a tracked branch’s parent (or no-op if unchanged). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // No-op: already tracked with the same parent | ||
| if alreadyTracked && oldParent == parent { | ||
| fmt.Printf("%s Branch %s is already tracked with parent %s\n", s.WarningIcon(), s.Branch(branchName), s.Branch(parent)) | ||
| return nil | ||
| } |
This change allows `gh stack adopt` to _change_ the parent branch. Previously, it would error out if the current branch was already tracked.
This change allows
gh stack adoptto change the parent branch. Previously, it would error out if the current branch was already tracked.Closes #114