Skip to content
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

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

Closed
aduh95 opened this issue Oct 29, 2021 · 1 comment
Closed

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

aduh95 opened this issue Oct 29, 2021 · 1 comment
Labels
enhancement a request to improve CLI

Comments

@aduh95
Copy link

aduh95 commented Oct 29, 2021

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.

@aduh95 aduh95 added the enhancement a request to improve CLI label Oct 29, 2021
@aduh95 aduh95 changed the title git pr merge -s should provide an option to customize first line of commit message git pr merge -s should provide an option to customize commit title Oct 30, 2021
@mislav
Copy link
Contributor

mislav commented Nov 2, 2021

Thanks for the suggestion! Duplicate of #1023 (comment)

@mislav mislav closed this as completed Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a request to improve CLI
Projects
None yet
Development

No branches or pull requests

2 participants