Skip to content

Commit

Permalink
Merge pull request #211 from pcragone/develop
Browse files Browse the repository at this point in the history
Added 'init()' function to git-flow-{feature,release,hotfix,support}
  • Loading branch information
nvie committed Jul 9, 2012
2 parents c072ff6 + dc902ed commit f414f0c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 20 deletions.
5 changes: 4 additions & 1 deletion git-flow
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ main() {
fi

# run the specified action
cmd_$SUBACTION "$@"
if [ $SUBACTION != "help" ]; then
init

This comment has been minimized.

Copy link
@oddnoc

oddnoc Jul 9, 2012

This line causes an error message when doing, for example, "git flow init -fd": "line 113: init: command not found"

This comment has been minimized.

Copy link
@petervanderdoes

petervanderdoes Jul 10, 2012

Line 112 should read:
if [ $SUBACTION != "help" ] && [ $SUBCOMMAND != "init" ] ; then

As the init command does not have the init function, nor does it need one.

This comment has been minimized.

Copy link
@oddnoc

oddnoc Jul 10, 2012

Thanks!

fi
cmd_$SUBACTION "$@"
}

main "$@"
10 changes: 6 additions & 4 deletions git-flow-feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@
# policies, either expressed or implied, of Vincent Driessen.
#

require_git_repo
require_gitflow_initialized
gitflow_load_settings
PREFIX=$(git config --get gitflow.prefix.feature)
init() {
require_git_repo
require_gitflow_initialized
gitflow_load_settings
PREFIX=$(git config --get gitflow.prefix.feature)
}

usage() {
echo "usage: git flow feature [list] [-v]"
Expand Down
12 changes: 7 additions & 5 deletions git-flow-hotfix
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
# policies, either expressed or implied, of Vincent Driessen.
#

require_git_repo
require_gitflow_initialized
gitflow_load_settings
VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
PREFIX=$(git config --get gitflow.prefix.hotfix)
init() {
require_git_repo
require_gitflow_initialized
gitflow_load_settings
VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
PREFIX=$(git config --get gitflow.prefix.hotfix)
}

usage() {
echo "usage: git flow hotfix [list] [-v]"
Expand Down
12 changes: 7 additions & 5 deletions git-flow-release
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
# policies, either expressed or implied, of Vincent Driessen.
#

require_git_repo
require_gitflow_initialized
gitflow_load_settings
VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
PREFIX=$(git config --get gitflow.prefix.release)
init() {
require_git_repo
require_gitflow_initialized
gitflow_load_settings
VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
PREFIX=$(git config --get gitflow.prefix.release)
}

usage() {
echo "usage: git flow release [list] [-v]"
Expand Down
12 changes: 7 additions & 5 deletions git-flow-support
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
# policies, either expressed or implied, of Vincent Driessen.
#

require_git_repo
require_gitflow_initialized
gitflow_load_settings
VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
PREFIX=$(git config --get gitflow.prefix.support)
init() {
require_git_repo
require_gitflow_initialized
gitflow_load_settings
VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
PREFIX=$(git config --get gitflow.prefix.support)
}

warn "note: The support subcommand is still very EXPERIMENTAL!"
warn "note: DO NOT use it in a production situation."
Expand Down

0 comments on commit f414f0c

Please sign in to comment.