Skip to content

Commit

Permalink
Added push option (-p) to hotfix and release
Browse files Browse the repository at this point in the history
  • Loading branch information
zerotao committed Feb 19, 2010
1 parent d44eaf9 commit 6809f0e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
14 changes: 12 additions & 2 deletions git-flow-hotfix
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ cmd_finish() {
DEFINE_boolean sign false "sign the release tag cryptographically" s
DEFINE_string signingkey "" "use the given GPG-key for the digital signature (implies -s)" u
DEFINE_string message "" "use the given tag message" m
DEFINE_boolean push false "push to $ORIGIN after performing finish" p
parse_args "$@"
require_version_arg

Expand Down Expand Up @@ -220,8 +221,14 @@ cmd_finish() {
# delete branch
git branch -d "$BRANCH"

# TODO: Implement an optional push to master
# git push origin develop; git push origin master; git push --tags origin
if flag push; then
git push "$ORIGIN" "$DEVELOP_BRANCH" || \
die "Could not push to $DEVELOP_BRANCH from $ORIGIN."
git push "$ORIGIN" "$MASTER_BRANCH" || \
die "Could not push to $MASTER_BRANCH from $ORIGIN."
git push --tags "$ORIGIN" || \
die "Could not push tags to $ORIGIN."
fi

echo
echo "Summary of actions:"
Expand All @@ -230,5 +237,8 @@ cmd_finish() {
echo "- The hotfix was tagged '$VERSION_PREFIX$VERSION'"
echo "- Hotfix branch has been back-merged into '$DEVELOP_BRANCH'"
echo "- Hotfix branch '$BRANCH' has been deleted"
if flag push; then
echo "- '$DEVELOP_BRANCH', '$MASTER_BRANCH' and tags have been pushed to '$ORIGIN'"
fi
echo
}
15 changes: 13 additions & 2 deletions git-flow-release
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ cmd_finish() {
DEFINE_boolean sign false "sign the release tag cryptographically" s
DEFINE_string signingkey "" "use the given GPG-key for the digital signature (implies -s)" u
DEFINE_string message "" "use the given tag message" m
DEFINE_boolean push false "push to $ORIGIN after performing finish" p

parse_args "$@"
require_version_arg

Expand Down Expand Up @@ -226,8 +228,14 @@ cmd_finish() {
# delete branch
git branch -d "$BRANCH"

# TODO: Implement an optional push to master
# git push origin develop; git push origin master; git push --tags origin
if flag push; then
git push "$ORIGIN" "$DEVELOP_BRANCH" || \
die "Could not push to $DEVELOP_BRANCH from $ORIGIN."
git push "$ORIGIN" "$MASTER_BRANCH" || \
die "Could not push to $MASTER_BRANCH from $ORIGIN."
git push --tags "$ORIGIN" || \
die "Could not push tags to $ORIGIN."
fi

echo
echo "Summary of actions:"
Expand All @@ -236,5 +244,8 @@ cmd_finish() {
echo "- The release was tagged '$tagname'"
echo "- Release branch has been back-merged into '$DEVELOP_BRANCH'"
echo "- Release branch '$BRANCH' has been deleted"
if flag push; then
echo "- '$DEVELOP_BRANCH', '$MASTER_BRANCH' and tags have been pushed to '$ORIGIN'"
fi
echo
}

0 comments on commit 6809f0e

Please sign in to comment.