Brain Phrye

code cooking diy fiction personal photos politics reviews tools 


Gitmojis

[ Listen to article ]

Started trying to do gitmojis for my commit messages. The idea is to quickly highlight what a change is with an emoji. It’s a neat idea, but old dogs need tricks to learn new tricks.

To help learn this new trick I wrote this script to put gitmojis in my commit template message:

1
2
3
4
5
6
7
8
9
#!/bin/bash

exec > ~/.gitmessage
echo ":sparkles: New feature..."
echo
curl -s https://raw.githubusercontent.com/carloscuesta/gitmoji/master/src/data/gitmojis.json \
  | jq -r '.gitmojis[] | "# \(.emoji) \(.code) \(.description)"'
echo '# More gitmojis: https://gitmoji.carloscuesta.me/'
echo '# Generated with ~/.gitmessage.sh'

Then I just had to run git config --global commit.template ~/.gitmessage and voilà, a full list of emojis.

Still to do: hooks to require them and a way to nicely display them in the terminal.