feat(stack): add revision history comments for force-pushed PRs#1156
Open
feat(stack): add revision history comments for force-pushed PRs#1156
Conversation
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🔴 👀 Review RequirementsWaiting for:
This rule is failing.
🔴 🔎 ReviewsWaiting for:
This rule is failing.
🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
There was a problem hiding this comment.
Pull request overview
Adds an opt-out “Revision history” PR comment feature to stack push so reviewers can see what changed across force-push iterations (including compare links, change-type detection via patch-id, and timestamps).
Changes:
- Add git-config-backed default for revision history behavior (
mergify-cli.stack-revision-history). - Add revision-history detection + comment create/update flow to
stack push. - Add/adjust tests to cover revision history defaults, change-type detection, and comment creation/update behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
mergify_cli/utils.py |
Adds get_default_revision_history() to read the new git config default. |
mergify_cli/stack/push.py |
Implements patch-id based change-type detection, fetching old PR heads, and posting/updating “Revision history” comments. |
mergify_cli/stack/cli.py |
Adds --no-revision-history option wired to the config-driven default. |
mergify_cli/tests/conftest.py |
Updates shared git mock to include the new config key. |
mergify_cli/tests/stack/test_push.py |
Adds extensive unit/integration-style coverage for the new revision history feature paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
367f59a to
992bff3
Compare
When `stack push` force-pushes a PR branch, reviewers have no way to see what changed between the previous and new commits. This adds a "Revision History" comment on each updated PR showing all push iterations with: - Compare links (github.com/owner/repo/compare/old...new) so reviewers can see exactly what changed - Change type labels (content vs rebase) using git patch-id to detect whether the force-push changed actual code or just rebased - Timestamps for each push iteration The feature is enabled by default. Disable per-push with `--no-revision-history` or globally with: git config --global mergify-cli.stack-revision-history false Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Change-Id: Id77b800246f8ba19cebedb75ca9913a790abcc25
992bff3 to
534d779
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.
When
stack pushforce-pushes a PR branch, reviewers have no way to seewhat changed between the previous and new commits. This adds a "Revision
History" comment on each updated PR showing all push iterations with:
can see exactly what changed
whether the force-push changed actual code or just rebased
The feature is enabled by default. Disable per-push with
--no-revision-historyor globally with:git config --global mergify-cli.stack-revision-history false
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com