- template
- replace type symbol
- check loose format check
# download commit-template, commit-msg
chmod +x commit-msg
cp commit-msg .git/hooks
git config commit.template <path to template>/commit-template
<commit type>: description
or <commit type>(scope): description
develop -> git add/rm -> git commit -> git push
/ A
.-----------' '----------------------.
V |
[template load] ---------.-> <edit mesage> ---> [replace symbol to emoji]
`- commit-template -' * write msg like conventinal
- commit-template commit sentence template
- commit-msg replace and check commit type
- gen.py generate commit-msg code lines
$ echo "feat: add new func
fix: fix bug
refactor: change structure
docs: write api docs
test: add test case
style: css update
perf: increase
build: modify env variable
release: ship it ver111
snipet: add simple shell
security: modify holl
feat(mod): add feature with scope
fix(mod): fix bug with scope
test(mod): update test case with scope" > msg.txt
$ bash commit-msg msg.txt
commit feat
β feat: add new func
π₯ fix: fix bug
π refactor: change structure
π docs: write api docs
π test: add test case
β style: css update
π perf: increase
π³ build: modify env variable
π release: ship it ver111
π snipet: add simple shell
π security: modify holl
β feat(mod): add feature with scope
π₯ fix(mod): fix bug with scope
π test(mod): update test case with scope
# generate code
$ vi gen.py
emoji={'feat':'\\xE2\\x9C\\x8A',
# update emoji
}
# update commit-msg
$ python gen.py
$ vi commit-msg
case "$typ" in
"fix" | "feat" | "refactor" | "docs" | "test" | "style" | "perf" | "build" | "release" | "snipet" | "security" )
# β update condition
...
echo "$msg" | # copy and paste sed commnad