Commit Standards

March 1, 2020 ยท View on GitHub

The Backport project has some some requirements on how git commit messages are formed.

General:

  • Commits should be small, granular, and easy to follow and revert. Ideally, the same SoC practices that would be applied to software development should be applied to commits; each commit identifies a separtion of concerns.

Commit titles:

  • must be in imperitive, present-tense

  • must be no longer than 50 characters

  • must be prefixed by an emoji key to indicate what the change is, followed by a space

    • If a commit may use more than one emoji to identify the change, it might indicate that the change is not granular enough, and you may be a candidate to be broken down into smaller commits for easier consumption

Commit messages:

  • Must not exceed 72-character wide

    • Exceptions are made if a message contains a link or other figure that exceeds the 72 character rule by nature (e.g. code, compile message, etc)
  • Must indicate the rationale for the change, what was changed, and why

    • In general, more details are always better to help identify the cause of changes in a repository

Emoji Key

Emojis are used to prefix commit titles in order to simplify categorization of git log messages.

Use the table below to identify which prefixes should be used for the respective change:

EmojiReason
๐Ÿ”–Version Tag
๐Ÿ“–Documentation / Textual Changes
๐Ÿ“‡Metadata (README, LICENSE, repo docs, etc)
๐ŸšฆContinuous Integration
โœจNew Feature
โœRename
๐Ÿ”จRefactor
โš Deprecation
๐Ÿ—‘๏ธRemoval
๐ŸŽจCosmetic
๐ŸฉนBug fix
๐ŸงนCode Cleanup (includes moving types/files around)
โฑTuning / Performance
๐ŸŽฏTesting (unit, benchmark, integration, etc)
๐Ÿ”งTooling
๐Ÿ”Security
โ™ฟAccessibility
๐ŸŒLocalization / Internationalization
๐ŸšงWIP

Note: This list may be incomplete, and not cover all possible areas that would be needed. Please feel free to start a discussion if new tags would be more appropriate. Similarly, if there are more appropriate emojis to use as tags, feel free to provide suggestions!