Skip to content

Allow setting commit title defaults in gh repo edit #8320

Closed as duplicate

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

Activity

  1. samcoe commented on Nov 13, 2023

    @samcoe
    Contributor

    @TWiStErRob Thanks for the feature request, I think it would make a nice improvement to allow for setting the default title and body for squash and merge commits. I do not think that changing the --enable-squash-merge and --enable-merge-commit flags is the right approach though. I think that would overload those flags making them confusing along with being a backwards incompatible change.

    I would rather have flags that match the API --squash-merge-commit-title, --squash-merge-commit-message, --merge-commit-title, and --merge-commit-message. What do you think?

  2. added
    more-info-neededMore info needed from user/contributor
    gh-reporelating to the gh repo command
    and removed on Nov 13, 2023
  3. TWiStErRob commented on Nov 13, 2023

    @TWiStErRob
    ContributorAuthor

    I was thinking of augmenting because there's a dependency between the merge type (e.g. squash) being on and the title/body setting. Although nothing preventing us from setting the body/title and then turning the merge type off, so maybe the dependency is only on the UI.

    Your argument makes sense though, that's what I meant by "4 separate options". Happy to get the ability in any way. :)

  4. added and removed
    more-info-neededMore info needed from user/contributor
    on Nov 13, 2023
  5. igallart commented on Feb 8, 2024

    @igallart

    Hi, is there any date if it will be implemented? I think it is important when you want to switch to many repositories massively.

  6. VOVELEE commented on Feb 13, 2024

    @VOVELEE

    Any updates? It will be nice feature for batch changes

  7. arifbalik commented on Aug 7, 2024

    @arifbalik

    I would love to see this added for the new release

  8. BagToad commented on Feb 4, 2025

    @BagToad
    Member

    A PR to resolve this was merged, but quickly reverted because #10363 (comment)

    Closing as duplicate of #10092 because that is where the current core team has discussed and produced more thorough Acceptance Criteria for this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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