Skip to content

Instantly share code, notes, and snippets.

@Necior
Last active December 24, 2016 20:03
Show Gist options
  • Save Necior/ead790235a8ac65c0bf4932f3ed70261 to your computer and use it in GitHub Desktop.
Save Necior/ead790235a8ac65c0bf4932f3ed70261 to your computer and use it in GitHub Desktop.
My preferred commit message style

My preferred commit message style

  • first line should be a short, informative description of what a patch does;
  • use imperative mood, as Kernel documentation says (starting at line 112):

Describe your changes in imperative mood, e.g. "make xyzzy do frotz" instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy to do frotz", as if you are giving orders to the codebase to change its behaviour.

It’s also a good idea to use the imperative present tense in these messages. In other words, use commands. Instead of “I added tests for” or "Adding tests for," use "Add tests for."

  • 50 characters is a soft limit of the first line;
  • put a blank line after the subject, then write message body (i.e. detailed description);
  • don't exceed 72 characters.

Additional links/discussions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment