Last active
March 8, 2016 07:18
-
-
Save netsprout/085dfa06d1e250e9b27c to your computer and use it in GitHub Desktop.
Standardize Development Branches
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
function branchit() { | |
if [ $# -lt 3 ] | |
then | |
echo "Usage : habitbranch [b|f|c|r|p] description pivotalID" | |
return | |
fi | |
local category="$1" | |
local description="$2" | |
local pivid="$3" | |
case "$category" in | |
# bugs | |
b) category=bugs | |
;; | |
# features | |
f) category=features | |
;; | |
# chores | |
c) category=chores | |
;; | |
r) category=refactors | |
;; | |
p) category=performance | |
;; | |
*) echo "Invalid option, choose a character from: b (bugs), f (features), c (chores), r (refactors), p (performance)" | |
return | |
;; | |
esac | |
description=${description// /_} | |
description=`echo "$description" | tr '[:upper:]' '[:lower:]'` | |
pivid=${pivid//#/} | |
echo "$category/$description-$pivid" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment