-
Notifications
You must be signed in to change notification settings - Fork 13
[TRUNK-17691] Document custom merge commit titles via PR body directive #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -34,6 +34,31 @@ trunk login | |||||
| trunk merge cancel <pr-number> | ||||||
| ``` | ||||||
|
|
||||||
| ## 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: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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:
|
||||||
|
|
||||||
| ``` | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
Resolve these before merging to avoid a follow-up correction. |
||||||
| merge-commit-title: Your Custom Commit Title Here | ||||||
| ``` | ||||||
|
|
||||||
| 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. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||||||
|
|
||||||
| ### Example | ||||||
|
|
||||||
| ```markdown | ||||||
| ## Description | ||||||
| This PR adds user authentication. | ||||||
|
|
||||||
| merge-commit-title: feat(auth): add OAuth2 login flow [PROJ-123] | ||||||
| ``` | ||||||
|
|
||||||
| {% hint style="info" %} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||||||
| The `merge-commit-title:` directive only customizes the commit **title**. The commit body follows the usual behavior for your configured [merge method](../administration/advanced-settings.md#merge-method). | ||||||
| {% endhint %} | ||||||
|
|
||||||
| ## Pull request processing | ||||||
|
|
||||||
| Once a PR is submitted to the merge queue it goes through several states. First, it starts as _Queued_ until all of the required conditions to submit it are met. Once ready, the PR moves to the _Pending_ state, waiting for a Merge Queue to pick it up, and then enters the _Testing_ state. Once the tests pass the PR may still need to wait for upstream PRs. Once any upstream PRs are complete the PR will be merged and then removed from the Merge Queue. If a PR fails or is canceled then it will go to the failed or canceled state. | ||||||
|
|
||||||
There was a problem hiding this comment.
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 toreference.mdfor "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: