Skip to content

gh pr create: Put constituent commit messages as comments in the body #8018

Description

@joeshaw

Describe the feature or problem you’d like to solve

When opening a pull request and editing the body of the request, I wish the commit messages were available in the editor.

This is a feature I miss from hub. When you'd run hub pull-request create and the editor was opened, there was a section:

# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.

And below it would be all the commit messages that make up this pull request.

While --fill-first is nice, I often want to incorporate other commit messages into my pull request description. The hub way of doing this made that very easy to do. As it is today, I find myself running git log in a terminal window and cut-and-pasting today.

Proposed solution

An identical implementation to hub's would be fine with me. There may be other ways to achieve the same outcome.

Activity

  1. joeshaw commented on Sep 18, 2023

    @joeshaw
    Author

    I opened this after coming across #7575. I wasn't able to find an existing issue related to it.

  2. williammartin commented on Sep 19, 2023

    @williammartin
    Member

    Hey @joeshaw, thanks for your ideas to improve the CLI.

    Have you tried using --fill (not --fill-first) which should create a body that includes all commits? It might not be totally satisfactory for your flow since I think you'll need to provide --web as well in order to have an opportunity to edit the message before submission, but it might get you most of what you want?

  3. added
    more-info-neededMore info needed from user/contributor
    gh-prrelating to the gh pr command
    and removed on Sep 19, 2023
  4. joeshaw commented on Sep 19, 2023

    @joeshaw
    Author

    Thanks. --fill is what I currently use most of the time, actually, having only just discovered --fill-first yesterday.

    It only gives you the summary line of each commit. I'd like access to the entire message.

  5. williammartin commented on Sep 19, 2023

    @williammartin
    Member

    Understood, I've added this to the tracking issue. We're extremely hesitant right now to make changes to the pr commands because they are very complex and confusing already already.

  6. added
    coreThis issue is not accepting PRs from outside contributors
    and removed
    more-info-neededMore info needed from user/contributor
    on Sep 19, 2023
  7. joeshaw commented on Sep 19, 2023

    @joeshaw
    Author

    Maybe an alternative could be to add a --edit flag, which would always open the editor even if --fill or --fill-first or --body or --body-file were provided. That way I could construct the content that I wanted (probably by piping in output from git log) into a file that I could then edit.

  8. adrian-gierakowski commented on Mar 22, 2024

    @adrian-gierakowski

    Maybe an alternative could be to add a --edit flag, which would always open the editor even if --fill or --fill-first or --body or --body-file were provided. That way I could construct the content that I wanted (probably by piping in output from git log) into a file that I could then edit.

    yes please, I'd like to migrate from hub but not being able to edit my PR description in an editor before submitting is non-starter

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

    coreThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIgh-prrelating to the gh pr command

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions