GIT

Commit Messages

What is a Commit!!

Message Main Goals

  • Help contributors understand the changes
  • Provide usefull information when browsing history
  • Allow generating a CHANGELOG (BONUS)

Examples

Those are regular commit messages grabbed from a real world project.

Fix the new user export issues
Enable Data re editing in bulk results
Add Re-edit button
Remove unnecessary action
Merge branch x into develop
Add export error popup
Add indeterminate state
Match the mockup
Add a filter on top of bulk results grid
Display provisioning delegations
Display warnings one time only
Match active grid row with id as well
Fix a typo
Fix mass route

which issues ?

???

Commit Messages Conventions

Angular Team Conventions

Message Format

The commit message has tree main parts :

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

Header (Subject)

Subject line contains succinct description of the change.

 

Allowed <type> :

  • feat (feature)
  • fix (bug fix)
  • docs (documentation)
  • style (formatting, missing semi colons, …)
  • refactor
  • test (adding missing tests)
  • build/ci (gulp, webpack, travis...)
<type>(scope): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

Header (Subject)

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

Subject line contains succinct description of the change.

 

Allowed (scope) :

Scope could be anything specifying place of the commit change. For example `filename`, `dirname`,  `class`, etc...

Header (Subject)

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

Subject line contains succinct description of the change.

 

<subject> text :

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

Body

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

Body contains more details about the change.

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

Footer

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

Footer contains the breaking changes and references to related tickets and issues.

 

  • All breaking changes have to be mentioned in footer with the description of the change, justification and migration note, each change should start with BREAKING CHANGE
  • Multiple issues are separated with comma

Example

feat($browser): onUrlChange event (popstate/hashchange/polling)

Added new event to $browser:
- forward popstate event if available
- forward hashchange event if popstate not available
- do polling when neither popstate nor hashchange available

Breaks $browser.onHashChange, which was removed (use onUrlChange instead)

Example

feat(directive): ng:disabled, ng:checked, ng:multiple, ng:readonly, ng:selected

New directives for proper binding these attributes in older browsers (IE).
Added coresponding description, live examples and e2e tests.

Closes #351

Example

feat(directive): ng:disabled, ng:checked, ng:multiple, ng:readonly, ng:selected

New directives for proper binding these attributes in older browsers (IE).
Added coresponding description, live examples and e2e tests.

Closes #351

Example

feat($compile): simplify isolate scope bindings

Changed the isolate scope binding options to:
  - @attr - attribute binding (including interpolation)
  - =model - by-directional model binding
  - &expr - expression execution binding

This change simplifies the terminology as well as
number of choices available to the developer. It
also supports local name aliasing from the parent.

BREAKING CHANGE: isolate scope bindings definition has changed and
the inject option for the directive controller injection was removed.

To migrate the code follow the example below:

Before:

scope: {
  myAttr: 'attribute',
  myBind: 'bind',
  myExpression: 'expression',
  myEval: 'evaluate',
  myAccessor: 'accessor'
}

After:

scope: {
  myAttr: '@',
  myBind: '@',
  myExpression: '&',
  // myEval - usually not useful, 
  // but in cases where the expression is assignable,
  // you can use '='
  myAccessor: '=' // in directive's template change myAccessor() to myAccessor
}

The removed `inject` wasn't generaly useful for 
directives so there should be no code using it.

Thanks

Git Commit Messages

By Mohammed Erraysy

Git Commit Messages

Guidelines to a better commit messages

  • 143