Merge branch 'feature/subcmd-structure' into develop
Conflicts:
git-flow-feature
git-flow-hotfix
git-flow-release
git-flow-support
diff --git a/README.mdown b/README.mdown
index a9a9248..2af8083 100644
--- a/README.mdown
+++ b/README.mdown
@@ -62,12 +62,13 @@
* To list/start/finish release branches, use:
- git flow release
+ git flow release
git flow release start <release>
git flow release finish <release>
* To list/start/finish hotfix branches, use:
+ git flow hotfix
git flow hotfix start <release> [<base-release>]
git flow hotfix finish <release>
diff --git a/git-flow b/git-flow
index 96c2e52..5af7681 100755
--- a/git-flow
+++ b/git-flow
@@ -72,16 +72,6 @@
# run command
. "$GITFLOW_DIR/git-flow-$SUBCOMMAND"
- if ! typeset -f sub_main >/dev/null; then
- usage
- exit 1
- fi
-
- # run command
- sub_main "$@"
-}
-
-sub_main() {
SUBACTION="${1:-default}"; shift
if ! typeset -f cmd_$SUBACTION 2>&1 >/dev/null; then
warn "Unknown subcommand: '$1'"
diff --git a/git-flow-feature b/git-flow-feature
index 8060d47..72e62b4 100644
--- a/git-flow-feature
+++ b/git-flow-feature
@@ -12,6 +12,8 @@
# Copyright (c) 2010 by Benedikt Böhm
#
+PREFIX=$(git config --get gitflow.prefix.feature || echo feature/)
+
usage() {
echo "usage: git flow feature [list]"
echo " git flow feature start <name> [<base>]"
@@ -34,11 +36,6 @@
#echo "--push Push to the origin repo when finished"
}
-# setup will always be called before the actual cmd_* functions
-setup() {
- PREFIX=$(git config --get gitflow.prefix.feature || echo feature/)
-}
-
cmd_default() {
cmd_list "$@"
}
@@ -65,7 +62,6 @@
usage
exit 1
fi
- PREFIX=$(git config --get gitflow.prefix.feature || echo feature/)
BRANCH=$PREFIX$NAME
}
diff --git a/git-flow-hotfix b/git-flow-hotfix
index 153c5ea..7cc1c77 100644
--- a/git-flow-hotfix
+++ b/git-flow-hotfix
@@ -12,6 +12,8 @@
# Copyright (c) 2010 by Benedikt Böhm
#
+PREFIX=$(git config --get gitflow.prefix.hotfix || echo hotfix/)
+
usage() {
echo "usage: git flow hotfix [list]"
echo " git flow hotfix start <version> [<base>]"
@@ -28,11 +30,6 @@
#echo "--push Push to the origin repo when finished"
}
-# setup will always be called before the actual cmd_* functions
-setup() {
- PREFIX=$(git config --get gitflow.prefix.hotfix || echo hotfix/)
-}
-
cmd_default() {
cmd_list "$@"
}
@@ -59,7 +56,6 @@
usage
exit 1
fi
- PREFIX=$(git config --get gitflow.prefix.hotfix || echo hotfix/)
BRANCH=$PREFIX$VERSION
}
diff --git a/git-flow-release b/git-flow-release
index b5f5959..cc861a9 100644
--- a/git-flow-release
+++ b/git-flow-release
@@ -12,6 +12,9 @@
# Copyright (c) 2010 by Benedikt Böhm
#
+VERSION_PREFIX=$(git config --get gitflow.prefix.versiontag)
+PREFIX=$(git config --get gitflow.prefix.release || echo release/)
+
usage() {
echo "usage: git flow release [list]"
echo " git flow release start <version>"
@@ -29,12 +32,6 @@
#echo "--push Push to the origin repo when finished"
}
-# setup will always be called before the actual cmd_* functions
-setup() {
- PREFIX=$(git config --get gitflow.prefix.release || echo release/)
- VERSION_PREFIX=$(git config --get gitflow.prefix.versiontag)
-}
-
cmd_default() {
cmd_list "$@"
}
diff --git a/git-flow-support b/git-flow-support
index fe7ce17..a36b956 100644
--- a/git-flow-support
+++ b/git-flow-support
@@ -12,15 +12,14 @@
# Copyright (c) 2010 by Benedikt Böhm
#
+VERSION_PREFIX=$(git config --get gitflow.prefix.versiontag)
+PREFIX=$(git config --get gitflow.prefix.support || echo support/)
+
usage() {
echo "usage: git flow support [list]"
echo " git flow support start <version> [<base>]"
}
-setup() {
- PREFIX=$(git config --get gitflow.prefix.support || echo support/)
-}
-
cmd_default() {
cmd_list "$@"
}
@@ -40,7 +39,6 @@
}
parse_args() {
- VERSION_PREFIX=$(git config --get gitflow.prefix.versiontag)
VERSION="$1"
BASE="${2:-${VERSION_PREFIX}${VERSION}}"
if [ "$VERSION" = "" ]; then
@@ -48,7 +46,6 @@
usage
exit 1
fi
- PREFIX=$(git config --get gitflow.prefix.support || echo support/)
BRANCH=$PREFIX$VERSION
}