Created
September 22, 2023 16:19
-
-
Save b3ll/1d594148739530fb9b4abe5ed2f5540f to your computer and use it in GitHub Desktop.
Reformat a git commit's title by running it through titlecase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
INPUT_FILE=$1 | |
START_LINE=`head -n1 $INPUT_FILE` | |
FIXED_TITLE=`echo $START_LINE | titlecase` | |
sed -i '' "1s/$START_LINE/$FIXED_TITLE/" $INPUT_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You'll want this as your
commit-msg
hook