Last active
December 14, 2015 04:39
-
-
Save m4dz/5030223 to your computer and use it in GitHub Desktop.
Git pre-commit message that auto-fill the message with the tracker issue reference.
You can also use the commiter.sh script as git core.editor to edit your commit message : the carret will be placed at the EOL, waiting for the rest of the message :)
This file contains hidden or 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/sh | |
ISSUE=$(git symbolic-ref HEAD 2> /dev/null | cut -b 14-) | |
COLS=$((${#ISSUE} + 10)) | |
subl -n -w "$*:1:$COLS" |
This file contains hidden or 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/sh | |
ISSUE=$(git symbolic-ref HEAD 2> /dev/null | cut -b 14-) | |
MSG=$(awk -v msg="Refs #$ISSUE -" 'NR==1{print msg}{print $0}' $1) | |
echo "$MSG" > $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment