Skip to content

Instantly share code, notes, and snippets.

@netsprout
Last active March 8, 2016 07:18
Show Gist options
  • Save netsprout/085dfa06d1e250e9b27c to your computer and use it in GitHub Desktop.
Save netsprout/085dfa06d1e250e9b27c to your computer and use it in GitHub Desktop.
Standardize Development Branches
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