Refactored the feature, release and support subcommands, too.
diff --git a/git-flow-feature b/git-flow-feature
index 43132d7..6f3a0bb 100644
--- a/git-flow-feature
+++ b/git-flow-feature
@@ -47,8 +47,8 @@
}
cmd_default() {
- # TODO: refactor this, because passing in this dummy "foo" is really ugly!
- parse_args "$@" foo
+ # TODO: Refactor getting this prefix into a general function
+ PREFIX=$(git config --get gitflow.prefix.feature || echo feature/)
FEATURE_BRANCHES="$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")"
if [ -z "$FEATURE_BRANCHES" ]; then
warn "No feature branches exist."
diff --git a/git-flow-release b/git-flow-release
index aebffa1..1fec600 100644
--- a/git-flow-release
+++ b/git-flow-release
@@ -13,8 +13,9 @@
#
usage() {
- echo "usage: git flow start release <version>"
- echo " git flow finish release <version>"
+ echo "usage: git flow release"
+ echo " git flow release start <version>"
+ echo " git flow release finish <version>"
# TODO
#echo ""
#echo "options:"
@@ -40,6 +41,17 @@
BRANCH=$PREFIX$VERSION
}
+cmd_default() {
+ # TODO: Refactor getting this prefix into a general function
+ PREFIX=$(git config --get gitflow.prefix.release || echo release/)
+ RELEASE_BRANCHES="$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")"
+ if [ -z "$RELEASE_BRANCHES" ]; then
+ warn "No release branches exist."
+ exit 0
+ fi
+ echo "$RELEASE_BRANCHES" | sed "s?^$PREFIX??g"
+}
+
cmd_help() {
usage
exit 0
diff --git a/git-flow-support b/git-flow-support
index d855eaa..adb336d 100644
--- a/git-flow-support
+++ b/git-flow-support
@@ -13,7 +13,8 @@
#
usage() {
- echo "usage: git flow start support <version> [<base>]"
+ echo "usage: git flow support"
+ echo " git flow support start <version> [<base>]"
}
parse_args() {
@@ -29,6 +30,17 @@
BRANCH=$PREFIX$VERSION
}
+cmd_default() {
+ # TODO: Refactor getting this prefix into a general function
+ PREFIX=$(git config --get gitflow.prefix.support || echo support/)
+ SUPPORT_BRANCHES="$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")"
+ if [ -z "$SUPPORT_BRANCHES" ]; then
+ warn "No support branches exist."
+ exit 0
+ fi
+ echo "$SUPPORT_BRANCHES" | sed "s?^$PREFIX??g"
+}
+
cmd_help() {
usage
exit 0