Skip to content

Do not recommend to gh- prefix in commit message #841

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

Merged
merged 2 commits into from
Apr 20, 2022
Merged

Conversation

methane
Copy link
Member

@methane methane commented Apr 17, 2022

If we add gh- prefix to each commits, many spammy notification send to the issue.
See this ecample:

image

We should recommend gh- prefix only in pull request title (and merge commit title).

pullrequest.rst Outdated
@@ -346,7 +346,7 @@ Now you want to
<https://help.github.com/articles/creating-a-pull-request-from-a-fork/>`_.
If this is a pull request in response to a pre-existing issue on the
`issue tracker`_, please make sure to reference the issue number using
``gh-NNNN`` in the pull request title or message.
``gh-NNNNN: `` in the pull request title.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently GitHub ignores the gh-NNNNN: in the title, so a gh-NNNNN in the message helps adding an event in the issue timeline. We should recommend both (at least until GitHub fixes title mentions:

Suggested change
``gh-NNNNN: `` in the pull request title.
``gh-NNNNN: `` in the pull request title and `gh-NNNNN` in the issue body.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have gh-NNNNN in title, how about just #NNNNN in body?

GitHub doesn't contain pull request body in squash commit message by default.
So #NNNNN won't be contained in the commit message.

If core developer copy&paste the pull request message to squash commit message, they would just trim the #NNNNN. They don't need to rewrite it to gh-NNNNN form because it is included in the first line of the commit message already.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have gh-NNNNN in title, how about just #NNNNN in body?

That works too. The goal of adding it in the body is just to reference the issue and create an event there, and both gh-NNNNN and #NNNNN work.

@ezio-melotti
Copy link
Member

Since PRs are squash-merged, I agree that we don't need to include the issue number in every commit. Before the merge the commits will be already contextualized within the branch/PR (so the issue number is known). After the squash-merge the commit message will link back to the PR, and from the PR it's easy to find the issue.

Should we recommend to add the gh-NNNNN: to the squash-merge commit message even though the PR is already linked?

@methane methane merged commit bd1737b into main Apr 20, 2022
@methane methane deleted the remove-commit-prefix branch April 20, 2022 02:44
@@ -346,7 +346,7 @@ Now you want to
<https://help.github.com/articles/creating-a-pull-request-from-a-fork/>`_.
If this is a pull request in response to a pre-existing issue on the
`issue tracker`_, please make sure to reference the issue number using
``gh-NNNN`` in the pull request title or message.
``gh-NNNNN: `` in the pull request title and ``#NNNNN`` in the description.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that a space inside a code block escapes the following double-backtick:

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I fixed it in #844.

AA-Turner pushed a commit to AA-Turner/devguide that referenced this pull request Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants