Created
July 15, 2014 13:51
-
-
Save jeffutter/98aa457874bc2100715a to your computer and use it in GitHub Desktop.
Branch name in commit messages
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/sh | |
branch=$(git branch 2>/dev/null | grep -e ^* | tr -d ' *') | |
trimmed=$(echo $branch | sed -e 's/^[^-]*\/\(.*\)/\1/' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' ) | |
echo -n "[$trimmed]"' '|cat - "$1" > /tmp/out && mv /tmp/out "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment