Skip to content

Allow setting commit title defaults in gh repo edit #8320

@TWiStErRob

Description

@TWiStErRob

Describe the feature or problem you’d like to solve

I would like to be able to call gh repo edit ... to set these flags on the repository:

  • Allow squash merging (--enable-squash-merge):
    • squash_merge_commit_title=PR_TITLE|COMMIT_OR_PR_TITLE
    • squash_merge_commit_message=PR_BODY|COMMIT_MESSAGES|BLANK
  • Allow merge commits (--enable-merge-commit):
    • merge_commit_title=PR_TITLE|MERGE_MESSAGE
    • merge_commit_message=PR_BODY|PR_TITLE|BLANK

Note: ignore use_squash_pr_title_as_default as it's deprecated.

Proposed solution

Modify https://github.com/cli/cli/blob/trunk/pkg/cmd/repo/edit/edit.go

Augment gh repo edit --enable-squash-merge option to allow for values other than =false, e.g. --enable-squash-merge=pr-title-and-body. Same for --enable-merge-commit.

or

Create 4 new separate options to mirror the Repository REST API.

Additional context

Issue is about setting these dropdowns from CLI:
image
image

For SEO the values of the dropdown are:

  • Default message
  • Default to pull request title
  • Default to pull request title and commit details
  • Default to pull request title and description

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-reporelating to the gh repo commandhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions