refactor the whole thing
- now works as sub commands to git if copied to $(git --exec-path)
- now works with arbitrary commands for branch types
- consistent variable names
- new branch type 'support' for long-term support branches of historic
versions
- preliminary base branch support for hotfix branch type to create
hotfixes form support branches
diff --git a/git-flow-release b/git-flow-release
new file mode 100755
index 0000000..3f5683e
--- /dev/null
+++ b/git-flow-release
@@ -0,0 +1,104 @@
+#
+# gitflow -- A collection of Git wrapper scripts to provide high-level
+# repository operations for Vincent Driessen's branching model:
+#
+# Original blog post presenting this model is found at:
+# http://nvie.com/archives/323
+#
+# Feel free to contribute to this project at:
+# http://github.com/nvie/gitflow
+#
+# Copyright (c) 2010 by Vincent Driessen
+# Copyright (c) 2010 by Benedikt Böhm
+#
+
+usage() {
+ echo "usage: git flow start release <version>"
+ echo " git flow finish release <version>"
+ # TODO
+ #echo ""
+ #echo "options:"
+ #echo "--option Explanation"
+ #echo ""
+ #echo "start-only options:"
+ #echo "--bump <script>"
+ #echo " Run the given script to auto-update the version number"
+ #echo ""
+ #echo "finish-only options:"
+ #echo "--push Push to the origin repo when finished"
+}
+
+parse_args() {
+ VERSION="$1"
+ if [ "$VERSION" = "" ]; then
+ echo "Missing argument <version>."
+ usage
+ exit 1
+ fi
+ BRANCH=release/$VERSION
+}
+
+cmd_help() {
+ usage
+ exit 0
+}
+
+cmd_start() {
+ parse_args "$@"
+
+ # sanity checks
+ gitflow_check_clean_working_tree
+ git fetch origin
+ gitflow_require_branches_equal develop origin/develop
+ gitflow_require_branch_absent $BRANCH
+
+ # create branch
+ git checkout -b $BRANCH develop
+
+ echo
+ echo "Summary of actions:"
+ echo "- A new branch '$BRANCH' was created, based on 'develop'"
+ echo "- You are now on branch '$BRANCH'"
+ echo
+ echo "Follow-up actions:"
+ echo "- Bump the version number now!"
+ echo "- Start committing last-minute fixes in preparing your release"
+ echo "- When done, run:"
+ echo
+ echo " git flow finish release '$VERSION'"
+ echo
+}
+
+cmd_finish() {
+ parse_args "$@"
+
+ # sanity checks
+ gitflow_check_clean_working_tree
+ git fetch origin
+ gitflow_require_branches_equal master origin/master
+ gitflow_require_branches_equal develop origin/develop
+
+ # merge into master
+ git checkout master
+ git merge --no-ff $BRANCH
+ git tag v$VERSION
+
+ # merge into develop
+ git checkout develop
+ git merge --no-ff $BRANCH
+
+ # 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
+
+ echo
+ echo "Summary of actions:"
+ echo "- Latest objects have been fetched from 'origin'"
+ echo "- Release branch has been merged into 'master'"
+ echo "- The release was tagged 'v$VERSION'"
+ echo "- Release branch has been back-merged into 'develop'"
+ echo "- Release branch '$BRANCH' has been deleted"
+ echo
+}