Also add basic skeleton implementation for the gitflow-feature and gitflow-release subcommands.
diff --git a/gitflow-feature b/gitflow-feature
new file mode 100755
index 0000000..244d793
--- /dev/null
+++ b/gitflow-feature
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+usage() {
+ echo "usage: gitflow start feature <name> [<base>]"
+ echo " gitflow finish feature <name>"
+}
+
+parse_args() {
+ # TODO: Implement the optional base argument
+ FEATURE="$1"
+ BASE="develop"
+ if [ "$FEATURE" = "" ]; then
+ echo "Missing argument <release>."
+ usage
+ exit 1
+ fi
+}
+
+start() {
+ # TODO
+ parse_args "$@"
+ gitflow_check_clean_working_tree
+ echo "git checkout -b $FEATURE $BASE"
+}
+
+finish() {
+ # TODO
+ parse_args "$@"
+ gitflow_check_clean_working_tree
+ echo "git checkout $BASE"
+ echo "git merge --no-ff $FEATURE"
+}
+
diff --git a/gitflow-hotfix b/gitflow-hotfix
index aa38ab6..aae2546 100755
--- a/gitflow-hotfix
+++ b/gitflow-hotfix
@@ -5,8 +5,18 @@
echo " gitflow finish hotfix <release>"
}
+parse_args() {
+ RELEASE="$1"
+ if [ "$RELEASE" = "" ]; then
+ echo "Missing argument <release>."
+ usage
+ exit 1
+ fi
+}
+
start() {
# TODO
+ parse_args "$@"
gitflow_check_clean_working_tree
echo "git checkout -b hotfix-$RELEASE master"
echo "Bump version number"
@@ -15,6 +25,7 @@
finish() {
# TODO
+ parse_args "$@"
gitflow_check_clean_working_tree
echo "git checkout master"
echo "git merge --no-ff hotfix-$RELEASE"
diff --git a/gitflow-release b/gitflow-release
new file mode 100755
index 0000000..488312a
--- /dev/null
+++ b/gitflow-release
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+usage() {
+ echo "usage: gitflow start release <release>"
+ echo " gitflow finish release <release>"
+}
+
+parse_args() {
+ RELEASE="$1"
+ if [ "$RELEASE" = "" ]; then
+ echo "Missing argument <release>."
+ usage
+ exit 1
+ fi
+}
+
+start() {
+ # TODO
+ parse_args "$@"
+ gitflow_check_clean_working_tree
+ echo "git checkout -b release-$RELEASE develop"
+ echo "Bump version number"
+ echo "Fix bug"
+}
+
+finish() {
+ # TODO
+ parse_args "$@"
+ gitflow_check_clean_working_tree
+ echo "git checkout master"
+ echo "git merge --no-ff release-$RELEASE"
+ echo "git checkout develop"
+ echo "git merge --no-ff release-$RELEASE"
+ echo "git branch -d release-$RELEASE"
+}
+