Merge branch 'make-feature-work' into develop
This commit is contained in:
commit
788227b4ff
2 changed files with 41 additions and 11 deletions
|
@ -13,8 +13,21 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "usage: gitflow start feature <name> [<base>]"
|
echo "usage: gitflow start feature [<options>] <name> [<base>]"
|
||||||
echo " gitflow finish feature <name>"
|
echo " gitflow finish feature [<options>] <name>"
|
||||||
|
# TODO
|
||||||
|
#echo ""
|
||||||
|
#echo "options:"
|
||||||
|
#echo "--option Explanation"
|
||||||
|
#echo ""
|
||||||
|
#echo "start-only options:"
|
||||||
|
#echo "--option Explanation"
|
||||||
|
#echo ""
|
||||||
|
#echo "finish-only options:"
|
||||||
|
#echo "--rebase Rebases the feature branch on top of develop, instead of merging"
|
||||||
|
#echo "--squash Squashes all commits of the feature branch into a single commit"
|
||||||
|
#echo " on develop"
|
||||||
|
#echo "--push Push to the origin repo when finished"
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_args() {
|
parse_args() {
|
||||||
|
@ -25,7 +38,7 @@ parse_args() {
|
||||||
BASE="develop"
|
BASE="develop"
|
||||||
fi
|
fi
|
||||||
if [ "$FEATURE" = "" ]; then
|
if [ "$FEATURE" = "" ]; then
|
||||||
echo "Missing argument <release>."
|
echo "Missing argument <release>"
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -42,7 +55,16 @@ start() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# All checks passed, ready to roll
|
# All checks passed, ready to roll
|
||||||
echo "git checkout -b $FEATURE $BASE"
|
git checkout -b "$FEATURE" "$BASE"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Summary of actions:"
|
||||||
|
echo "- A new branch '$FEATURE' was created, based on '$BASE'"
|
||||||
|
echo "- You are now on branch '$FEATURE'"
|
||||||
|
echo ""
|
||||||
|
echo "Now, start committing on your feature. When done, use:"
|
||||||
|
echo ""
|
||||||
|
echo " gitflow finish feature '$FEATURE'"
|
||||||
}
|
}
|
||||||
|
|
||||||
finish() {
|
finish() {
|
||||||
|
@ -51,13 +73,20 @@ finish() {
|
||||||
# Checks
|
# Checks
|
||||||
gitflow_check_clean_working_tree
|
gitflow_check_clean_working_tree
|
||||||
gitflow_require_branch "$FEATURE"
|
gitflow_require_branch "$FEATURE"
|
||||||
if [ "$BASE" = "develop" ]; then
|
gitflow_require_branches_equal 'develop' 'origin/develop'
|
||||||
gitflow_require_branches_equal 'develop' 'origin/develop'
|
|
||||||
fi
|
|
||||||
|
|
||||||
# All checks passed, ready to roll
|
# All checks passed, ready to roll
|
||||||
echo "git checkout $BASE"
|
git checkout develop
|
||||||
echo "git merge --no-ff $FEATURE"
|
git merge --no-ff "$FEATURE"
|
||||||
echo "git branch -d $FEATURE"
|
# TODO: How do we handle merge conflicts here??
|
||||||
|
git branch -d "$FEATURE"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Summary of actions:"
|
||||||
|
echo "- The feature branch '$FEATURE' was merged into 'develop'"
|
||||||
|
#echo "- Merge conflicts were resolved" # TODO: Add this line when it's supported
|
||||||
|
echo "- Feature branch '$FEATURE' has been removed"
|
||||||
|
echo "- You are now on branch 'develop'"
|
||||||
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,8 @@ gitflow_require_branches_equal() {
|
||||||
if [ $status -eq 1 ]; then
|
if [ $status -eq 1 ]; then
|
||||||
die "And branch '$1' may be fast-forwarded."
|
die "And branch '$1' may be fast-forwarded."
|
||||||
elif [ $status -eq 2 ]; then
|
elif [ $status -eq 2 ]; then
|
||||||
die "And local branch '$1' is ahead of '$2'."
|
# Warn here, since there is no harm in being ahead
|
||||||
|
warn "And local branch '$1' is ahead of '$2'."
|
||||||
else
|
else
|
||||||
die "Branches need merging first."
|
die "Branches need merging first."
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue