shrink / commitmoji

🚧 Reimagining of gitmoji... stricter. Archived as of 2021 in favour of conventional commits.

Home Page:https://github.com/shrink/commitmoji/issues/1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plan how a new approach to gitmoji could be compatible with strict commit message standards

shrink opened this issue Β· comments

commented

carloscuesta/gitmoji is a fantastic idea that has greatly improved my commit messages but it is somewhat incompatible with strict commit message standards. How can this be improved? This project is intended to explore the options.

Using emojis on commit messages provides an easy way of identifying the purpose or intention of a commit with only looking at the emojis used.

How to Write a Git Commit Message

The contributors to these repositories know that a well-crafted Git commit message is the best way to communicate context about a change to fellow developers (and indeed to their future selves).

[...]

  1. Separate subject from body with a blank line
  2. Limit the subject line to 50 characters
  3. Capitalize the subject line
  4. Do not end the subject line with a period
  5. Use the imperative mood in the subject line
  6. Wrap the body at 72 characters
  7. Use the body to explain what and why vs. how

[...]

5. Use the imperative mood in the subject line
Imperative mood just means β€œspoken or written as if giving a command or instruction”. A few examples:

Clean your room
Close the door
Take out the trash
Each of the seven rules you’re reading about right now are written in the imperative (β€œWrap the body at 72 characters”, etc.).

The imperative can sound a little rude; that’s why we don’t often use it. But it’s perfect for Git commit subject lines. One reason for this is that Git itself uses the imperative whenever it creates a commit on your behalf.

[...]

A properly formed Git commit subject line should always be able to complete the following sentence: If applied, this commit will your subject line here

gitmoji

Emojis currently included in gitmoji (via carloscuesta/gitmoji-cli@v3.2.10).

Emoji Shortcode Description
🎨 :art: Improving structure / format of the code
⚑️ :zap: Improving performance
πŸ”₯ :fire: Removing code or files
πŸ› :bug: Fixing a bug
πŸš‘ :ambulance: Critical hotfix
✨ :sparkles: Introducing new features
πŸ“ :pencil: Writing docs
πŸš€ :rocket: Deploying stuff
πŸ’„ :lipstick: Updating the UI and style files
πŸŽ‰ :tada: Initial commit
βœ… :white_check_mark: Updating tests
πŸ”’ :lock: Fixing security issues
🍎 :apple: Fixing something on macOS
🐧 :penguin: Fixing something on Linux
🏁 :checkered_flag: Fixing something on Windows
πŸ€– :robot: Fixing something on Android
🍏 :green_apple: Fixing something on iOS
πŸ”– :bookmark: Releasing / Version tags
🚨 :rotating_light: Removing linter warnings
🚧 :construction: Work in progress
πŸ’š :green_heart: Fixing CI Build
⬇️ :arrow_down: Downgrading dependencies
⬆️ :arrow_up: Upgrading dependencies
πŸ“Œ :pushpin: Pinning dependencies to specific versions
πŸ‘· :construction_worker: Adding CI build system
πŸ“ˆ :chart_with_upwards_trend: Adding analytics or tracking code
♻️ :recycle: Refactoring code
🐳 :whale: Work about Docker
βž• :heavy_plus_sign: Adding a dependency
βž– :heavy_minus_sign: Removing a dependency
πŸ”§ :wrench: Changing configuration files
🌐 :globe_with_meridians: Internationalization and localization
✏️ :pencil2: Fixing typos
πŸ’© :poop: Writing bad code that needs to be improved
βͺ :rewind: Reverting changes
πŸ”€ :twisted_rightwards_arrows: Merging branches
πŸ“¦ :package: Updating compiled files or packages
πŸ‘½ :alien: Updating code due to external API changes
🚚 :truck: Moving or renaming files
πŸ“„ :page_facing_up: Adding or updating license
πŸ’₯ :boom: Introducing breaking changes
🍱 :bento: Adding or updating assets
πŸ‘Œ :ok_hand: Updating code due to code review changes
♿️ :wheelchair: Improving accessibility
πŸ’‘ :bulb: Documenting source code
🍻 :beers: Writing code drunkenly
πŸ’¬ :speech_balloon: Updating text and literals
πŸ—ƒ :card_file_box: Performing database related changes
πŸ”Š :loud_sound: Adding logs
πŸ”‡ :mute: Removing logs
πŸ‘₯ :busts_in_silhouette: Adding contributor(s)
🚸 :children_crossing: Improving user experience / usability
πŸ— :building_construction: Making architectural changes
πŸ“± :iphone: Working on responsive design
🀑 :clown_face: Mocking things
πŸ₯š :egg: Adding an easter egg
πŸ™ˆ :see_no_evil: Adding or updating a .gitignore file
πŸ“Έ :camera_flash: Adding or updating snapshots
βš— :alembic: Experimenting new things
πŸ” :mag: Improving SEO
☸️ :wheel_of_dharma: Work about Kubernetes
🏷️ :label: Adding or updating types (Flow, TypeScript)
🌱 :seedling: Adding or updating seed files
🚩 :triangular_flag_on_post: Adding, updating, or removing feature flags
πŸ₯… :goal_net: Catching errors
πŸ’« :dizzy: Adding or updating animations and transitions
πŸ—‘ :wastebasket: Deprecating code that needs to be cleaned up

