Commit Message Style

Commit Message Style

by Dan Poltawski -
Number of replies: 1

Developers, before you start your engines on Moodle 2.2....

A long time ago in a galaxy far, far away... we had a discussion on commit message style, reached a bit of a consensus and commit message style generally improved and got more consistent.

Since then, we have:

  • Moved from CVS to git as the version control system for Moodle
  • Introduced a peer review/integration system
  • Become a bit less consistent in commit message styles (IMO)

2/3 great improvements to Moodle development, but now when introducing Moodle development to new developers I am unsure what we are advocating as the house commit message style. Especially as the style which I thought we decided on in CVS_for_developers#CVS_commit_messages doesn't seem to be used by many people (component THEN bugid).

So I would like to propose:

  • We decide on a house style
  • Reviewers try to enforce the house style when merging code

What do you think?

Average of ratings: -
In reply to Dan Poltawski

Re: Commit Message Style

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The house style is now issueid, code area, then summary.

If you look at http://git.moodle.org/gw?p=moodle.git;a=summary it seems pretty consisten to me.

Whole first line of the commit message should ideally be less that ~80chars, or preferably a bit less, then a blank line, then further explanation if necessary.

We are not completely consistent in how to do the code area. One way is to start with the Frankenstyle plugin name. E.g. qtype_numerical. It is less clear what to do when working on an area of core code. Recently some of my commit comments have just tried to imply the code area within the summary text to make a sentence, but I am not sure if this is a good idea.

We should document the policy on the wiki, either under coding style or process. And the integrators should enforce it.