Skip to content

[suggestion] to add doc about git hook which would not depend upon 3-rd party tool #87

@kopach

Description

@kopach

Hi. In my project we do use conventional commits, but we don't use husky or Yorkie, also we don't want to force people to use emojis in commits. However, personally, I like putting emojis into my commits and I want it to be automated. Therefore, I've added devmoji into my .git/hooks/ manually. Here is info on how I have this done. In the root of project, run:

cp .git/hooks/prepare-commit-msg.sample .git/hooks/prepare-commit-msg # note, it's important to copy this to make sure file is executable
echo "#\!/bin/sh\n\nCOMMIT_MSG_FILE=\$1\nCOMMIT_MSG=\$(cat \$COMMIT_MSG_FILE)\n\necho \"\${COMMIT_MSG}\" | devmoji > \$1" > .git/hooks/prepare-commit-msg

Would be great to have this added to the README of the project. Thanks!


The resulting content of .git/hooks/prepare-commit-msg would be:

#!/bin/sh

COMMIT_MSG_FILE=$1
COMMIT_MSG=$(cat $COMMIT_MSG_FILE)

echo "${COMMIT_MSG}" | devmoji > $1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions