refactor(stack): add rebase helpers for squash and fixup#1264
Merged
mergify[bot] merged 1 commit intomainfrom Apr 21, 2026
Merged
Conversation
Member
Author
|
This pull request is part of a Mergify stack:
|
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 👀 Review RequirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
There was a problem hiding this comment.
Pull request overview
Adds helper functions to support upcoming stack squash/fixup functionality by enabling action-aware interactive rebases and action-tagged plan display.
Changes:
- Introduces
run_action_rebase()to reorder commits and rewrite rebase-todo actions (pick → squash/fixup) with optionalexecinsertion. - Introduces
display_action_plan()to print a commit plan annotated with each commit’s intended action. - Minor docstring formatting adjustment in
run_scripted_rebase().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds two helpers to mergify_cli/stack/reorder.py, used by the new squash and fixup commands: - run_action_rebase reorders picks to a desired sha order (same as run_rebase) and additionally rewrites pick -> squash|fixup for shas listed in actions. An optional exec_after_sha + exec_command pair inserts an "exec <cmd>" line right after the named sha's row — used by squash to amend the combined commit's message while HEAD still points at it. - display_action_plan prints the plan tagged with each commit's action. run_rebase now delegates to run_action_rebase with an empty actions dict to avoid duplicating the embedded rebase-todo rewrite script. No user-facing behavior change — preparation for the fixup and squash commands. Change-Id: I560beaa3ed28ee211f601d15e550411fbe8107c4
eada573 to
80b8633
Compare
Member
Author
Revision history
|
JulianMaurin
approved these changes
Apr 21, 2026
sileht
approved these changes
Apr 21, 2026
Contributor
Merge Queue Status
This pull request spent 5 minutes 55 seconds in the queue, including 5 minutes 27 seconds running CI. Required conditions to merge
|
36 tasks
mergify Bot
pushed a commit
that referenced
this pull request
Apr 21, 2026
Add "mergify stack fixup COMMIT..." which folds each listed commit into its parent inside the stack (dropping its message) without opening an editor. Multiple commits can be listed: each folds into its own parent. Errors when a listed commit is first-in-stack, unknown, or duplicated. Supports --dry-run. Depends-On: #1264
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.
Adds two helpers to mergify_cli/stack/reorder.py, used by the new
squash and fixup commands:
run_rebase) and additionally rewrites pick -> squash|fixup for shas
listed in actions. An optional exec_after_sha + exec_command pair
inserts an "exec " line right after the named sha's row — used
by squash to amend the combined commit's message while HEAD still
points at it.
run_rebase now delegates to run_action_rebase with an empty actions
dict to avoid duplicating the embedded rebase-todo rewrite script.
No user-facing behavior change — preparation for the fixup and squash
commands.