Git commit message RFC


Artem Shchygel
 

Hi, All

In this RFC we're proposing slight changes to Git commit message format to make it more informative and more friendly for automation tools.

Here is the list of changes proposed

  1. Start subject line with the tag that describes nature of the commit. List of tags is as follows:

    • fix: For commits that are fixing the bug
    • feat: For commits that introduce a new feature
    • imp: For commits that introduce improvement of the existing code logic without changing functionality
    • doc: For commits that don't change code logic but deal with documentation (including adding comments, fix spelling, etc.)
    • style: For commits that don't change code logic but deal with coding style (indents, whitespaces, etc.)
    • chore: For commits that don't affect output target (like changes to CI scripts) Having tagged commits will help closed source maintainers to decide which commits to cherry-pick for projects that are in "maintenance mode" as opposite to "active development mode"
  2. Remove "Package/Module" reference from subject line. Since subject line length is limited it's better to be allocated for commit description which is more important

  3. Remove "CVE" number from subject line for the same reason. CVE number (if present) should be placed on separate line after long description (see example below)

  4. Add optional tag to the long description. List of tags is as follows:

    • [BREAKING CHANGE]: For commits that break backward compatibility
    • [SECURITY FIX]: For commits that fix known security vulnerability
  5. Move bugzilla reference to separate line after long description and (possible) CVE line (see example below). This move follows the logic of evaluation of commit nature (read subject, if unclear read long description, if still unclear see bugzilla)

An example would be:

imp: Short one line description of change

Several lines of
description for the
change.

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1000

Signed-off-by: Contributor Name <contributor@...>
Reviewed-by: Reviewer Name <reviewer@...>

A CVE example would be:

fix: Short one line description of change

[SECURITY FIX]: Several lines of
description for the
change.

CVE-2018-12180

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2000

Signed-off-by: Contributor Name <contributor@...>
Reviewed-by: Reviewer Name <reviewer@...>

Join rfc@edk2.groups.io to automatically receive all group messages.