Project Types

  • Website
  • Blog (source)
  • API
  • Law
  • Documentation
  • Specification
  • Standard
commented

Example Commits

Example commits... with commitmojis

Rules

  • Should describe a commit in the context of a repository -- for example "development environment" not "Docker" -- because otherwise the emoji is very ambiguous (regardless of what the project is the emojis used for the types of commit should be consistent)
    • A repository may be for a project that is not code (e.g: a document repository)
    • or is a project that provides a tool to use for code (e.g: a github action repository)
    • or is a project with source-code for an app
  • A commitmoji must describe a change to an area of the project -- not specifically remove or add
  • Avoid contradicting gitmoji
  • Avoid using similar emojis -- each should be distinct in what they represent
  • Avoid cultural references or language specific meanings
  • A commit should describe the impact on the project not the code
  • Less is more, it should be easy to remember all
  • Adding new emojis requires a demonstration of why it should be added (go through process for all initial emojis? a PR for each?)
    • Different project types
    • Example commits
    • Vote?
  • Swapping the emoji should change the entire meaning of the message
commented

commitmojis

An initial attempt at taking inspiration from gitmoji and simplifying using the above principles.

Type Emoji Example Commits
Project / Build?
Developer Experience πŸ‘· :construction_worker: πŸ‘· Seed test data on database initialisation
Feature ✨ :sparkles: ✨ Allow user to authenticate with Google
Formatting 🎨 :art: 🎨 Replace tabs with spaces in Javascript source files
Performance ⚑ :zap: ⚑ Cache result of photo resizing
Bug πŸ› :bug: πŸ› Generate cache key with user identifier
Hotfix πŸš‘ :ambulance: πŸš‘ Replace user avatar with generic icon
Documentation πŸ“– :book: πŸ“– Describe supported colours for template
Configuration πŸ”§ :wrench: πŸ”§ Load hostname from environment
User Interface πŸ’» :computer: πŸ’» Emphasise selected project filters
Security πŸ”’ :lock: πŸ”’ Escape HTML entities in post titles
Refactor ♻️ :recycle: ♻️ Simplify parsing logic with regular expression
Accessibility πŸšͺ :door: πŸšͺ Label registration form inputs
Continuous Integration πŸš₯ :traffic_light: πŸš₯ Publish releases to GitHub Package Registry
Publish 🎁 :gift: 🎁 Release v1.10
Localization 🌐 :globe_with_meridians:
Agreement πŸ“‘ :bookmark_tabs: πŸ“‘ License project under MIT
Log πŸ“ :memo: πŸ“ Include last activity timestamp in user metadata
People πŸ‘ͺ :family: πŸ‘ͺ List @example as a Gold sponsor
SEO πŸ” :mag: πŸ” Mark profile root page as canonical profile page
Seed 🌱 :seedling: 🌱 Give each registered user a default profile photo
Deprecation πŸ—‘οΈ :wastebasket: πŸ—‘οΈ Replace structured user name with free display name
Feature Flag 🚩 :triangular_flag_on_post: 🚩 Enable light mode for all paying users
Infrastructure
Dependency

TODO

  • Add examples for diff project types: application sourcecode, documents, tool

https://www.webfx.com/tools/emoji-cheat-sheet/

commented

name: c:ring:mmitmoji (?)

commented
  • Review the commits of projects that use gitmoji (e.g: gitmoji itself) and then compare to the proposed commitmojis above, preparing a table showing the difference between gitmoji and commitmoji to give a clearer picture of the impact
commented

Conventional Commits is interesting but I'm not sure it captures the same value, but it does have nice tooling so perhaps there's a way to introduce emojis into that standard in some way as an extension? Semantic versioning is valuable for libraries but not so much projects, do the machine readable benefits of Conventional Commits provide value in projects at the expense of humans? The Angular example is worth digging into because they have a mature project implementing the approach.

  • Review Angular usage of Conventional Commits and decide if that is better than emojis
commented

Build of [the thing]
Configuration of [the thing]
Feature of [the thing]
Fixing a bug in [the thing]