├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Planning Center Online 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Commit Guidelines 2 | Mostly reasonable guidelines for commit messages. 3 | 4 | ## Commit Message Format 5 | Commit messages consist of a [message](#message), [description](#description) 6 | and [related](#related). 7 | 8 | ``` 9 | 10 | 11 | 12 | 13 | 14 | ``` 15 | 16 | A [message](#message) consists of a [type](#type), [scope](#scope), and 17 | [subject](#subject). 18 | 19 | No line should be longer than 80 characters long, for optimal github viewing. 20 | 21 | ## Message 22 | ``` 23 | (): 24 | ``` 25 | 26 | Examples: `refactor(plans#show): remove 1 of 4 templating languages` 27 | 28 | ### Type 29 | * `feat`: New feature 30 | * `fix`: Bug fix 31 | * `format`: Change not affecting the **meaning** of code (white-space, formatting, etc) 32 | * `docs`: Documentation-**only** change 33 | * `style`: Stylesheet-**only** change 34 | * `refactor`: Change that neither fixes a bug or adds a feature 35 | * `perf`: Change that improves performance 36 | * `test`: Addition of a missing test 37 | * `chore`: Changes to the build process or auxiliary tools and libraries 38 | 39 | ### Scope 40 | The scope could be anything specifying the site of the commit change. For 41 | example `plans#show`, `PlanPerson`, `LiveChatMessageList`, `.tab-list`, etc... 42 | 43 | ### Subject 44 | The subject contains a succinct description of the change: 45 | 46 | * use the imperative, present tense: "change" not "changed" nor "changes" 47 | * don't use capitalize first letters 48 | * don't use trailing punctuation (.) 49 | 50 | ### Description 51 | Just as in the [subject](#subject), use the imperative, present tense: "change" 52 | not "changed" nor "changes" The body should include the motivation for the 53 | change. 54 | 55 | ### Related 56 | The footer should contain any information about **Breaking Changes** and is the 57 | place to reference Trello cards, or GitHub issues that the commit **Closes**. 58 | 59 | ### Attribution 60 | This guide is ~~pirated from~~ inspired by Angular's excellent 61 | [CONTRIBUTING.md](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines). 62 | 63 | A detailed explanation can be found in this [document][commit-message-format]. 64 | 65 | [commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit# 66 | 67 | ## `fixup` commits 68 | 69 | Your stuff's on staging but you're making small, progressive tweeks. `fixup` is your friend. 70 | 71 | Fixup commits are associated with commit you've already made. They allow you to make commits without inserting additional messages. They can also be automatically squashed, for those civilized developers. 72 | 73 | Here's how it works. `commit` takes `--fixup` as on option. When used, you'll have to provide the SHA of the commit your is fixing up. Like so: 74 | 75 | ```bash 76 | git commit --fixup a9b8c7 77 | 78 | # aliases also work but get confusing after your first fix 79 | 80 | git commit --fixup head 81 | ``` 82 | 83 | You probably don't memorize your recent commit SHAs. You can use the syntax below as a backword search. This fixup commit will attach to the most recent commit, where "style" is in the message: 84 | 85 | ```bash 86 | git commit --fixup :/style 87 | ``` 88 | --------------------------------------------------------------------------------