Permalink
Browse files

Added a track command to git-flow-hotfix along the lines of the git-f…

…low-feature track command
  • Loading branch information...
1 parent ab7fda2 commit 37f7d14b2f566390c824be6168ec730d11bb531e @vedang vedang committed Mar 12, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 git-flow-hotfix
View
21 git-flow-hotfix
@@ -47,6 +47,7 @@ usage() {
echo " git flow hotfix start [-F] <version> [<base>]"
echo " git flow hotfix finish [-Fsumpk] <version>"
echo " git flow hotfix publish <version>"
+ echo " git flow hotfix track <version>"
}
cmd_default() {
@@ -216,6 +217,26 @@ cmd_publish() {
echo
}
+cmd_track() {
+ parse_args "$@"
+ require_version_arg
+
+ # sanity checks
+ require_clean_working_tree
+ require_branch_absent "$BRANCH"
+ git fetch -q "$ORIGIN"
+ require_branch "$ORIGIN/$BRANCH"
+
+ # create tracking branch
+ git checkout -b "$BRANCH" "$ORIGIN/$BRANCH"
+
+ echo
+ echo "Summary of actions:"
+ echo "- A new remote tracking branch '$BRANCH' was created"
+ echo "- You are now on branch '$BRANCH'"
+ echo
+}
+
cmd_finish() {
DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F
DEFINE_boolean sign false "sign the release tag cryptographically" s

0 comments on commit 37f7d14

Please sign in to comment.