Skip to content

[TRUNK-17691] Document custom merge commit titles via PR body directive#456

Open
samgutentag wants to merge 1 commit intomainfrom
sam-gutentag/custom-merge-commit-titles
Open

[TRUNK-17691] Document custom merge commit titles via PR body directive#456
samgutentag wants to merge 1 commit intomainfrom
sam-gutentag/custom-merge-commit-titles

Conversation

@samgutentag
Copy link
Member

Summary

• Added new "Custom merge commit titles" section to the Submit and cancel pull requests page with syntax, examples, and usage guidance
• Updated the FAQ "How does Trunk handle commit messages" to reference the new merge-commit-title: directive
• Added "Custom merge commit titles" subsection under Merge Method in Advanced Settings

Linear tickets

  • No dedicated ticket — will create one

Context links

Files changed

  • merge-queue/using-the-queue/reference.md — new section with syntax and example
  • merge-queue/reference/common-problems.md — updated FAQ answer
  • merge-queue/administration/advanced-settings.md — new subsection under Merge Method

Open questions

  1. Does merge-commit-title: work with rebase merge method, or only squash and merge commit?
  2. Is the directive case-sensitive? (Draft says yes — verify)
  3. Any character or length limits on the custom title?

Test plan

  • Check GitBook preview for all three pages
  • Verify cross-links between pages work
  • Confirm syntax example renders correctly

🤖 Generated with Claude Code

Add docs for the `merge-commit-title:` directive that lets users specify
a custom merge commit title by adding it on its own line in the PR body.
Updates the submit/cancel page, FAQ, and advanced settings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@trunk-staging-io
Copy link

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@samgutentag samgutentag changed the title Document custom merge commit titles via PR body directive [TRUNK-17691] Document custom merge commit titles via PR body directive Mar 12, 2026
@claude
Copy link

claude bot commented Mar 12, 2026

Claude finished @samgutentag's task in 2m 5s —— View job


Review complete

  • Gather context
  • Read changed files
  • Review for typos, grammar, and formatting
  • Review for documentation best practices
  • Post inline comments
  • Finalize review

The documentation additions are well-structured and the cross-linking between pages is a good pattern. I left 5 inline comments:

Blocking concerns:

  • Open question ok #1 (merge method compatibility) — The docs don't scope whether merge-commit-title: works with all three merge methods (Squash, Merge Commit, Rebase). If it doesn't work with Rebase, the current wording is misleading.
  • Open questions ok #2 & Fix links #3 (case sensitivity & length limits) — If these constraints exist, they're undocumented gaps that should be resolved before publishing.

Non-blocking suggestions:

  • Cross-reference path in FAQ (common-problems.md:65) — The link bounces through advanced-settings.md before reaching the primary docs in reference.md. Linking directly to reference.md#custom-merge-commit-titles is cleaner.
  • Grammar nit (reference.md:47) — "want cleaner git history" → "want a cleaner git history"
  • Hint wording (reference.md:58) — "only customizes the commit title" → "only customizes the merge commit title" for consistency with the directive name

Recommend resolving the three open questions in the PR body before merging, as the answers may require edits to the documentation content.

* **Merge Commit**: Preserves all individual commit messages from the PR and creates an additional merge commit message
* **Rebase**: Preserves all individual commit messages from the PR as they are replayed onto the target branch

You can override the merge commit title for any PR by adding `merge-commit-title: Your Custom Title` on its own line in the PR body. See [Custom merge commit titles](../administration/advanced-settings.md#custom-merge-commit-titles) for details.
Copy link

Choose a reason for hiding this comment

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

The cross-reference here links to advanced-settings.md#custom-merge-commit-titles, but that section is a brief summary which itself redirects the reader back to reference.md for "more details and examples." This creates an unnecessary two-hop navigation path for users.

Since the comprehensive documentation (syntax, full example, usage guidance) lives in reference.md, consider linking there directly:

Suggested change
You can override the merge commit title for any PR by adding `merge-commit-title: Your Custom Title` on its own line in the PR body. See [Custom merge commit titles](../administration/advanced-settings.md#custom-merge-commit-titles) for details.
You can override the merge commit title for any PR by adding `merge-commit-title: Your Custom Title` on its own line in the PR body. See [Custom merge commit titles](../using-the-queue/reference.md#custom-merge-commit-titles) for details.


When Trunk merges the PR, it uses this title instead of the default GitHub-generated title. When the directive is not present, the default behavior is preserved.

This is useful for teams that follow conventional commit formats, include ticket numbers in merge commits, or want cleaner git history.
Copy link

Choose a reason for hiding this comment

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

Minor grammar nit: "cleaner git history" should be "a cleaner git history."

Suggested change
This is useful for teams that follow conventional commit formats, include ticket numbers in merge commits, or want cleaner git history.
This is useful for teams that follow conventional commit formats, include ticket numbers in merge commits, or want a cleaner git history.

merge-commit-title: feat(auth): add OAuth2 login flow [PROJ-123]
```

{% hint style="info" %}
Copy link

Choose a reason for hiding this comment

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

The hint says the directive "only customizes the commit title" but it would be clearer to echo the directive name and say "merge commit title" — matching the phrasing used in the heading and throughout the section:

Suggested change
{% hint style="info" %}
The `merge-commit-title:` directive only customizes the merge commit **title**. The commit body follows the usual behavior for your configured [merge method](../administration/advanced-settings.md#merge-method).


## Custom merge commit titles

You can specify a custom merge commit title for any PR by adding a `merge-commit-title:` directive on its own line anywhere in the PR body:
Copy link

Choose a reason for hiding this comment

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

Potential accuracy issue (open question #1 from PR): This sentence doesn't restrict which merge methods the directive applies to, but the PR itself asks: "Does merge-commit-title: work with rebase merge method, or only squash and merge commit?"

If the directive only works with Squash and Merge Commit methods (not Rebase), the docs here will be misleading for users on a Rebase workflow. Before merging, please verify this and either:

  • Confirm it works with all three methods (no change needed), or
  • Add a note scoping it, e.g.: "This directive applies to Squash and Merge Commit methods. It has no effect when using the Rebase merge method."


You can specify a custom merge commit title for any PR by adding a `merge-commit-title:` directive on its own line anywhere in the PR body:

```
Copy link

Choose a reason for hiding this comment

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

Open questions #2 & #3 from PR (case sensitivity & length limits): The docs don't mention whether the directive is case-sensitive or if there are character/length limits on the title value. If these are relevant constraints, they should be documented here or in the hint block. For example:

Note: The directive is case-sensitive — Merge-Commit-Title: will not be recognized. Titles have a maximum length of X characters.

Resolve these before merging to avoid a follow-up correction.

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.

1 participant