Skip to content

Instantly share code, notes, and snippets.

@zoxon
Forked from d-simon/mini_commit_guidelines.md
Created December 22, 2016 03:05
Show Gist options
  • Save zoxon/c5c420e2847d278d8ea709360271bff9 to your computer and use it in GitHub Desktop.
Save zoxon/c5c420e2847d278d8ea709360271bff9 to your computer and use it in GitHub Desktop.

#Commit Message Guidelines (Shortened) This is a revamped proposal for structuring commit messages. It is a set of guidelines evolved from a need to scan, review and navigate commits quickly. They are ment to bring clarity to the commit history while retaining a lot of flexibility.

#Structure

[Action] Scope: Summary

Detailed Body Text (if necessary)

(Involved Commits)

The scope can be many things. File(s), Components, Sub-Systems. In fact, any conceptual unit or scope that the commit applies to. It can be left away if deemed unnecessary (e.g. on feature branches).

The summary as well as body text lines should be kept below 70–80 characters by manually wrapping the lines. (Github "elipsizes" at 70 chararacters. Often mentioned are 70 or 72)

##Action Keywords

This is a list of proposed action keywords. It is in no way a definitive list. Rather, it reflects my personal findings of required keywords I have encountered. Others have been left away for their infrequent use i.e. Init or their ambiguity i.e. Cleanup. A keyword length of 4-6 letters is recommended where possible.

  • Update
  • Fix
  • Refactor
  • Chore
  • Merge
  • (WIP)
  • Feature / Release – use Merge instead
  • Docs — use Chore instead
  • Revert – use Fix instead
  • Test – use Update instead

Update

Update: A generic update that involves changes and does not fit any other category.

Fix

Fix: Code fixes and bug fixes

Refactor

Refactor: Refactoring changes that do not change functionality per se.

Chore

Chore: Includes Cleanup, whitespace, formatting, old dependencies etc. Should not change functionality.

Merge

Merge: Branch merges. Includes a list of merged commits.

WIP

WIP: Work in Progress – Ideally we should not use this. Realistically you will need to make incomplete commits at some point. Use this to warn about the incomplete state your commit causes.

Samples

[Merge] Header: Add header element

[Update] header: Move main-nav a bit to the bottom
[Update] service-nav: Add structure/module file
[Fix] Reference: Change reference from all.scss to main.scss in index.html.erb.
[Refactor] Structure: Move styles for main-nav / header into their own files
[Update] Header: Initial strucutre
[Update] Grid: Adjust breakpoints / Import container size configuration

Conflicts:
source/assets/css/main.sass
source/index.html.erb

...

[Fix] serviceBus: Add missing check for argument of complete() method

This resolves issue#2756 where some components were receiving errors
because the complete method did not check for it's arguments and
optimistically proceeded with the callback execution.

The solution was to add an integrity check for the passed arguments to
the complete() method.

##Other Guidelines

Capitalized, short (50 chars or less) summary

More detailed explanatory text, if necessary.  Wrap it to about 72
characters or so.  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.

Further paragraphs come after blank lines.

- Bullet points are okay, too

- Typically a hyphen or asterisk is used for the bullet, followed by a
  single space, with blank lines in between, but conventions vary here

- Use a hanging indent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment