Skip to content

fix(stack): carry the revision note onto the rewritten commit#1729

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/JulianMaurin/improve-mergify-stack-skill/carry-revision-note-onto-rewritten-commit--0e5503e0
Jul 21, 2026
Merged

fix(stack): carry the revision note onto the rewritten commit#1729
mergify[bot] merged 1 commit into
mainfrom
devs/JulianMaurin/improve-mergify-stack-skill/carry-revision-note-onto-rewritten-commit--0e5503e0

Conversation

@JulianMaurin

@JulianMaurin JulianMaurin commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

A note is addressed by commit SHA, so every rewrite stranded it. The
rebase stack push runs before it reads notes back left the reason on
the pre-rebase SHA, and the revision history recorded a blank Reason;
a plain git commit --amend lost it the same way.

stack setup now adds a local notes.rewriteRef, which is what covers
the rewrites git runs on its own — git commit --amend, and the
git rebase --continue that finishes a conflicted rebase. The CLI's own
rebases pass the same settings with -c so they stay correct in
checkouts whose config predates this, and so a global
notes.rewriteMode=ignore cannot disable the copy. Existing checkouts
pick the config up on their next mergify stack setup.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

@JulianMaurin

JulianMaurin commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 fix(stack): carry the revision note onto the rewritten commit #1729 👈
2 fix(stack): refuse an amend at a rebase conflict pause #1730
3 docs(stack): record what a stack push rebases away in the skill #1724

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections July 20, 2026 13:25 Failure
@mergify

mergify Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 6 merge protections satisfied — ready to merge.

Show 6 satisfied protections

🟢 🤖 Continuous Integration

  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

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

🟢 Enforce conventional commit

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

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

🟢 🔎 Reviews

  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

@mergify
mergify Bot requested a review from a team July 20, 2026 13:32
@JulianMaurin
JulianMaurin changed the base branch from devs/JulianMaurin/improve-mergify-stack-skill/record-what-stack-push-rebases-away-skill--f60237ab to main July 20, 2026 14:35
Copilot AI review requested due to automatic review settings July 20, 2026 14:35
@JulianMaurin
JulianMaurin force-pushed the devs/JulianMaurin/improve-mergify-stack-skill/carry-revision-note-onto-rewritten-commit--0e5503e0 branch from 898bb48 to 4c82e38 Compare July 20, 2026 14:35
@JulianMaurin

JulianMaurin commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial 898bb48 2026-07-20 14:36 UTC
2 content 898bb48 → 4c82e38 (raw) 2026-07-20 14:36 UTC
3 content 4c82e38 → 39b4faa (raw) Copilot review: correct the notes_rewrite_config doc (setup persists only notes.rewriteRef), narrow it to pub(crate), and document notes.rewriteRef on InstallOutcome. 2026-07-20 15:20 UTC

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections July 20, 2026 14:36 Failure
@JulianMaurin
JulianMaurin marked this pull request as ready for review July 20, 2026 14:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes stack note/revision-note loss across rewritten commits by ensuring Git notes under the stack notes ref are copied forward during rebases and other rewrite operations. It does so by persisting notes.rewriteRef in the local repo config via stack setup, and by pinning rewrite behavior via per-invocation git -c ... overrides for the CLI-driven rebases/pulls.

Changes:

  • Add a reusable git -c config bundle to force notes rewrite behavior during CLI-driven rebases.
  • Ensure stack sync’s git pull --rebase path also carries the notes rewrite config.
  • Extend stack setup to add notes.rewriteRef=refs/notes/mergify/stack to local git config and surface that outcome in CLI output, with regression tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
crates/mergify-stack/src/git.rs Adds notes-rewrite -c overrides to scripted rebases and a regression test to ensure stack notes survive rewrites.
crates/mergify-stack/src/commands/sync.rs Applies the notes-rewrite config to the pull --rebase fast-path so notes are preserved there too.
crates/mergify-stack/src/commands/setup.rs Persists notes.rewriteRef in local repo config (for out-of-process rewrites like commit --amend) and adds an idempotency test.
crates/mergify-cli/src/main.rs Prints a confirmation when stack setup adds the new notes.rewriteRef config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/mergify-stack/src/git.rs Outdated
Comment thread crates/mergify-stack/src/git.rs Outdated
Comment thread crates/mergify-stack/src/commands/setup.rs
Comment thread crates/mergify-stack/src/commands/setup.rs
A note is addressed by commit SHA, so every rewrite stranded it. The
rebase `stack push` runs before it reads notes back left the reason on
the pre-rebase SHA, and the revision history recorded a blank `Reason`;
a plain `git commit --amend` lost it the same way.

`stack setup` now adds a local `notes.rewriteRef`, which is what covers
the rewrites git runs on its own — `git commit --amend`, and the
`git rebase --continue` that finishes a conflicted rebase. The CLI's own
rebases pass the same settings with `-c` so they stay correct in
checkouts whose config predates this, and so a global
`notes.rewriteMode=ignore` cannot disable the copy. Existing checkouts
pick the config up on their next `mergify stack setup`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Change-Id: I0e5503e0eeddcc02c689eb78581b8c211b2dd741
@JulianMaurin
JulianMaurin force-pushed the devs/JulianMaurin/improve-mergify-stack-skill/carry-revision-note-onto-rewritten-commit--0e5503e0 branch from 4c82e38 to 39b4faa Compare July 20, 2026 15:20
@mergify
mergify Bot deployed to Mergify Merge Protections July 20, 2026 15:20 Active
@mergify
mergify Bot requested a review from a team July 21, 2026 07:30
@mergify

mergify Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 6 minutes 32 seconds in the queue, including 6 minutes 13 seconds running CI.

Required conditions to merge

@mergify
mergify Bot merged commit 0f5e615 into main Jul 21, 2026
22 of 42 checks passed
@mergify
mergify Bot deleted the devs/JulianMaurin/improve-mergify-stack-skill/carry-revision-note-onto-rewritten-commit--0e5503e0 branch July 21, 2026 07:42
@mergify mergify Bot removed the queued label Jul 21, 2026
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.

4 participants