Skip to content

PR merge should allow to choose how to format the commit message #1621

@giacomoalbe

Description

@giacomoalbe

Describe the feature or problem you’d like to solve

gh pr merge is GREAT, it speeds up my workflow a lot, but I find it very annoying that the commit message of the squashed merge action is the last HEAD commit instead of being the PR name/title.

On the website I can change the PR commit message when I'm about to merge it, but using the CLI it's not possible.

Proposed solution

Proposed solution would be to have a preview of the commit message directly inside the CLI, with the ability to choose how to format the commit.

I propose to have 3 different options:

  • PR name (the title which is displayed on the website)
  • Last commit (the current behaviour)
  • Custom message

I don't know if this is something which is to be configured directly in Github settings, but this will greatly benefit the workflow, since I could have in the repo history a way more useful message than the last commit on the HEAD branch (which might be, as usually happens to me, "rebasing master" or "fix linting" or something similar, whereas the message should have been "Add validation logic to Resource (#7)")

Additional context

I would be more than happy to contribute to this feature myself, I'd simply need some guidance since I'm not an expert in either Github GraphQL API or Golang.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions