Skip to content

Commit

Permalink
Merge pull request #163 from phoet/publish_hotfix
Browse files Browse the repository at this point in the history
add publishing to hotfix

Thanks, pulled.
  • Loading branch information
nvie committed Nov 23, 2011
2 parents 447808f + 0b324de commit 7cbdb84
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions git-flow-hotfix
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7cbdb84

Please sign in to comment.