Skip to content

Instantly share code, notes, and snippets.

@elonmir
Last active May 19, 2022 09:02
Show Gist options
  • Select an option

  • Save elonmir/6feef651bf8b0863c576864f818e7777 to your computer and use it in GitHub Desktop.

Select an option

Save elonmir/6feef651bf8b0863c576864f818e7777 to your computer and use it in GitHub Desktop.
Just write "YOLO" in your commit message to have some fun.
#!/bin/bash
RANDOM_MESSAGE_ORIGIN="http://whatthecommit.com/index.txt"
COMMIT_MSG=$(cat "${1:?Missing commit message file}")
if [[ $COMMIT_MSG = "YOLO" ]]
then
echo "$(curl -s $RANDOM_MESSAGE_ORIGIN) [randomly generated]" > .git/COMMIT_EDITMSG
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment