DevOps Discussion Git Others

Angular Git commit message convention

There is no strict rule when we write commit messages.
Using certain convention for commit messages will give several advantages.

Angular team is using precise message format, which is clean and easy to look, contains only mandatary information.

Goals

  • allow generating CHANGELOG.md by script
  • allow ignoring commits by git bisect (not important commits like formatting)
  • provide better information when browsing the history

Format of the commit message

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on github as well as in various git tools.

Subject line

Subject line contains succinct description of the change.

Allowed <type>

  • feat (feature)
  • fix (bug fix)
  • docs (documentation)
  • style (formatting, missing semi colons, …)
  • refactor
  • test (when adding missing tests)
  • chore (maintain)

Allowed <scope>

Scope could be anything specifying place of the commit change. For example $location, $browser, $compile, $rootScope, ngHref, ngClick, ngView, etc…

<subject> text

  • use imperative, present tense: “change” not “changed” nor “changes”
  • don’t capitalize first letter
  • no dot (.) at the end

Message body

  • just as in use imperative, present tense: “change” not “changed” nor “changes”
  • includes motivation for the change and contrasts with previous behavior

Message footer

Breaking changes

All breaking changes have to be mentioned in footer with the description of the change, justification and migration notes

Stan

Stan is an experienced full-stack developer and software engineer who is focused on web and game development. He is enthusiastic about new technologies. Stan is highly skilled in many programming languages and frameworks, and he always tries to deliver the best approach.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *