Skip to content

Commits semantic

ppeigne edited this page Nov 27, 2019 · 1 revision

Atomic commits

A first important rule for commits is that they MUST be atomic. An atomic commit may involve one or more files (if pictures are linked to an exercise for example) but only one feature. For instance, if you have finished 3 exercises and want to commit, three different commits must be done.

Commit message semantic

All commits messages must be prefixed by a generic and frequently used keyword. I propose here a basic semantic for most commit messages :

  • feat : "feat : finished exercise 00 of SQL day, close #2"
  • wip : "wip : starting exercise 01 of SQL day"
  • fix : "fix : fixed the SQL query"
  • refactor : "refactor : simplified the code example in exercise 03"
  • doc : "doc : added information linked to exercise 00"

This semantic can be modified if you feel the need but keep the good habit of putting keywords in front commit messages. Commit messages must clearly explain the commit content in few words.

Closing issues

As previously said in the issues part of the wiki, an issue can be closed in the issue panel but we prefer using commits with a specific syntax for that.

The following words assiociated with an issue will close the issue :

  • close
  • closes
  • closed
  • fix
  • fixes
  • fixed
  • resolve
  • resolves
  • resolved

Here, there is an example :

git commit -m "fix : close #2"

When closing an exercise issue, the box corresponding to the exercise must be ticked manually.