mantisbt:git_commit_messages
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
mantisbt:git_commit_messages [2014/05/27 08:25] – dregad | mantisbt:git_commit_messages [2018/02/06 08:35] (current) – [Checklist] Bug reference examples dregad | ||
---|---|---|---|
Line 25: | Line 25: | ||
* Description must be **understandable** for everyone | * Description must be **understandable** for everyone | ||
- **Bug reference** | - **Bug reference** | ||
- | * Optional, but most commits should reference an issue in the [[http:// | + | * Optional, but most commits should reference an issue in the [[http:// |
- **Sign-off** if the commit' | - **Sign-off** if the commit' | ||
Line 69: | Line 69: | ||
Remember to always add a blank line between Summary and Description. | Remember to always add a blank line between Summary and Description. | ||
+ | |||
Line 77: | Line 78: | ||
* '' | * '' | ||
* '' | * '' | ||
+ | |||
+ | === Configuring editor for word wrap === | ||
+ | |||
+ | * **vi/vim** < | ||
+ | |||
==== Description ==== | ==== Description ==== | ||
+ | |||
+ | === Contents === | ||
The commit' | The commit' | ||
Line 95: | Line 103: | ||
* give **credit** to the original author. \\ Use '' | * give **credit** to the original author. \\ Use '' | ||
- | * be **signed off** by the committer if different from author | + | * be **signed off** by the committer if different from author |
- | With regards to formatting | + | === Formatting === |
* Separate paragraphs with 2 newlines | * Separate paragraphs with 2 newlines | ||
Line 106: | Line 114: | ||
- bullet 3 | - bullet 3 | ||
</ | </ | ||
+ | |||
+ | === Sign-off === | ||
+ | |||
+ | When committing changes submitted by non-core team members, the commit must be signed off by the committer in the case of individual commits (use '' | ||
+ | This is not necessary when merging several commits as a feature branch, as the merge commit itself will serve as sign off. | ||
+ | |||
+ | ===== Examples ===== | ||
+ | |||
+ | Based on model message in Tim Pope's blog post (see [[git_commit_messages# | ||
+ | |||
+ | < | ||
+ | Capitalized, | ||
+ | |||
+ | More detailed explanatory text, if necessary, wrapped to 72 characters. | ||
+ | In some contexts, the first line is treated as the subject of an email | ||
+ | and the rest of the text as the body. The blank line separating the | ||
+ | summary from the body is critical (unless you omit the body entirely); | ||
+ | tools like rebase can get confused if you run the two together. | ||
+ | |||
+ | Write your commit message in the imperative: "Fix bug" and not "Fixed | ||
+ | bug" or "Fixes bug." This convention matches up with commit messages | ||
+ | generated by commands like git merge and git revert. | ||
+ | |||
+ | You can have the Source Integration plugin automatically reference | ||
+ | mantisbt.org issues #1234, #1235 (the changeset will be linked to the | ||
+ | issues when pushed). | ||
+ | |||
+ | Further paragraphs come after blank lines. | ||
+ | |||
+ | - Bullet points are okay, too | ||
+ | - Typically a hyphen or asterisk is used for the bullet | ||
+ | - Add blank lines between bullets if needed for clarity | ||
+ | - Use a hanging indent when a bullet' | ||
+ | single line | ||
+ | |||
+ | Fixes #5678 (commit will be linked to the issue, which will be marked as | ||
+ | resolved when pushing the commit). | ||
+ | |||
+ | Signed-off-by: | ||
+ | </ | ||
+ | |||
===== References ===== | ===== References ===== | ||
Line 115: | Line 164: | ||
* [[https:// | * [[https:// | ||
* [[http:// | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | ===== To do ===== | ||
+ | |||
+ | Grangeway suggested to implement a commit hook to perform validation on commit message, e.g. | ||
+ | http:// | ||
mantisbt/git_commit_messages.1401193509.txt.gz · Last modified: 2014/05/27 08:46 (external edit)