Skip to content

git pr merge -s should provide an option to customize commit title #4645

@aduh95

Description

@aduh95

Describe the feature or problem you’d like to solve

When using git pr merge <url> --body "…", the resulting commit has a first line that consists of the PR title and the PR number, and it seems there is no way to customize this (while the web UI allows us to change this line just like the rest of the body).

Proposed solution

I can think of different solution, from the most convenient for my use case to the least:

  • Add a --message and --message-file options (cannot be used with --body not --body-file):
    git pr merge <url> --message "…".
  • Add a separate --commit-title option, separated from the rest of the body, like the web UI and the REST API does:
    git pr merge <url> --commit-title "…" --body "…".

Additional context

In nodejs/node repo, we have some peculiar format rules for our commit messages. For this reason, the process to land a PR is far from ideal: we pull the commit from the contributor PR locally, rebase, add the metadata, force-push to the PR branch, wait a while for GitHub to sync, and finally push to master.
Ideally, we could use the Squash and Merge feature, but using the web UI is tedious, so the CLI would really be ideal.

EDIT: According to GitHub REST API docs, it's called commit_title, so updating my proposal to reflet that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions