# Github PR (Pull-Request) Title Prefix Rule (Optional)

**URL:** <https://forum.grin.mw/t/github-pr-pull-request-title-prefix-rule-optional/842>\
**Category:** Development and Technical Discussion\
**Created:** [September 21, 2018, 1:26am UTC](https://forum.grin.mw/t/github-pr-pull-request-title-prefix-rule-optional/842 "2018-09-21T01:26:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gary](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/gary/32/174_2.png) [@gary](https://forum.grin.mw/u/gary)\
**Post date:** [September 21, 2018, 1:26am UTC](https://forum.grin.mw/t/github-pr-pull-request-title-prefix-rule-optional/842/1 "2018-09-21T01:26:37Z")

</div>

It’s recommended that each pull-request give a commit message with a pre-defined prefix, this should be an optional rule.

```nohighlight
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Formatting, missing semi-colons, white-space, etc
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing tests
- chore: Maintain. Changes to the build process or auxiliary tools/libraries/documentation

```

These prefix are part of [Angular.js commit message conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit?pref=2&pli=1#heading=h.uyo6cb12dt6w), and you can take a look at their practice in [Angular.js github project](https://github.com/angular/angular.js/commits/master).

In Grin project, there’s no need to fully follow Angular.js commit message conventions. We just need use these prefixes in each pull-request’s title, that’s all, it’s very simple but with several benefits:

1. It’s very clear to know the type of each PR.
2. Since the PR title is also the git commit message title after it’s merged, it will be very neat when read the git log.
3. We’re doing the binary auto-releasing (check [PR #1540](https://github.com/mimblewimble/grin/pull/1540) for the detail), and it is using automatic change log generating function, thanks to [github-changelog-generator](https://github.com/github-changelog-generator/github-changelog-generator). These change logs are fully automated generated, and this generator heavily rely on the Github \*_issues_ and **pull requests** , so for achieving a neat change log on each release, we need define some simple rules for them.

At the end, regarding **Template** :

- Perhaps a simple **pull-request template** can be set as default in Github, after this proposal is fully reviewed and agree, I will research it later.

Welcome your comments and proposals ~

* * *

Updated at 25th Sep.

- remove the convention proposal regarding to “Fixed” and “Closed” message, looking @antioch comment, and we should stick with github conventions on this part, as this will link issues and PRs and close them as automatically.

---

<div class="post-metadata">

**Author:** ![antioch](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/antioch/32/45_2.png) [@antioch](https://forum.grin.mw/u/antioch)\
**Post date:** [September 21, 2018, 7:24am UTC](https://forum.grin.mw/t/github-pr-pull-request-title-prefix-rule-optional/842/2 "2018-09-21T07:24:18Z")

</div>

> [@gary](#):
>
> BTW, another good idea in that [conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit?pref=2&pli=1#heading=h.uyo6cb12dt6w): When we merge a PR, we can add one line to clarify which `issue` has been fixed or closed by this PR, for example:
> 
> ```auto
> Fixes #16664
> 
> ```
> 
> or for multiple `issues` :
> 
> ```auto
> Fixes #16664, #16688, #16699
> 
> ```
> 
> or by closed:
> 
> ```auto
> Closes #123, #245, #992
> 
> ```

We should stick with the github conventions as this will link issues and PRs and close them as automatically.

> **[Linking a pull request to an issue - GitHub Docs](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)**
>
> You can link a pull request or branch to an issue to show that a fix is in progress and to automatically close the issue when the pull request or branch is merged.

Specifically the syntax for linking multiple issues (which I always mess up) -

> To close multiple issues, preface each issue reference with one of the above keywords. You must use the keyword before each issue you reference for the keyword to work.
> 
> For example, `This closes #34, closes #23, and closes example_user/example_repo#42` would close issues #34 and #23 in the same repository, and issue #42 in the “example\_user/example\_repo” repository.

---

<div class="post-metadata">

**Author:** ![gary](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/gary/32/174_2.png) [@gary](https://forum.grin.mw/u/gary)\
**Post date:** [September 22, 2018, 4:39am UTC](https://forum.grin.mw/t/github-pr-pull-request-title-prefix-rule-optional/842/3 "2018-09-22T04:39:26Z")

</div>

@antioch👍 Yay! I learn a new skill 😄
