Skip to content
This repository has been archived by the owner on Apr 5, 2021. It is now read-only.

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

Closed
2 tasks
shrink opened this issue Aug 30, 2020 · 6 comments
Assignees
Labels
planning Project planning and thoughts

Comments

@shrink
Copy link
Owner

shrink commented Aug 30, 2020

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
@shrink shrink self-assigned this Aug 30, 2020
@shrink
Copy link
Owner Author

shrink commented Aug 30, 2020

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

@shrink
Copy link
Owner Author

shrink commented Aug 30, 2020

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/

@shrink shrink added the planning Project planning and thoughts label Aug 30, 2020
@shrink
Copy link
Owner Author

shrink commented Aug 30, 2020

name: c:ring:mmitmoji (?)

@shrink
Copy link
Owner Author

shrink commented Aug 30, 2020

  • 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

@shrink
Copy link
Owner Author

shrink commented Sep 2, 2020

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

@shrink
Copy link
Owner Author

shrink commented Sep 13, 2020

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

@shrink shrink closed this as completed Apr 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
planning Project planning and thoughts
Projects
None yet
Development

No branches or pull requests

1 participant