Skip to content

Instantly share code, notes, and snippets.

@xero
Last active August 21, 2023 12:58
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xero/7af221436757237cbb76990377f330ef to your computer and use it in GitHub Desktop.
Save xero/7af221436757237cbb76990377f330ef to your computer and use it in GitHub Desktop.
bb commit style guide :: how we liven up the commit history

semantic commit messages

see how a minor change to your commit message style can make you a better programmer self generate {docs,changelog}, add context to the changeset, enable filtering (e.g. ignore styling or documentation changes), and liven up the commit history!

format: <type>(<scope>): <ticket> subject :emoji:

  • <scope>
    • optional
    • some changes are global or difficult to assign to a single component
  • <ticket>
    • optional
    • not all commits exist w/in the context of a jira ticket
  • :emoji:
    • required ;P

brandingbrand example

feat(hat): JIRA-2313 add wobble :tophat:
.--- .--   .-------- .--------- .-------
|    |     |         |          |
|    |     |         |          '-> emoji
|    |     |         |      
|    |     |         '--> summary in present tense
|    |     |
|    |     '-----> jira ticket id
|    |
|    '-------> scope of the changeset
|
'--------> type: chore, docs, feat, fix, refactor, style, or test
  • feat(logging): INFENG-583 add outbound sender header πŸ“€
  • fix(tcptraceroute): DEVOPS-5790 conditional guarding 🚨
  • docs(examples): BBTIME-3 update πŸ“’
  • style(beautify): beautify single line json file 🎨
  • refactor(email): DSGR-4843 recipient visibility πŸ‘“
  • test(examples): add webhook.json β†ͺ️
  • chore(version): bump package json πŸ’Ύ

scoped examples

feat(hat): add wobble
.--- .--   .---------
|    |     |
|    |     '--> summary in present tense
|    |
|    '--------> scope of changeset
|
'-------------> type: chore, docs, feat, fix, refactor, style, or test
  • feat(config): add required settings
  • fix(tcptraceroute): conditional guarding πŸ›
  • docs(examples): add deployment links ⛓️
  • style(beautify): beautify single line json file 🎨
  • refactor(logging): update output formatting πŸ“‘
  • test(examples): add webhook.json β†ͺ️
  • chore(version): bump package json πŸ’Ύ

simple examples

feat: add hat wobble
.---  .-------------
|     |
|     '-> summary in present tense.
|
'-------> type: chore, docs, feat, fix, refactor, style, or test.
  • 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

hail mary

use case: last resort

format: :lone_emoji:

  • πŸ”§

cite

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