shrink / commitmoji

🚧 Reimagining of gitmoji... stricter. Archived as of 2021 in favour of conventional commits.
https://github.com/shrink/commitmoji/issues/1
MIT License
2 stars 0 forks source link

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

Closed shrink closed 3 years ago

shrink commented 3 years ago

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

shrink commented 3 years ago

Example Commits

Example commits... with commitmojis

Rules

shrink commented 3 years ago

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: :construction_worker: :construction_worker: Seed test data on database initialisation
Feature :sparkles: :sparkles: :sparkles: Allow user to authenticate with Google
Formatting :art: :art: :art: Replace tabs with spaces in Javascript source files
Performance :zap: :zap: :zap: Cache result of photo resizing
Bug :bug: :bug: :bug: Generate cache key with user identifier
Hotfix :ambulance: :ambulance: :ambulance: Replace user avatar with generic icon
Documentation :book: :book: :book: Describe supported colours for template
Configuration :wrench: :wrench: :wrench: Load hostname from environment
User Interface :computer: :computer: :computer: Emphasise selected project filters
Security :lock: :lock: :lock: Escape HTML entities in post titles
Refactor :recycle: :recycle: :recycle: Simplify parsing logic with regular expression
Accessibility :door: :door: :door: Label registration form inputs
Continuous Integration :traffic_light: :traffic_light: :traffic_light: Publish releases to GitHub Package Registry
Publish :gift: :gift: :gift: Release v1.10
Localization :globe_with_meridians: :globe_with_meridians:
Agreement :bookmark_tabs: :bookmark_tabs: :bookmark_tabs: License project under MIT
Log :memo: :memo: :memo: Include last activity timestamp in user metadata
People :family: :family: :family: List @example as a Gold sponsor
SEO :mag: :mag: :mag: Mark profile root page as canonical profile page
Seed :seedling: :seedling: :seedling: Give each registered user a default profile photo
Deprecation :wastebasket: :wastebasket: :wastebasket: Replace structured user name with free display name
Feature Flag :triangular_flag_on_post: :triangular_flag_on_post: :triangular_flag_on_post: Enable light mode for all paying users
Infrastructure
Dependency

TODO

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

shrink commented 3 years ago

name: c:ring:mmitmoji (?)

shrink commented 3 years ago
shrink commented 3 years ago

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.

shrink commented 3 years ago

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