AdvWeb2 Git Commit Message Style Guide

Introduction

This style guide acts as the official guide to follow in your projects. I will use this guide to grade your projects. There are many opinions on the "ideal" style in the world of development. Therefore, in order to reduce the confusion on what style students should follow during the course of their projects, we urge all students to refer to this style guide for your projects.

Commit Messages

Message Structure

A commit messages consists of two distinct parts separated by a blank line: the subject and an optional body. The layout looks like this:

subject

body

The Subject

Subjects should:

Use an imperative tone to describe what a commit does, rather than what it did. For example, use change; not changed or changes. A helpful way to come up with a short yet descriptive subject is to finish this phrase, "This commit will...", and however you finish that sentence should be the subject.

The Body

Not all commits are complex enough to warrant a body, therefore it is optional and only used when a commit requires a bit of explanation and context. Use the body to explain the what and why of a commit, not the how.

When writing a body, the blank line between the title and the body is required and you should limit the length of each line to no more than 72 characters.

Example Commit Message

summarize changes in around 50 characters or less

More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of the commit and the rest of the text as the body. The
blank line separating the summary from the body is critical (unless
you omit the body entirely); various tools like `log`, `shortlog`
and `rebase` can get confused if you run the two together.

Explain the problem that this commit is solving. Focus on why you
are making this change as opposed to how (the code explains that).
Are there side effects or other unintuitive consequenses of this
change? Here's the place to explain them.

Further paragraphs come after blank lines.

 * Bullet points are okay, too

 * Typically a hyphen or asterisk is used for the bullet, preceded
   by a single space, with blank lines in between, but conventions
   vary here