From 0b324def488f2e73e0db6109e440974f3aab265f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Schr=C3=B6der?= Date: Sat, 12 Nov 2011 17:36:36 +0100 Subject: [PATCH] add publishing to hotfix --- git-flow-hotfix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/git-flow-hotfix b/git-flow-hotfix index 261811317..0a7727261 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -46,6 +46,7 @@ usage() { echo "usage: git flow hotfix [list] [-v]" echo " git flow hotfix start [-F] []" echo " git flow hotfix finish [-Fsumpk] " + echo " git flow hotfix publish " } 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