Last active
December 27, 2015 14:39
-
-
Save mletterle/7342157 to your computer and use it in GitHub Desktop.
Handy little hook I think...
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/bash | |
branchname=`git symbolic-ref -q --short HEAD` | |
if [[ $branchname =~ 'tfs-.*' ]]; then | |
workitems=$(echo $branchname | sed s/tfs-//g | tr ',' ' ' ) | |
for workitem in $workitems; | |
do | |
cp $1 $1.old | |
$(sed '1s/^/#git-tfs-work-item: '$workitem' associate\n/' $1.old > $1) | |
let i++ | |
done | |
cp $1 $1.old | |
$(sed '1s/^/\n\n#Automatic Git-TFS Associations\n/' $1.old > $1) | |
else | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment