Skip to content

Instantly share code, notes, and snippets.

@codegoalie
Created January 18, 2016 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codegoalie/c7429e56441eff6a52e2 to your computer and use it in GitHub Desktop.
Save codegoalie/c7429e56441eff6a52e2 to your computer and use it in GitHub Desktop.
#!/bin/bash
# This script takes story ID and type then a branch subname.
# It will use goutrack to mark the story as in progress and create a new branch
# in the current directory off the current branch with the format:
# <type>/<ID>-<subname>
while [[ $# > 1 ]]
do
key="$1"
case $key in
-s|--story)
STORY_ID="$2"
shift # past argument
;;
-t|--type)
TYPE="$2"
shift # past argument
;;
-b|--branch)
BRANCH_NAME="$2"
shift # past argument
;;
*)
# unknown option
;;
esac
shift # past argument or value
done
# echo STORY_ID = "${STORY_ID}"
# echo TYPE = "${TYPE}"
# echo BRANCH_NAME = "${BRANCH_NAME}"
goutrack c ${STORY_ID} "Assignee: me In Progress"
git checkout -b "${TYPE}s/${STORY_ID}-${BRANCH_NAME}"
@codegoalie
Copy link
Author

An example usage of this is:

$ start_strory -t bug -s c-1234 -b fixing-a-crazy-bug
Applying In Progress Assignee: me to c-1234
$ git status
On branch bugs/c-1234-fixing-a-crazy-bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment