Skip to content

Conventional Commits vs Gitmoji

Posted on:August 2, 2023 at 06:00 PM

Version control is an integral part of modern software development. It allows us to track changes, collaborate efficiently, and easily revert to previous states. However, commit messages often end up as an afterthought, leading to confusion and frustration for both current and future developers working on a project.

Table of Contents

Open Table of Contents

The Power of Conventional Commits with Commitlint

Conventional Commits is a commit message standard that provides a consistent structure to commit messages. It helps in conveying the purpose and impact of each commit accurately. When coupled with a tool like Commitlint, which enforces these standards, the benefits become even more pronounced.

structure

Conventional Commits Strcutrue

installing

  1. Install

    npm install -g @commitlint/cli @commitlint/config-conventional
    
  2. Configure

    echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
  3. Install husky

    npm install husky --save-dev
  4. Add hook

    npx husky add .husky/commit-msg  'npx --no -- commitlint --edit ${1}'

benefits

1. Clarity and Readability:

By following the Conventional Commits format, commit messages become self-explanatory. They provide a clear understanding of the change made, its purpose, and any associated information such as issue tracking.

2. Automated Validation:

Commitlint, a popular tool, allows for automated validation of commit messages against the Conventional Commits standard. This ensures that every commit follows the prescribed format, preventing accidental or inconsistent commits.)

image

3. Integration and Automation:

The standardized commit messages work seamlessly with continuous integration and delivery (CI/CD) pipelines. Tools like Commitlint can be integrated into your workflow, providing consistent and reliable commit message validation.

Injecting Fun and Context with Gitmoji

Gitmoji takes a different approach by using emojis to categorize commits and provide additional context. While it may seem lighthearted, it has gained popularity for its ability to inject fun and expressiveness into commit messages.

gitmoji

structure

gitmoji structure 643/11eb9e40-ae47-11e6-90db-a1ad8a87b495.gif)

installing

  1. Install

npm

npm install -g @commitlint/cli @commitlint/config-conventional

brew

brew install gitmoji
  1. Usage

Hook

gitmoji -i
git add .
git commit

benefits

1. Visual Representation:

Emojis are highly recognizable and can quickly convey the nature of a commit. From bug fixes to new features and documentation updates, Gitmoji covers a wide range of commit types with visual symbols.

2. Team Collaboration:

Gitmoji allows developers to communicate intent and meaning through visual representation, enhancing collaboration. It adds a layer of expressiveness that can foster a positive and enjoyable team culture.

3. Human Touch:

By embracing emojis, Gitmoji brings a touch of humanity to commit messages. It reminds us that development is not just about code; it’s about people working together to create something meaningful.

The Case Against Using Any Standard

While both Conventional Commits and Gitmoji have their merits, some argue against using any standard at all. Let’s explore some of the reasons behind this perspective.

3.1 Flexibility:

Opponents of commit standards argue that being free from constraints allows developers to express themselves more naturally. It provides them with the flexibility to adapt their commit messages to the context and style of the project.

3.2 Minimalism:

Some developers prefer minimalistic commit messages, arguing that the code changes themselves should speak for their purpose. They believe that additional standards or emojis can add unnecessary noise to the commit history.

3.3 Personal Preference:

Ultimately, the decision to use or not use a commit message standard boils down to personal preference. Some developers may find that their workflow is better suited to a more relaxed or individualistic approach.

Conclusion

In conclusion, commit message standards play a vital role in maintaining a clear and organized version control history. Con

Conventional Commits with Commitlint provide clarity, automated validation, and seamless integration with CI/CD pipelines. Gitmoji injects fun, expressiveness, and visual context into commit messages, fostering collaboration. However, it’s important to acknowledge that the decision to use or not use any standard ultimately rests with the development team’s preferences and requirements.

Remember, consistency is key! Whether you choose Conventional Commits, Gitmoji, or your own custom standard, make sure your commit messages reflect the value you place on clear communication and collaboration within your team.

Thank you for your attention, and I’m open to any questions or discussion on this topic!