EMOJI-LOG
After building hundreds of open source software I've ended up inventing a git commit log standard called EMOJI-LOG
that helps me understand a project's history with a less cognitive load just by looking at the git log.
I like emoji. I like ’em a lot. Programming, code, geeks/nerds, open-source, all of that is inherently dull and sometimes boring. Emoji (which is, in fact, the plural of emoji) helps me add colors and emotions to the mix. Nothing wrong if you want to attach feelings to this 2D flat text-based world of code. I found out that instead of memorizing hundreds of emoji it's better to keep the categories small and general.
Add
instead of
Added
.Create
instead of
Creating
.�� NEW
, �� IMPROVE
, �� FIX
, �� DOC
, �� RELEASE
, �� TEST
, and ‼️ BREAKING
Only use the following Git Commit Messages. A simple and small footprint is critical here.
�� NEW: IMPERATIVE_MESSAGE_GOES_HERE
Use when you add something entirely new.E.g.
�� NEW: Add Git ignore file
�� IMPROVE: IMPERATIVE_MESSAGE_GOES_HERE
Use when you improve/enhance piece of code like refactoring etc.E.g.
�� IMPROVE: Remote IP API Function
�� FIX: IMPERATIVE_MESSAGE_GOES_HERE
Use when you fix a bug — need I say more?E.g.
�� FIX: Case conversion
�� DOC: IMPERATIVE_MESSAGE_GOES_HERE
Use when you add documentation like
README.md
, or even inline docs.E.g.�� DOC: API Interface Tutorial
�� RELEASE: IMPERATIVE_MESSAGE_GOES_HERE
Use when you release a new version.E.g.
�� RELEASE: Version 2.0.0
�� TEST: IMPERATIVE_MESSAGE_GOES_HERE
Use when it's related to testing.E.g.
�� TEST: Mock User Login/Logout
‼️ BREAKING: IMPERATIVE_MESSAGE_GOES_HERE
Use when releasing a change that breaks previous versions.E.g.
‼️ BREAKING: Change authentication protocol
— That's it for now. Nothing more nothing less.
I'd like to share what each of these emojis mean.
�� NEW:
Emoji meaning: A "package emoji" — which can contain new stuff.�� IMPROVE:
Emoji meaning: An "OK Hand emoji" — which is meant to appreciate an improvement.�� FIX:
Emoji meaning: A "bug emoji" — which means there was a bug that got fixed.�� DOCS:
Emoji meaning: A "book emoji" — which means documentation or notes just like in a book.�� RELEASE:
Emoji meaning: A "rocket emoji" — which is meant to show a new release/launch.�� TEST:
Emoji meaning: A "robot emoji" — which says some test were run successfully.‼️ BREAKING:
Emoji meaning: A "bangbang emoji" — which attracts attention to a breaking change.If you use VSCode, then I have built an extension Emoji-Log for VSCode. This can help you write git commit messages quickly.
For quick prototyping, I have made the following functions that you can add to your .bashrc
/.zshrc
files and use Emoji-Log quickly.
#.# Better Git Logs.
### Using EMOJI-LOG (https://github.com/ahmadawais/Emoji-Log).
# Git Commit, Add all and Push — in one step.
gcap() {
git add . && git commit -m "$*" && git push
}
# NEW.
gnew() {
gcap "�� NEW: $@"
}
# IMPROVE.
gimp() {
gcap "�� IMPROVE: $@"
}
# FIX.
gfix() {
gcap "�� FIX: $@"
}
# RELEASE.
grlz() {
gcap "�� RELEASE: $@"
}
# DOC.
gdoc() {
gcap "�� DOC: $@"
}
# TEST.
gtst() {
gcap "�� TEST: $@"
}
# BREAKING CHANGE.
gbrk() {
gcap "‼️ BREAKING: $@"
}
gtype() {
NORMAL='\033[0;39m'
GREEN='\033[0;32m'
echo "$GREEN gnew$NORMAL — �� NEW
$GREEN gimp$NORMAL — �� IMPROVE
$GREEN gfix$NORMAL — �� FIX
$GREEN grlz$NORMAL — �� RELEASE
$GREEN gdoc$NORMAL — �� DOC
$GREEN gtst$NORMAL — ��️ TEST
$GREEN gbrk$NORMAL — ‼️ BREAKING"
}
To install these functions for the fish shell, run the following commands:
function gcap; git add .; and git commit -m "$argv"; and git push; end;
function gnew; gcap "�� NEW: $argv"; end
function gimp; gcap "�� IMPROVE: $argv"; end;
function gfix; gcap "�� FIX: $argv"; end;
function grlz; gcap "�� RELEASE: $argv"; end;
function gdoc; gcap "�� DOC: $argv"; end;
function gtst; gcap "�� TEST: $argv"; end;
function gbrk; gcap "‼️ BREAKING: $argv"; end;
funcsave gcap
funcsave gnew
funcsave gimp
funcsave gfix
funcsave grlz
funcsave gdoc
funcsave gtst
funcsave gbrk
If you prefer, you can paste these aliases directly in your ~/.gitconfig
file:
# Make sure you're adding under the [alias] block.
[alias]
# Git Commit, Add all and Push — in one step.
cap = "!f() { git add .; git commit -m \"$@\"; git push; }; f"
# NEW.
new = "!f() { git cap \"�� NEW: $@\"; }; f"
# IMPROVE.
imp = "!f() { git cap \"�� IMPROVE: $@\"; }; f"
# FIX.
fix = "!f() { git cap \"�� FIX: $@\"; }; f"
# RELEASE.
rlz = "!f() { git cap \"�� RELEASE: $@\"; }; f"
# DOC.
doc = "!f() { git cap \"�� DOC: $@\"; }; f"
# TEST.
tst = "!f() { git cap \"�� TEST: $@\"; }; f"
# BREAKING CHANGE.
brk = "!f() { git cap \"‼️ BREAKING: $@\"; }; f"
EMOJI-LOG
Here's a list of repos that make use of Emoji-Log.
Alfred PowerPack users can use the Snippets feature to quickly call Emoji-Log, or use the text expand feature for even quicker creation.
To setup:
Emoji-Log.alfredsnippets
, deselecting "Strip snippets of 'auto expand' flag" when promptedThis will give the following text expander keywords for the Emoji-Log:
Keyword | Snippet |
---|---|
;gnew |
|
;gimp |
|
;gfix |
|
;grlz |
|
;gdoc |
|
;gtst |
|
;gbrk |
|
To edit the ;
prefix to your preferred expansion flag, double click right click the Emoji-Log Collection in Alfred Settings » Features » Snippets.
TextExpander Snippets are also available. Download & open
Emoji-Log.textexpander
to import.
EMOJI-LOG
BADGE COLLECTIONIf your repo uses EMOJI-LOG
then you can add any of the following badges to your read me and send me a PR to list your repo here.
[![emoji-log](https://cdn.rawgit.com/ahmadawais/stuff/ca97874/emoji-log/flat.svg)](https://github.com/ahmadawais/Emoji-Log/)
<a href="https://github.com/ahmadawais/Emoji-Log/"><img alt="emoji-log" src="https://cdn.rawgit.com/ahmadawais/stuff/ca97874/emoji-log/flat.svg" /></a>
[![emoji-log](https://cdn.rawgit.com/ahmadawais/stuff/ca97874/emoji-log/flat-round.svg)](https://github.com/ahmadawais/Emoji-Log/)
<a href="https://github.com/ahmadawais/Emoji-Log/"><img alt="emoji-log" src="https://cdn.rawgit.com/ahmadawais/stuff/ca97874/emoji-log/flat-round.svg" /></a>
[![emoji-log](https://cdn.rawgit.com/ahmadawais/stuff/ca97874/emoji-log/non-flat-round.svg)](https://github.com/ahmadawais/Emoji-Log/)
<a href="https://github.com/ahmadawais/Emoji-Log/"><img alt="emoji-log" src="https://cdn.rawgit.com/ahmadawais/stuff/ca97874/emoji-log/non-flat-round.svg" /></a>
Me (Ahmad Awais) and my incredible wife (Maedah Batool) are two engineers who fell in love with open source and then with each other. You can read more about me here. If you or your company use any of my projects or like what I’m doing then consider backing me. I'm in this for the long run. An open-source developer advocate.
(follow) To stay up to date on free & open-source software
(follow) To get #OneDevMinute daily hot tips & trolls
(subscribe) To tech talks & #OneDevMinute videos
git提交emoji 我是一个全职的开源开发人员,或者,我喜欢称呼它为open sourcerer。 我从事开源软件开发已有十多年了,并构建了数百个开源软件应用程序。 我也是“不要重复自己做”(DRY)理念的忠实拥护者,并且相信编写更好的Git提交消息(足够上下文相关的消息,可以用作您的开源软件的变更日志)是DRY的重要组成部分。 我编写的众多工作流程之一是Emoji-Log ,这是一种简单,开
1、需求:输入框长度限制为10个字符,包括表情。超出长度提示。 注:iPhone手机自定义的表情,有四个小人的,三个小人的,主要是长度还都不一样。有的表情可能一个就超出了长度限制(10),比如????这个表情长度为11,当然我这个长度设置的比较小,可以随意设置。 查阅资料的过程中发现了lodash可以处理数组,并且可以处理表情。 console.log(_.toArray('12?').le
1. 代码 haveEmoji = (str) => { //1.正则 2.emoji-regex库 let emojiReg = /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E
1 maven引入emoji-java <dependency> <groupId>com.vdurmont</groupId> <artifactId>emoji-java</artifactId> <version>5.1.1</version> </dependency> 2 表情包工具类 import com.dianping.cat.Cat; import com.googl
import android.app.Activity; import android.graphics.Color; import android.os.Bundle; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.util.Log; im
Emoji 是一个用来快速访问各种表情图片的类,类包含静态方法可直接返回表情的字符串。
js-emoji 可以让你在浏览器上显示 Emoji 表情,使用方法: <link href="emoji.css" rel="stylesheet" type="text/css" /><script src="emoji.js" type="text/javascript"></script><script type="text/javascript">// replaces \u{1F604
Emoji-Picker 可以让你在网站上的输入编辑框中加入一个 emoji 表情选择器。
《Emoji表情编解码库XXL-EMOJI》 方便维护,该项目合并至: https://gitee.com/xuxueli0323/xxl-tool
Emoji Keyboard 提供了带苹果所有表情的输入键盘控件。
emoji-regex emoji-regex offers a regular expression to match all emoji symbols and sequences (including textual representations of emoji) as per the Unicode Standard. It’s based on emoji-test-regex-pa