Skip to content

Commit Style

Dany Marcoux edited this page Sep 16, 2020 · 2 revisions

We are keen on proper commit messages because they will help us to maintain this project in the future.

  • The title of your commit should summarizes what has been done
    • If the title is to small to explain what you have done then elaborate on it in the body
  • Explain why you have changed this instead of the how. This is the most important content of the message.
  • Explain potential side-effects of this change, if there are any

Please also:

  • Use present tense in the commit subject

    This is to be consistent in how we describe commits. For example, write Update gem ABC instead of Updated gem ABC.

  • Leave a blank line between the commit subject and body

    Tools like rebase could not work properly otherwise.

  • Mention related issues

    If this commit fixes an issue you need to mention it like Fixes #1234

  • Give kudos to Co-authors

    If the commit has more than one author tag them with Co-authored-by: name <name@example.com>.

  • Try that the commit subject is not longer than 50 characters

  • Try that each line of the commit body is not longer than 72 characters

  • Try to avoid meaningless words/phrases

    When possible avoid using words/phrases such as obviously, basically, simply, of course, everyone knows and easy.

  • Preferably use - for lists

    Do not use * as it is also used for emphasis.

Please note that we used to tag our commits to specify the areas affected by the change. We are not tagging commits anymore, but these are the labels and their descriptions in case you review some old code:

  • [api] - Changes in api related parts of app/model/ and lib/ as well as app/controllers/*.rb and its views
  • [backend] - Changes in the perl-written backend of OBS
  • [ci] - Changes that affect our test suite
  • [dist] - Modifies something inside /dist directory
  • [doc] - Any documentation related changes
  • [webui] - Changes in webui related parts of app/model/ and lib/ as well as app/controllers/webui/ and its views
Clone this wiki locally