Functionally implement the creation/finishing of release branches.
diff --git a/TODO.mdown b/TODO.mdown
index 7e652ac..0bb08db 100644
--- a/TODO.mdown
+++ b/TODO.mdown
@@ -1,5 +1,15 @@
TODO-list
=========
+
+General configuration
+---------------------
- Support configurable naming for fixed branch names 'master' and 'develop'
- Support configurable naming conventions (i.e. name prefixes) for supporting
branches, instead of fixed 'release-\*' and 'hotfix-\*'
+
+Release branch support
+----------------------
+- Take care of the situation where two release branches live next to each
+ other. In that situation, a "finish release" action should merge back changes
+ into the other release, not into 'develop'. Or at least warn about it. Or not
+ support creating a new release branch if the other isn't finished yet.
diff --git a/gitflow-release b/gitflow-release
index 8790405..b4f2424 100755
--- a/gitflow-release
+++ b/gitflow-release
@@ -15,12 +15,23 @@
usage() {
echo "usage: gitflow start release <release>"
echo " gitflow finish release <release>"
+ # 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() {
RELEASE="$1"
if [ "$RELEASE" = "" ]; then
- echo "Missing argument <release>."
+ echo "Missing argument <release>"
usage
exit 1
fi
@@ -36,8 +47,19 @@
gitflow_require_branch_absent "$RELEASE_BRANCH"
# All checks passed, ready to roll
- echo "git checkout -b \"$RELEASE_BRANCH\" develop"
- echo "Don't forget to bump the version number now."
+ git checkout -b "$RELEASE_BRANCH" develop
+
+ echo ""
+ echo "Summary of actions:"
+ echo "- A new branch '$RELEASE_BRANCH' was created, based on 'develop'"
+ echo "- You are now on branch '$RELEASE_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 " gitflow finish release '$RELEASE_BRANCH'"
}
finish() {
@@ -46,17 +68,29 @@
# Checks
gitflow_check_clean_working_tree
- echo "git fetch origin"
- git fetch origin
+ git fetch origin develop # TODO: Make a flag to skip these fetches
+ git fetch origin master # TODO: Make a flag to skip these fetches
gitflow_require_branches_equal 'master' 'origin/master'
gitflow_require_branches_equal 'develop' 'origin/develop'
# All checks passed, ready to roll
- echo "git checkout master"
- echo "git merge --no-ff \"$RELEASE_BRANCH\""
- echo "git tag \"$RELEASE\""
- echo "git checkout develop"
- echo "git merge --no-ff \"$RELEASE_BRANCH\""
- echo "git branch -d \"$RELEASE_BRANCH\""
+ git checkout master
+ git merge --no-ff "$RELEASE_BRANCH"
+ git tag "$RELEASE"
+ git checkout develop
+ git merge --no-ff "$RELEASE_BRANCH"
+ git branch -d "$RELEASE_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 '$RELEASE'"
+ echo "- Release branch has been back-merged into 'develop'"
+ echo "- Release branch '$RELEASE_BRANCH' has been deleted"
+ echo ""
}