Merged
Conversation
Member
Author
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 a new mergify stack reorder command to deterministically reorder all commits in the current stack (non-interactive), by driving git rebase -i with a generated Python GIT_SEQUENCE_EDITOR script, plus a dedicated test suite.
Changes:
- Introduce
mergify_cli.stack.reorderimplementing stack commit discovery, prefix-to-commit matching, and automated interactive rebase reordering (with--dry-runsupport). - Add
mergify stack reordercommand wiring in the stack CLI. - Add end-to-end style tests that create a real repo + origin, then verify reorder behavior and error cases.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
mergify_cli/stack/reorder.py |
Core implementation of stack commit enumeration, prefix matching, and non-interactive reorder via GIT_SEQUENCE_EDITOR. |
mergify_cli/stack/cli.py |
Adds the stack reorder Click command and forwards args to the implementation. |
mergify_cli/tests/stack/test_reorder.py |
New test coverage for reorder success paths and validation/error cases (SHA + Change-Id prefixes, dry-run, duplicates, empty stack). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add `mergify stack reorder` to non-interactively reorder all commits in a stack. Takes commit prefixes (SHA or Change-Id) in desired order and uses a temporary Python script as GIT_SEQUENCE_EDITOR to rewrite the rebase todo list, avoiding the sed quoting issues that make inline GIT_SEQUENCE_EDITOR unreliable for automation. Supports --dry-run to preview the new order without rebasing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Change-Id: I46dc35fd28e3535e9f64f85581db87a50b6d4c21 Claude-Session-Id: cdc0d010-0b6d-4808-a13c-d8e205472a4b
jd
commented
Apr 10, 2026
bc1c88f to
9e71e25
Compare
remyduthu
approved these changes
Apr 10, 2026
JulianMaurin
approved these changes
Apr 10, 2026
Contributor
Merge Queue Status
This pull request spent 5 minutes 58 seconds in the queue, including 5 minutes 15 seconds running CI. Required conditions to merge
|
36 tasks
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.
Add
mergify stack reorderto non-interactively reorder all commits ina stack. Takes commit prefixes (SHA or Change-Id) in desired order and
uses a temporary Python script as GIT_SEQUENCE_EDITOR to rewrite the
rebase todo list, avoiding the sed quoting issues that make inline
GIT_SEQUENCE_EDITOR unreliable for automation.
Supports --dry-run to preview the new order without rebasing.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com