From dc902eda3e79ae00a293b9dd2006c019ab252520 Mon Sep 17 00:00:00 2001 From: pccr Date: Sat, 21 Apr 2012 00:23:55 -0400 Subject: [PATCH 1/6] Added 'init()' function to git-flow-{feature,release,hotfix,support}, which gets called if subargument is not help --- git-flow | 5 ++++- git-flow-feature | 10 ++++++---- git-flow-hotfix | 12 +++++++----- git-flow-release | 12 +++++++----- git-flow-support | 12 +++++++----- 5 files changed, 31 insertions(+), 20 deletions(-) diff --git a/git-flow b/git-flow index 93e9f0f73..19c337ef7 100755 --- a/git-flow +++ b/git-flow @@ -109,7 +109,10 @@ main() { fi # run the specified action - cmd_$SUBACTION "$@" + if [ $SUBACTION != "help" ]; then + init + fi + cmd_$SUBACTION "$@" } main "$@" diff --git a/git-flow-feature b/git-flow-feature index e97d67825..4f7e83956 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -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]" diff --git a/git-flow-hotfix b/git-flow-hotfix index b355f3019..6e2c6d58f 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -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]" diff --git a/git-flow-release b/git-flow-release index bb39d5276..62e3015a6 100644 --- a/git-flow-release +++ b/git-flow-release @@ -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]" diff --git a/git-flow-support b/git-flow-support index 605694dc9..ba4d92f2f 100644 --- a/git-flow-support +++ b/git-flow-support @@ -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." From a223c3a63326f4803f7679748933c0740fcf2dc8 Mon Sep 17 00:00:00 2001 From: Kostas Date: Thu, 31 May 2012 12:28:37 +0100 Subject: [PATCH 2/6] fixed small bug in line 510, 'it' instead of 'git' --- git-flow-feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-feature b/git-flow-feature index e97d67825..eea2b6a78 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -507,7 +507,7 @@ cmd_pull() { exit 1 fi else - it pull -q "$REMOTE" "$BRANCH" || die "Failed to pull from remote '$REMOTE'." + git pull -q "$REMOTE" "$BRANCH" || die "Failed to pull from remote '$REMOTE'." fi echo "Pulled $REMOTE's changes into $BRANCH." From 12c2a9c307058cc38f965bd4a412af7c16192090 Mon Sep 17 00:00:00 2001 From: memleak Date: Fri, 1 Jun 2012 13:45:31 +0300 Subject: [PATCH 3/6] fixes pull existing feature from remote. --- git-flow-feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-feature b/git-flow-feature index e97d67825..eea2b6a78 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -507,7 +507,7 @@ cmd_pull() { exit 1 fi else - it pull -q "$REMOTE" "$BRANCH" || die "Failed to pull from remote '$REMOTE'." + git pull -q "$REMOTE" "$BRANCH" || die "Failed to pull from remote '$REMOTE'." fi echo "Pulled $REMOTE's changes into $BRANCH." From 26327787c75249ca684af39bc111a5f4847ae01e Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Tue, 5 Jun 2012 16:26:10 -0700 Subject: [PATCH 4/6] Fix init -d behaviour when master branch exists, and one or more other branch exists, but develop does not Without this change, init picks 'master' as both the production and integration branch and fails. With it, init detects the clash and behaves the same as if only master exists, picking 'develop' as integration branch --- git-flow-init | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/git-flow-init b/git-flow-init index 4afa1c25e..00646fed7 100644 --- a/git-flow-init +++ b/git-flow-init @@ -153,11 +153,17 @@ cmd_default() { default_suggestion= for guess in $(git config --get gitflow.branch.develop) \ 'develop' 'int' 'integration' 'master'; do - if git_local_branch_exists "$guess"; then + if git_local_branch_exists "$guess" && [ "$guess" != "$master_branch" ]; then default_suggestion="$guess" break fi done + + if [ -z $default_suggestion ]; then + should_check_existence=NO + default_suggestion=$(git config --get gitflow.branch.develop || echo develop) + fi + fi printf "Branch name for \"next release\" development: [$default_suggestion] " From 2e9ab49e7548e3593007ddaac4dd45c1c746b202 Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Fri, 8 Jun 2012 17:38:34 -0700 Subject: [PATCH 5/6] Support reading the tag message from a file in release/hotfix finish This option ('-f' because '-F' was already taken) maps to the 'tag -F' option, and avoids the problem with issue #98 (https://github.com/nvie/gitflow/issues/98) on Mac --- git-flow-hotfix | 2 ++ git-flow-release | 2 ++ 2 files changed, 4 insertions(+) diff --git a/git-flow-hotfix b/git-flow-hotfix index b355f3019..c37be771d 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -221,6 +221,7 @@ cmd_finish() { DEFINE_boolean sign false "sign the release tag cryptographically" s DEFINE_string signingkey "" "use the given GPG-key for the digital signature (implies -s)" u DEFINE_string message "" "use the given tag message" m + DEFINE_string messagefile "" "use the contents of the given file as tag message" f DEFINE_boolean push false "push to $ORIGIN after performing finish" p DEFINE_boolean keep false "keep branch after performing finish" k DEFINE_boolean notag false "don't tag this release" n @@ -269,6 +270,7 @@ cmd_finish() { flag sign && opts="$opts -s" [ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'" [ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'" + [ "$FLAGS_messagefile" != "" ] && opts="$opts -F '$FLAGS_messagefile'" eval git tag $opts "$VERSION_PREFIX$VERSION" || \ die "Tagging failed. Please run finish again to retry." fi diff --git a/git-flow-release b/git-flow-release index bb39d5276..38d93b1d8 100644 --- a/git-flow-release +++ b/git-flow-release @@ -190,6 +190,7 @@ cmd_finish() { DEFINE_boolean sign false "sign the release tag cryptographically" s DEFINE_string signingkey "" "use the given GPG-key for the digital signature (implies -s)" u DEFINE_string message "" "use the given tag message" m + DEFINE_string messagefile "" "use the contents of the given file as a tag message" f DEFINE_boolean push false "push to $ORIGIN after performing finish" p DEFINE_boolean keep false "keep branch after performing finish" k DEFINE_boolean notag false "don't tag this release" n @@ -239,6 +240,7 @@ cmd_finish() { flag sign && opts="$opts -s" [ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'" [ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'" + [ "$FLAGS_messagefile" != "" ] && opts="$opts -F '$FLAGS_messagefile'" eval git tag $opts "$tagname" || \ die "Tagging failed. Please run finish again to retry." fi From 9c48e0569a4e6ce0c028ce580c6c0a592f916b07 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Tue, 3 Jul 2012 13:25:52 -0700 Subject: [PATCH 6/6] Fix broken link to original blog-post --- README.mdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index c7238e6f0..a01079b4b 100644 --- a/README.mdown +++ b/README.mdown @@ -138,7 +138,7 @@ Showing your appreciation A few people already requested it, so now it's here: a Flattr button. Of course, the best way to show your appreciation for the original -[blog post](http://nvie.com/git-model) or the git-flow tool itself remains +[blog post](http://nvie.com/posts/a-successful-git-branching-model/) or the git-flow tool itself remains contributing to the community. If you'd like to show your appreciation in another way, however, consider Flattr'ing me: