feat(cli): add dub modify --into stack branch workflow#32
Open
feat(cli): add dub modify --into stack branch workflow#32
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds a new dub modify --into <branch> workflow to apply the modify flow to another branch in the current stack and then restack descendants, with accompanying guardrails, docs, and tests.
Changes:
- Add
--into <branch>flag todub modifyand implement target-branch modify + descendant restack behavior (with restore-to-original-branch behavior). - Add unit tests covering
--intovalidation/restoration plus restack conflict/failure messaging. - Add an integration test and update docs (
README,QUICKSTART, command docs) to document the new workflow.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli/src/index.ts | Exposes the new dub modify --into <branch> CLI option and help text. |
| packages/cli/src/commands/modify.ts | Implements --into validation, branch switching, modify flow execution, and restoration logic. |
| packages/cli/src/commands/modify.test.ts | Adds unit coverage for --into behavior and restack status messaging. |
| packages/cli/src/commands/modify-into.test.ts | Adds an integration-level test exercising modify --into against a real repo. |
| apps/docs/content/docs/commands/modify.mdx | Documents --into usage and adds it to the flags table. |
| README.md | Adds --into example + flag mention. |
| QUICKSTART.md | Adds guidance for applying changes to a middle/older branch via --into. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
142
to
+145
| await amendCommit(cwd, { message, noEdit }); | ||
| } | ||
|
|
||
| await restackChildren(cwd); | ||
| return restackChildren(cwd); |
Comment on lines
+48
to
+57
| expect(await getCurrentBranch(dir)).toBe('feat/b'); | ||
|
|
||
| const targetLastCommit = ( | ||
| await gitInRepo(dir, ['log', '-1', '--format=%s', 'feat/a']) | ||
| ).stdout.trim(); | ||
| expect(targetLastCommit).toBe('fix(a): apply targeted fix'); | ||
|
|
||
| const fileContent = fs.readFileSync(path.join(dir, 'a.txt'), 'utf8'); | ||
| expect(fileContent).toContain('hotfix'); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dub modify --into <branch>to edit older branches in the current stack and keep descendants up-to-date.--into/--interactive-rebasecombinations).README.md,QUICKSTART.md, and command docs for the new flow.Testing
pnpm checkspnpm typecheckpnpm testRespects issue
ds-3wnand includes second-pass verification.