Functionally implement the creation/finishing of release branches.
This commit is contained in:
parent
be7d416962
commit
696b9eb83d
2 changed files with 55 additions and 11 deletions
10
TODO.mdown
10
TODO.mdown
|
@ -1,5 +1,15 @@
|
||||||
TODO-list
|
TODO-list
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
General configuration
|
||||||
|
---------------------
|
||||||
- Support configurable naming for fixed branch names 'master' and 'develop'
|
- Support configurable naming for fixed branch names 'master' and 'develop'
|
||||||
- Support configurable naming conventions (i.e. name prefixes) for supporting
|
- Support configurable naming conventions (i.e. name prefixes) for supporting
|
||||||
branches, instead of fixed 'release-\*' and 'hotfix-\*'
|
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.
|
||||||
|
|
|
@ -15,12 +15,23 @@
|
||||||
usage() {
|
usage() {
|
||||||
echo "usage: gitflow start release <release>"
|
echo "usage: gitflow start release <release>"
|
||||||
echo " gitflow finish 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() {
|
parse_args() {
|
||||||
RELEASE="$1"
|
RELEASE="$1"
|
||||||
if [ "$RELEASE" = "" ]; then
|
if [ "$RELEASE" = "" ]; then
|
||||||
echo "Missing argument <release>."
|
echo "Missing argument <release>"
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -36,8 +47,19 @@ start() {
|
||||||
gitflow_require_branch_absent "$RELEASE_BRANCH"
|
gitflow_require_branch_absent "$RELEASE_BRANCH"
|
||||||
|
|
||||||
# All checks passed, ready to roll
|
# All checks passed, ready to roll
|
||||||
echo "git checkout -b \"$RELEASE_BRANCH\" develop"
|
git checkout -b "$RELEASE_BRANCH" develop
|
||||||
echo "Don't forget to bump the version number now."
|
|
||||||
|
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() {
|
finish() {
|
||||||
|
@ -46,17 +68,29 @@ finish() {
|
||||||
# Checks
|
# Checks
|
||||||
gitflow_check_clean_working_tree
|
gitflow_check_clean_working_tree
|
||||||
|
|
||||||
echo "git fetch origin"
|
git fetch origin develop # TODO: Make a flag to skip these fetches
|
||||||
git fetch origin
|
git fetch origin master # TODO: Make a flag to skip these fetches
|
||||||
gitflow_require_branches_equal 'master' 'origin/master'
|
gitflow_require_branches_equal 'master' 'origin/master'
|
||||||
gitflow_require_branches_equal 'develop' 'origin/develop'
|
gitflow_require_branches_equal 'develop' 'origin/develop'
|
||||||
|
|
||||||
# All checks passed, ready to roll
|
# All checks passed, ready to roll
|
||||||
echo "git checkout master"
|
git checkout master
|
||||||
echo "git merge --no-ff \"$RELEASE_BRANCH\""
|
git merge --no-ff "$RELEASE_BRANCH"
|
||||||
echo "git tag \"$RELEASE\""
|
git tag "$RELEASE"
|
||||||
echo "git checkout develop"
|
git checkout develop
|
||||||
echo "git merge --no-ff \"$RELEASE_BRANCH\""
|
git merge --no-ff "$RELEASE_BRANCH"
|
||||||
echo "git branch -d \"$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 ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue