You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add repo/env-configured trunk branch names while preserving the built-in defaults (dev, main, master).
Document stack.trunk and STACK_TRUNKS trunk additions.
Make branch updates work when the branch is checked out in a linked worktree by resetting the clean owning worktree instead of force-moving it from another worktree.
Push changed stack parent branches during stack sync --apply before repairing descendants, so parent PR heads and descendant PR heads all publish the same propagated commits.
Testing
bun run format:check
bun run typecheck
bun run test -- tests/cli.test.ts
bun run test -- tests/stack.test.ts --testNamePattern "sync rebases a branch checked out in another worktree" --testTimeout 60000
bun run test -- tests/stack.test.ts --testNamePattern "sync pushes a changed parent before rebasing descendants" --testTimeout 60000
bun run test -- --testTimeout 60000
Manual Verification
Created private princejoogie/git-dummy PR stacks and verified tmp.txt add/remove propagation with live GitHub PR metadata:
Non-worktree stack: confirmed old behavior pushed descendants but left root stale; after this fix, stack sync --apply pushes root, rebases child/grandchild, and all remote branches contain the propagated commits.
Linked-worktree stack: confirmed the same stale-root behavior before the fix; after this fix, root, child, and grandchild remotes all move correctly while child/grandchild are checked out in linked worktrees.
Thanks for this @princejoogie! Heads up on some overlap: the configurable-trunk piece of this PR has now landed separately in #11 (git config stack.trunks), which merged to main. That portion here will conflict.
Could you rebase this PR onto the latest main and pare it down to just the worktree branch updates — i.e. drop the trunk config + docs changes, keeping the repairExecution/Git/Stack worktree-push work?
One more coordination note: #19 (feat/worktree-aware-repair) is a dedicated, more thorough take on repairing branches checked out in other worktrees (dirty-state detection, fail-before-mutation semantics). I'm leaning toward landing #19 as the canonical worktree-repair implementation, so it'd be worth reconciling against it — your remaining delta may be the "push changed parent before repairing descendants" part, which looks complementary rather than overlapping. Happy to help figure out the seam.
Worktree-aware repair → landed in feat(stack): repair checked-out worktree branches #19, which repairs a checked-out branch from its owning clean worktree (checkout + reset --hard instead of git branch -f from another checkout) and fails before mutation on a dirty worktree, with a pre-flight gate over the branches that will actually drift.
Could you rebase onto the latest main and check what's left? My read is your remaining unique delta is the "push the changed parent branch before repairing descendants" behavior during stack sync --apply, so parent and descendant PR heads publish the same propagated commits. That part looks complementary to #19 rather than overlapping.
If that's the case, a slimmed-down PR doing just that — ideally with a focused test like your manual tmp.txt propagation check — would be easy to review and land. Thanks for your patience here, and sorry for the churn; the overlap only became obvious once these were split apart.
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
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
dev,main,master).stack.trunkandSTACK_TRUNKStrunk additions.stack sync --applybefore repairing descendants, so parent PR heads and descendant PR heads all publish the same propagated commits.Testing
bun run format:checkbun run typecheckbun run test -- tests/cli.test.tsbun run test -- tests/stack.test.ts --testNamePattern "sync rebases a branch checked out in another worktree" --testTimeout 60000bun run test -- tests/stack.test.ts --testNamePattern "sync pushes a changed parent before rebasing descendants" --testTimeout 60000bun run test -- --testTimeout 60000Manual Verification
Created private
princejoogie/git-dummyPR stacks and verifiedtmp.txtadd/remove propagation with live GitHub PR metadata:stack sync --applypushes root, rebases child/grandchild, and all remote branches contain the propagated commits.