feat: cascade rebase improvements (stdin fix, force-push, replaced-commits) - #339
Open
bkrupa wants to merge 4 commits into
Open
feat: cascade rebase improvements (stdin fix, force-push, replaced-commits)#339bkrupa wants to merge 4 commits into
bkrupa wants to merge 4 commits into
Conversation
…tracking - Fix interactive rebase by inheriting stdin/stdout/stderr (Stdio::inherit) - Add --force-push flag to cascade with --force-with-lease safety - Track replaced/skipped commits during cascade for descendant awareness - Add get_rebase_head_commit helper for REBASE_HEAD resolution - Add preview mode (--preview) to show rebase plan without executing
- Extract shared git command helpers into twig-cli/src/git_commands.rs (GitCommandOutput, execute_git_command, execute_git_command_interactive, resolve_branch_remote) removing the duplicate implementations that had diverged between cascade.rs and rebase.rs (issue 6) - Reduce rebase_downstream to two parameters (repo_path + &CascadeArgs) instead of seven positional bool arguments (issue 11) - Fix formatting mangle in the force-rebase success match arm (issue 3) - Strip trailing whitespace from the --force-push doc comment (issue 8) - Check execute_git_command_interactive success status after rebase --continue and --skip in both cascade.rs and rebase.rs; propagate failures instead of falling through to print_success (issues 2, 7) - Remove unnecessary .clone() on commit_hash by moving the value after computing the short-hash prefix (issue 9) - Correct misleading log messages: replaced_commits entries are now described as 'noted' with a TODO explaining what is needed to actually wire them into downstream rebases (issue 1) - Resolve the upstream remote via git config branch.<name>.remote in handle_force_push, falling back to 'origin' only when none is set (issue 4) - Return Err from handle_force_push on failure; the cascade now reports overall failure when --force-push was explicitly requested (issue 5) - Add unit tests for get_rebase_head_commit, CascadeArgs.force_push, and handle_force_push error behavior; add integration test verifying that cascade fails when --force-push is set but no remote is configured (issue 10) - Fix missing force_push field in run_cascade_command test helper that would have broken compilation on Unix
…y::only_used_in_recursion
bkrupa
force-pushed
the
feature/cascade-improvements
branch
from
February 26, 2026 01:26
7ecc16b to
9f8745d
Compare
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
Improves the cascade rebase workflow with three related enhancements:
--force-pushflag to automatically force-push branches after successful cascade rebaseFiles changed
twig-cli/src/cli/cascade.rs- Force-push support, replaced-commits tracking, stdin fixtwig-cli/src/cli/rebase.rs- Stdin inheritance for rebase subprocess