Skip to content

feat(stack): add revision history comments for force-pushed PRs#1156

Open
jd wants to merge 1 commit intomainfrom
devs/jd/worktree-stack-review/Id77b800246f8ba19cebedb75ca9913a790abcc25
Open

feat(stack): add revision history comments for force-pushed PRs#1156
jd wants to merge 1 commit intomainfrom
devs/jd/worktree-stack-review/Id77b800246f8ba19cebedb75ca9913a790abcc25

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented Apr 14, 2026

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

Copilot AI review requested due to automatic review settings April 14, 2026 13:55
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 14, 2026 13:55 Failure
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 14, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 👀 Review Requirements

Waiting for:

  • #approved-reviews-by>=2
This rule is failing.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🔴 🔎 Reviews

Waiting for:

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@mergify mergify bot requested a review from a team April 14, 2026 14:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jd jd marked this pull request as ready for review April 14, 2026 14:38
@jd jd force-pushed the devs/jd/worktree-stack-review/Id77b800246f8ba19cebedb75ca9913a790abcc25 branch from 367f59a to 992bff3 Compare April 14, 2026 15:11
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 14, 2026 15:12 Failure
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
@jd jd force-pushed the devs/jd/worktree-stack-review/Id77b800246f8ba19cebedb75ca9913a790abcc25 branch from 992bff3 to 534d779 Compare April 14, 2026 15:30
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 14, 2026 15:34 Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants