Skip to content

Instantly share code, notes, and snippets.

@nhevia
Created August 21, 2020 11:16
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nhevia/937973c767da5840f47f91e9ef23eb9e to your computer and use it in GitHub Desktop.
Save nhevia/937973c767da5840f47f91e9ef23eb9e to your computer and use it in GitHub Desktop.
Counts semantic git commits
git log --pretty=oneline --no-merges --since 2019/01/01 --until 2021/12/31 | cut -d " " -f 2 |\
cut -d "(" -f 1 | cut -d ":" -f 1 | sort -r | uniq -c | sort -nr -k1
@nhevia
Copy link
Author

nhevia commented Aug 21, 2020

For using in repositories with semantic commits (ex: "fix: login form" or "refactor: extracted prompt user modal")

Counts total commit categories given a date range.

Expected result:
image

Recommended verbs:

  • feat: (new feature for the user, not a new feature for build script)
  • fix: (bug fix for the user, not a fix to a build script)
  • docs: (changes to the documentation)
  • style: (formatting, missing semi colons, etc; no production code change)
  • refactor: (refactoring production code, eg. renaming a variable)
  • test: (adding missing tests, refactoring tests; no production code change)
  • chore: (updating grunt tasks etc; no production code change)
  • prog: (useful for <v1.0 progress that does not fall into any other category)

Edit: prog is a non-default addition that I find particularly helpful.

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