Permalink
Browse files

add publishing to hotfix

  • Loading branch information...
1 parent be5dabf commit 0b324def488f2e73e0db6109e440974f3aab265f @phoet phoet committed Nov 12, 2011
Showing with 28 additions and 0 deletions.
  1. +28 −0 git-flow-hotfix
View
@@ -46,6 +46,7 @@ usage() {
echo "usage: git flow hotfix [list] [-v]"
echo " git flow hotfix start [-F] <version> [<base>]"
echo " git flow hotfix finish [-Fsumpk] <version>"
+ echo " git flow hotfix publish <version>"
}
cmd_default() {
@@ -188,6 +189,33 @@ cmd_start() {
echo
}
+cmd_publish() {
+ parse_args "$@"
+ require_version_arg
+
+ # sanity checks
+ require_clean_working_tree
+ require_branch "$BRANCH"
+ git fetch -q "$ORIGIN"
+ require_branch_absent "$ORIGIN/$BRANCH"
+
+ # create remote branch
+ git push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH"
+ git fetch -q "$ORIGIN"
+
+ # configure remote tracking
+ git config "branch.$BRANCH.remote" "$ORIGIN"
+ git config "branch.$BRANCH.merge" "refs/heads/$BRANCH"
+ git checkout "$BRANCH"
+
+ echo
+ echo "Summary of actions:"
+ echo "- A new remote branch '$BRANCH' was created"
+ echo "- The local branch '$BRANCH' was configured to track the remote branch"
+ 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 0b324de

Please sign in to comment.