Skip to content

fix(v4): prefer "Create a merge commit" on next/hotfixes; dedupe stacked-PR commits - #47

Merged
Shinrai merged 1 commit into
nextfrom
fix/v4-prefer-merge-and-dedupe
May 26, 2026
Merged

Shinrai merged 1 commit into
nextfrom
fix/v4-prefer-merge-and-dedupe

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

  • fix(v4): prefer "Create a merge commit" on next/hotfixes; dedupe stacked-PR commits (c552494)

🔧 Other Changes

No other changes

👥 Contributors

@cldmv-bot cldmv-bot Bot added area: core type: documentation Relates to docs, README updates, guides, or inline code comments labels May 26, 2026
…ked-PR commits

**Two related fixes — same root cause: signatures.**

GitHub's "Rebase and merge" web-UI button re-creates the PR's commits
server-side and strips their GPG signatures. Every rebased commit lands on
the target unsigned, even when the source PR's commits were all signed.
This is a documented GitHub limitation; there's no setting to make
rebase-merge preserve signatures.

To keep signed commits on `next`/`hotfixes`, only "Create a merge commit"
is allowed there now. It keeps the PR's original commits intact (signatures
preserved) and adds a single merge commit on top. master stays squash —
each release still lands as one clean signed commit.

**Ruleset generator** (`docs/tools/ruleset-generator/`):

- `buildNext` / `buildHotfix`: `mergeMethods` → `["merge"]` (was `["rebase", "squash"]`).
- Comments + index.html notes explain why and call out the signature-strip
  behavior so a maintainer who sees a "Rebase and merge" button in some
  consumer repo with looser settings knows to avoid it.

**Changelog generator dedup** (`.github/actions/git/steps/generate-comprehensive-changelog/action.mjs`):

With merge commits, a stacked PR's source branch contains the earlier
PR's commits via the original SHAs. The `base..head` range then includes
them in the rendered changelog even though they're already on the target
(via the earlier PR's merge commit). Patch-id-based dedup via `git cherry`
identifies those duplicates and drops them from the body:

  filterAlreadyAppliedByPatchId(commits, "base..head")
    runs `git cherry <base> <head>`, parses `-` lines (patch already on
    base), filters those SHAs out of the commits array.

The release-to-master changelog (master..next range) is unaffected: master
has no equivalent patches for commits between releases, so `git cherry`
marks everything as `+` and the dedup is a no-op there.

**Out-of-scope for this commit but documented elsewhere:** the existing 3
unsigned commits on `next` (from the earlier rebase-merge experiment) are
historical artifacts. They'll be absorbed into the next master squash —
the resulting release commit on master is signed, so the published line
is clean. If we want to force-fix `next` itself, that's a separate
admin-bypass force-push operation, not part of this code change.
@Shinrai
Shinrai force-pushed the fix/v4-prefer-merge-and-dedupe branch from e0a1200 to c552494 Compare May 26, 2026 21:00
@Shinrai
Shinrai merged commit ff4207b into next May 26, 2026
7 checks passed
@cldmv-bot
cldmv-bot Bot deleted the fix/v4-prefer-merge-and-dedupe branch May 26, 2026 21:06
Shinrai added a commit that referenced this pull request May 26, 2026
…#40)

## 🚀 What's Changed

### 💥 Breaking Changes
_No breaking changes_

### ✨ Features

- #41 (5fb9ffb)
- feat(redirect-hotfix-pr): redirect Dependabot security PRs to the
hotfix lane (c4e4c89)

### 🐛 Bug Fixes

- #48 (7d06c21)
- fix(changelog): drop merge commits from release-PR changelog (7ccdfde)

- #47 (ff4207b)
- fix(v4): prefer "Create a merge commit" on next/hotfixes; dedupe
stacked-PR commits (c552494)

- #44
- fix(v4): per-branch merge methods + PR-ref annotation in release-PR
changelogs (29637d7)
- fix(rulesets): move Copilot review next/hotfixes; allow squash as
fallback (26dcea8)
- fix(changelog): drop redundant precondition check in
findAssociatedPullNumber (ea01889)

- #41 (5fb9ffb)
- Potential fix for pull request finding 'CodeQL / Missing regular
expression anchor' (329f7fe)

- #39 (91ddf1f)
- fix(cla): audit tool walks both default and override signature trees
(84ecbed)
- fix(cla): pass public_cla_url_template through reusable workflow;
document override behavior (97bb8d2)
- fix(cla): bot reads CLA from ledger (default) or consumer override;
per-text-hash scope (132bcb7)
- fix(cla): remove root CLA.md; bot must use the central ledger as
source (f01b007)

### 🔧 Other Changes

- #46 (454b724)
- docs(readme): modernize for v4; drop stale v3-launch markers; fix
ruleset-generator links (d09fdb8)

- #43 (417f110)
- docs(embedded-tests): surface the embedded-tests-ci feature in
onboarding (27a82f6)

- #42 (47a9ee4)
- chore(dependabot): add v4-tuned dependabot.yml template + update
auto-merge wiring (d52b60e)

- #39 (91ddf1f)
- docs(cla): describe override scope across all onboarding + reference
docs (7a25d06)

- #38 (9527fef)
- docs(cla): reframe public sample CLA, drop mirror-of-private framing
(549263a)
  - chore(cla): seed real CLA text + add boilerplate files (730a90e)


<details>
<summary>👥 Contributors</summary>

- @Shinrai

</details>

---------

Co-authored-by: Nate Corcoran <[email protected]>
Co-authored-by: cldmv-bot[bot] <230771808+cldmv-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: documentation Relates to docs, README updates, guides, or inline code comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant