Skip to content

Commit e713b07

Browse files
committed
Merge pull request #4340 from angular-ui/JLLeitschuh-patch-3
Adds Commit Message Guidelines to Changelog
2 parents 858b4af + 8e62d85 commit e713b07

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

CONTRIBUTING.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,65 @@ included in the project:
144144

145145
**IMPORTANT**: By submitting a patch, you agree to allow the project owners to
146146
license your work under the the terms of the [MIT License](LICENSE.md).
147+
148+
## <a name="commit"></a> Git Commit Guidelines
149+
150+
We have very precise rules over how our git commit messages can be formatted. This leads to **more
151+
readable messages** that are easy to follow when looking through the **project history**. But also,
152+
we use the git commit messages to **generate the AngularJS change log**.
153+
154+
### Commit Message Format
155+
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
156+
format that includes a **type**, a **scope** and a **subject**:
157+
158+
```
159+
<type>(<scope>): <subject>
160+
<BLANK LINE>
161+
<body>
162+
<BLANK LINE>
163+
<footer>
164+
```
165+
166+
The **header** is mandatory and the **scope** of the header is optional.
167+
168+
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
169+
to read on GitHub as well as in various git tools.
170+
171+
### Revert
172+
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
173+
174+
### Type
175+
Must be one of the following:
176+
177+
* **feat**: A new feature
178+
* **fix**: A bug fix
179+
* **docs**: Documentation only changes
180+
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
181+
semi-colons, etc)
182+
* **refactor**: A code change that neither fixes a bug nor adds a feature
183+
* **perf**: A code change that improves performance
184+
* **test**: Adding missing tests
185+
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation
186+
generation
187+
188+
### Scope
189+
The scope could be anything specifying place of the commit change. For example `core`,
190+
`infinite-scroll`, `pagination`, `cellnav`, `edit`, `importer`, `pinning`, etc...
191+
192+
### Subject
193+
The subject contains succinct description of the change:
194+
195+
* use the imperative, present tense: "change" not "changed" nor "changes"
196+
* don't capitalize first letter
197+
* no dot (.) at the end
198+
199+
### Body
200+
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
201+
The body should include the motivation for the change and contrast this with previous behavior.
202+
203+
### Footer
204+
The footer should contain any information about **Breaking Changes** and is also the place to
205+
reference GitHub issues that this commit **Closes**.
206+
207+
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
208+

0 commit comments

Comments
 (0)