DEV Community

Cover image for How are you writing a commit message?

How are you writing a commit message?

Darkø Tasevski on October 08, 2019

I'll write a little bit about a topic that is not related to code, seemingly not that important, but it is quite practical in daily programming. Ho...
Collapse
 
yvonnickfrin profile image
🦁 Yvonnick FRIN • Edited

Awesome article, this subject is often forgotten! Did you know about gitmoji convention? I find it nice for small projects 👍 It lacks of scope feature for bigger projects or monorepo.

The author also made a cli and I made a changelog generator called gitmoji-changelog (it takes care of semantic versioning) for those who are interested 😉

Collapse
 
puritanic profile image
Darkø Tasevski

I've heard about this and agree that this is maybe a nice touch for personal projects or smaller team projects, also maybe as an introduction to semantic commit for newbie coders.

On the other hand, IMO, it's a bit silly and not much professional for large scale and corporate projects 😄 Can't imagine what would I told my PM when he asks why we have emojis in changelog/commit list 😅

Collapse
 
yvonnickfrin profile image
🦁 Yvonnick FRIN • Edited

We use it in my company on large corporate projects. Our customer added it in their development guidelines. Emojis or words is a matter of habits IMO. The only problem we encountered is the lack of scope (as I said in my previous) since we work on two big monorepos. We are discussing about adding the scope in our commit convention right now 😉

We had to provide arguments about emojis instead of words. More and more open source repositories are using emojis in their commit messages. It find it nice when you are browsing commit history to quickly identify commits. It could be the subject of a blog post 😂

Thread Thread
 
puritanic profile image
Darkø Tasevski

That sounds awesome! But I'm not sure that emojis are searchable by grep or similar command-line tools, and that's one of the most important point in my case.

I find it nice when you are browsing commit history to quickly identify commits.

This is very true, I think that it's easier to identify a commit just by looking at emoji instead of looking down the wall of commits and trying to find that one refactor that messed up everything :D

Thread Thread
 
yvonnickfrin profile image
🦁 Yvonnick FRIN • Edited

What is nice with gitmoji is that it uses emojis' names so you can grep "sparkles" to get all commits introducing new features for example (commit message: "✨ Add an awesome feature"). The software interprets the string as an emoji. Am I clear?

Edit: Dev.to transforms the string in emoji too 😂

Thread Thread
 
puritanic profile image
Darkø Tasevski

Cool, didn't know that :)

Collapse
 
michaelcurrin profile image
Michael Currin

Thanks for sharing. I knew about the git emoji style but not the log.

I wrote an alias so you can turn semvar commits without emojis into a log with emojis :)

github.com/MichaelCurrin/emoji-res...

Just git log and not changelog

Collapse
 
pavelloz profile image
Paweł Kowalski

I like to live in the moment, so:

git commit -am 'fix'; git push --force

Collapse
 
puritanic profile image
Darkø Tasevski

Shocked cat

Collapse
 
bycedric profile image
Cedric van Putten

Paweł no please, stop 🙈

Collapse
 
pavelloz profile image
Paweł Kowalski • Edited

I highly recommend aliasing it to yolo to further increase productivity

Thread Thread
 
bycedric profile image
Cedric van Putten • Edited

Amazing

10x dev

Collapse
 
seleporx profile image
Niel Patrick M. Lugpatan

Use the force young jedi. haha

Collapse
 
joelnet profile image
JavaScript Joel

I have been enjoying the git-cz cli which has emoji support.

git-cz

Collapse
 
moopet profile image
Ben Sinclair

Aw hell no (etc).

Collapse
 
puritanic profile image
Darkø Tasevski

Emojis are optional :D

Collapse
 
puritanic profile image
Darkø Tasevski

I've tried using git-cz but it doesn't play nicely with precommit hooks :( I really like the idea and implementation tho!

Collapse
 
miroslavmikus profile image
MiroslavMikus

Hey, really great article :) I have just finished a small bash scrip which should help to implement this idea.

I would be more than happy for review.

gist.github.com/MiroslavMikus/ec8b...

Collapse
 
michaelcurrin profile image
Michael Currin

I started using semvar commits a few years ago and enjoy it.

Sometimes I make a ton of one line or one character changes in each commit and want to commit frequently at each stable state. So I wrote a VS Code extension to write the semvar label, the verb (create, move) and the path.

github.com/MichaelCurrin/auto-comm...

Collapse
 
diegogaby23 profile image
PEREZ MOTA Javier
Collapse
 
johnsoncherian profile image
Johnson

Do we have a convention when your commit includes both a feature and a fix. How do we do that.?