Skip to content

Instantly share code, notes, and snippets.

@0m15
Last active February 5, 2020 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0m15/b34fd66dd4c85c716d00f00554586970 to your computer and use it in GitHub Desktop.
Save 0m15/b34fd66dd4c85c716d00f00554586970 to your computer and use it in GitHub Desktop.
A shorter, easy to read git commit message format syntax

Premise

I find it tedious to write commit messages. The common practice is to use a verbose commit message, where the first word is a verb describing what the commit did do, for example:

  • Add editable title on <ArticleEdit /> component
  • Hotifx: Handle authentication failed for expired token
  • Fix typo in about us page
  • Remove unused css

Proposal

I propose here a new syntax I'm using that makes thing easy to understand later and to write.

It's based on 4 symbols:

  • + ADD
  • - REMOVE/STRIP
  • * REVIEW/CORRECT/FIX
  • ! HOTFIX

So, here are the examples messages above, rewritten with the proposed syntax style:

  • + editable title in <ArticleEdit>
  • ! expired token in Authentication
  • * typo in about us page
  • - unused css

By forcing to use those symbols (and/or integrating your own), I clearly see some advantages:

  • Navigate and search git log easier
  • Easily extrapolate stats and analysis from commit history
  • Think less about commit message
  • Remove the use of synonyms

What do you think about?

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