Skip to content

Git

  • Use version control system Git for tracking code changes.
  • For the workflow, see Git Workflow.
  • Use descriptive commit messages and follow the rule of 50/72 (see below).
  • Create informative pull requests.
  • Require code reviews and approvals for all changes via pull requests.

Git 50/72: Commit Messages

The rule of 50/72 rule is a commonly accepted best practice for formatting commit messages in Git. This is also considerable for other version control systems, as it is absolutely not tied to Git. It was originally "invented" and promoted by the Linux Kernel team and gained universal popularity later.

The rule is simple:

  • Summary: maximum 50 characters long first line (please see structure first line below)
  • Then a blank line
  • Description: arbitrary number of maximum 72 characters long lines, at most one blank line between them (This part is optional. For trivial commits you may not want to write any details at all.)

Bad

[UPDATE] update font-weight of freestanding link / reduce box-shadow of buttons / change link list mouse over effect / color underline of freestanding link / add external link styling

Good

[UPDATE] refactor component x

Action Keywords

We use action keywords to structure our commit messages This is a list of proposed action keywords. This is not a definitive list. A keyword length of 4-6 letters is recommended where possible.

  • ADD: Add a module or a new component.
  • REMOVE: Remove a module or a complete component.
  • UPDATE: A generic update that involves changes and does not fit any other category. This is probably what is used the most.
  • FIX: Code fixes and bug fixes

Structure

  • Jira Issue: (always required if a project exists), for example XFC-12
  • Action keyword: (always required)
  • Subject of change (voluntary), can be a module for example
  • Short message using imperative
  • Description

Issue + [ACTION] + (?: Module) + Short message (max. 50 characters)

//

Description (max. 72 characters per line)

Samples

SUS-2 [ADD] header: add base layout

add styling nav links
add icons
add styling navbar
SUS-3 [UPDATE] header: change background color

Change background-image
Update background-repeat
DDS-22 [UPDATE] header: move main-nav a bit to the bottom
SUS-6 [ADD] media: remove video styling
[FIX] fix background-color in navigition
DDS-25 [UPDATE] grid: adjust breakpoints