From 6158d5163fc032632d942dd7520090e5d82e498d Mon Sep 17 00:00:00 2001 From: Vedang Manerikar Date: Mon, 30 Jan 2012 18:38:46 +0530 Subject: [PATCH 01/22] Added a -r flag to git-flow-feature-pull to support pull with rebase --- git-flow-feature | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index 726b4aed5..d653ec11f 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -50,7 +50,7 @@ usage() { echo " git flow feature diff []" echo " git flow feature rebase [-i] []" echo " git flow feature checkout []" - echo " git flow feature pull []" + echo " git flow feature pull [-r] []" } cmd_default() { @@ -475,6 +475,7 @@ avoid_accidental_cross_branch_action() { cmd_pull() { #DEFINE_string prefix false 'alternative remote feature branch name prefix' p + DEFINE_boolean rebase false "pull with rebase" r parse_remote_name "$@" if [ -z "$REMOTE" ]; then @@ -500,7 +501,15 @@ cmd_pull() { # we already have a local branch called like this, so simply pull the # remote changes in - git pull -q "$REMOTE" "$BRANCH" || die "Failed to pull from remote '$REMOTE'." + if flag rebase; then + if ! git pull --rebase -q "$REMOTE" "$BRANCH"; then + warn "Pull was aborted. There might be conflicts during rebase or '$REMOTE' might be inaccessible." + exit 1 + fi + else + git pull -q "$REMOTE" "$BRANCH" || die "Failed to pull from remote '$REMOTE'." + fi + echo "Pulled $REMOTE's changes into $BRANCH." else # setup the local branch clone for the first time From 3b86dd34ca400d039ef1d7a1b07f30ad3ad6cb83 Mon Sep 17 00:00:00 2001 From: Vedang Manerikar Date: Mon, 30 Jan 2012 19:26:38 +0530 Subject: [PATCH 02/22] install from my github repo --- contrib/gitflow-installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/gitflow-installer.sh b/contrib/gitflow-installer.sh index 0e92ffcef..68dcec018 100644 --- a/contrib/gitflow-installer.sh +++ b/contrib/gitflow-installer.sh @@ -17,7 +17,7 @@ if [ -z "$REPO_NAME" ] ; then fi if [ -z "$REPO_HOME" ] ; then - REPO_HOME="http://github.com/nvie/gitflow.git" + REPO_HOME="http://github.com/vedang/gitflow.git" fi EXEC_FILES="git-flow" From 37f7d14b2f566390c824be6168ec730d11bb531e Mon Sep 17 00:00:00 2001 From: Vedang Manerikar Date: Mon, 12 Mar 2012 17:03:11 +0530 Subject: [PATCH 03/22] Added a track command to git-flow-hotfix along the lines of the git-flow-feature track command --- git-flow-hotfix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/git-flow-hotfix b/git-flow-hotfix index b355f3019..4ea87fc87 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -47,6 +47,7 @@ usage() { echo " git flow hotfix start [-F] []" echo " git flow hotfix finish [-Fsumpk] " echo " git flow hotfix publish " + echo " git flow hotfix track " } cmd_default() { @@ -216,6 +217,26 @@ cmd_publish() { echo } +cmd_track() { + parse_args "$@" + require_version_arg + + # sanity checks + require_clean_working_tree + require_branch_absent "$BRANCH" + git fetch -q "$ORIGIN" + require_branch "$ORIGIN/$BRANCH" + + # create tracking branch + git checkout -b "$BRANCH" "$ORIGIN/$BRANCH" + + echo + echo "Summary of actions:" + echo "- A new remote tracking branch '$BRANCH' was created" + echo "- You are now on branch '$BRANCH'" + echo +} + cmd_finish() { DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F DEFINE_boolean sign false "sign the release tag cryptographically" s From 51011ac8fdfb1b66c34ea74186bf24412ca70eb2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 14 Mar 2012 11:59:55 +0200 Subject: [PATCH 04/22] make the installer for msysgit search in ~/bin as well --- contrib/msysgit-install.cmd | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/msysgit-install.cmd b/contrib/msysgit-install.cmd index 5f005bfa7..994235c79 100644 --- a/contrib/msysgit-install.cmd +++ b/contrib/msysgit-install.cmd @@ -63,6 +63,7 @@ goto :End :ChkGetopt :: %1 is getopt.exe if exist "%GIT_HOME%\bin\%1" goto :EOF +if exist "%USERPROFILE%\bin\%1" goto :EOF if exist "%~f$PATH:1" goto :EOF echo %GIT_HOME%\bin\%1 not found.>&2 echo You have to install this file manually. See the GitFlow README. From afb191f790b113c1ebf0a5c4ab06676632a8b5db Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Mon, 9 Apr 2012 11:19:20 -0400 Subject: [PATCH 05/22] Fixes #206 --- git-flow-hotfix | 2 +- git-flow-release | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/git-flow-hotfix b/git-flow-hotfix index b355f3019..e827863b3 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -269,7 +269,7 @@ cmd_finish() { flag sign && opts="$opts -s" [ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'" [ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'" - eval git tag $opts "$VERSION_PREFIX$VERSION" || \ + eval git tag $opts "$VERSION_PREFIX$VERSION" "$BRANCH" || \ die "Tagging failed. Please run finish again to retry." fi fi diff --git a/git-flow-release b/git-flow-release index bb39d5276..e91a1acef 100644 --- a/git-flow-release +++ b/git-flow-release @@ -239,7 +239,7 @@ cmd_finish() { flag sign && opts="$opts -s" [ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'" [ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'" - eval git tag $opts "$tagname" || \ + eval git tag $opts "$tagname" "$BRANCH" || \ die "Tagging failed. Please run finish again to retry." fi fi From 6fa8fed23e2781767b8d3e8ab7e2b3f30876c7c7 Mon Sep 17 00:00:00 2001 From: Myke Hines Date: Thu, 19 Apr 2012 11:01:23 -0700 Subject: [PATCH 06/22] Release finish squash parameter Adding an optional (false by default) -S option to 'git flow release finish' to allow squashing the commit --- git-flow-release | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/git-flow-release b/git-flow-release index bb39d5276..67037d7a6 100644 --- a/git-flow-release +++ b/git-flow-release @@ -45,7 +45,7 @@ PREFIX=$(git config --get gitflow.prefix.release) usage() { echo "usage: git flow release [list] [-v]" echo " git flow release start [-F] []" - echo " git flow release finish [-Fsumpk] " + echo " git flow release finish [-FsumpkS] " echo " git flow release publish " echo " git flow release track " } @@ -193,6 +193,7 @@ cmd_finish() { 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 + DEFINE_boolean squash false "squash release during merge" S parse_args "$@" require_version_arg @@ -224,9 +225,15 @@ cmd_finish() { if ! git_is_branch_merged_into "$BRANCH" "$MASTER_BRANCH"; then git checkout "$MASTER_BRANCH" || \ die "Could not check out $MASTER_BRANCH." - git merge --no-ff "$BRANCH" || \ - die "There were merge conflicts." - # TODO: What do we do now? + if noflag squash; then + git merge --no-ff "$BRANCH" || \ + die "There were merge conflicts." + # TODO: What do we do now? + else + git merge --squash "$BRANCH" || \ + die "There were merge conflicts." + git commit + fi fi if noflag notag; then @@ -253,9 +260,16 @@ cmd_finish() { # TODO: Actually, accounting for 'git describe' pays, so we should # ideally git merge --no-ff $tagname here, instead! - git merge --no-ff "$BRANCH" || \ - die "There were merge conflicts." - # TODO: What do we do now? + if noflag squash; then + git merge --no-ff "$BRANCH" || \ + die "There were merge conflicts." + # TODO: What do we do now? + else + git merge --squash "$BRANCH" || \ + die "There were merge conflicts." + # TODO: What do we do now? + git commit + fi fi # delete branch From 75fbdd7bf7b81eb8965f5ec4e78fc8776373aa75 Mon Sep 17 00:00:00 2001 From: Myke Hines Date: Thu, 19 Apr 2012 11:14:22 -0700 Subject: [PATCH 07/22] Feature finish squash parameter Adding an optional (false by default) -S option to 'git flow feature finish' to allow squashing the commit --- git-flow-feature | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index e97d67825..c85c1e37f 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -44,7 +44,7 @@ PREFIX=$(git config --get gitflow.prefix.feature) usage() { echo "usage: git flow feature [list] [-v]" echo " git flow feature start [-F] []" - echo " git flow feature finish [-rFkD] []" + echo " git flow feature finish [-rFkDS] []" echo " git flow feature publish " echo " git flow feature track " echo " git flow feature diff []" @@ -232,6 +232,7 @@ cmd_finish() { DEFINE_boolean rebase false "rebase instead of merge" r DEFINE_boolean keep false "keep branch after performing finish" k DEFINE_boolean force_delete false "force delete feature branch after finish" D + DEFINE_boolean squash false "squash feature during merge" S parse_args "$@" expand_nameprefix_arg_or_current @@ -312,7 +313,13 @@ cmd_finish() { if [ "$(git rev-list -n2 "$DEVELOP_BRANCH..$BRANCH" | wc -l)" -eq 1 ]; then git merge --ff "$BRANCH" else - git merge --no-ff "$BRANCH" + if noflag squash; then + git merge --no-ff "$BRANCH" + else + git merge --squash "$BRANCH" + git commit + git merge "$BRANCH" + fi fi if [ $? -ne 0 ]; then @@ -353,7 +360,7 @@ helper_finish_cleanup() { git branch -d "$BRANCH" fi fi - +t echo echo "Summary of actions:" echo "- The feature branch '$BRANCH' was merged into '$DEVELOP_BRANCH'" From dc902eda3e79ae00a293b9dd2006c019ab252520 Mon Sep 17 00:00:00 2001 From: pccr Date: Sat, 21 Apr 2012 00:23:55 -0400 Subject: [PATCH 08/22] 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 09/22] 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 10/22] 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 11/22] 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 12/22] 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 13/22] 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: From 0c4d0bf0f01b252967fb8f79d946642901d80b92 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 9 Jul 2012 14:23:59 +0200 Subject: [PATCH 14/22] Cleanup (mostly whitespace issues). --- git-flow-feature | 16 ++++++++-------- git-flow-release | 40 ++++++++++++++++++++-------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index c85c1e37f..8014fcc85 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -232,7 +232,7 @@ cmd_finish() { DEFINE_boolean rebase false "rebase instead of merge" r DEFINE_boolean keep false "keep branch after performing finish" k DEFINE_boolean force_delete false "force delete feature branch after finish" D - DEFINE_boolean squash false "squash feature during merge" S + DEFINE_boolean squash false "squash feature during merge" S parse_args "$@" expand_nameprefix_arg_or_current @@ -313,13 +313,13 @@ cmd_finish() { if [ "$(git rev-list -n2 "$DEVELOP_BRANCH..$BRANCH" | wc -l)" -eq 1 ]; then git merge --ff "$BRANCH" else - if noflag squash; then + if noflag squash; then git merge --no-ff "$BRANCH" - else - git merge --squash "$BRANCH" - git commit - git merge "$BRANCH" - fi + else + git merge --squash "$BRANCH" + git commit + git merge "$BRANCH" + fi fi if [ $? -ne 0 ]; then @@ -360,7 +360,7 @@ helper_finish_cleanup() { git branch -d "$BRANCH" fi fi -t + echo echo "Summary of actions:" echo "- The feature branch '$BRANCH' was merged into '$DEVELOP_BRANCH'" diff --git a/git-flow-release b/git-flow-release index 67037d7a6..e246b37b7 100644 --- a/git-flow-release +++ b/git-flow-release @@ -193,7 +193,7 @@ cmd_finish() { 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 - DEFINE_boolean squash false "squash release during merge" S + DEFINE_boolean squash false "squash release during merge" S parse_args "$@" require_version_arg @@ -225,15 +225,15 @@ cmd_finish() { if ! git_is_branch_merged_into "$BRANCH" "$MASTER_BRANCH"; then git checkout "$MASTER_BRANCH" || \ die "Could not check out $MASTER_BRANCH." - if noflag squash; then - git merge --no-ff "$BRANCH" || \ - die "There were merge conflicts." - # TODO: What do we do now? - else - git merge --squash "$BRANCH" || \ - die "There were merge conflicts." - git commit - fi + if noflag squash; then + git merge --no-ff "$BRANCH" || \ + die "There were merge conflicts." + # TODO: What do we do now? + else + git merge --squash "$BRANCH" || \ + die "There were merge conflicts." + git commit + fi fi if noflag notag; then @@ -260,16 +260,16 @@ cmd_finish() { # TODO: Actually, accounting for 'git describe' pays, so we should # ideally git merge --no-ff $tagname here, instead! - if noflag squash; then - git merge --no-ff "$BRANCH" || \ - die "There were merge conflicts." - # TODO: What do we do now? - else - git merge --squash "$BRANCH" || \ - die "There were merge conflicts." - # TODO: What do we do now? - git commit - fi + if noflag squash; then + git merge --no-ff "$BRANCH" || \ + die "There were merge conflicts." + # TODO: What do we do now? + else + git merge --squash "$BRANCH" || \ + die "There were merge conflicts." + # TODO: What do we do now? + git commit + fi fi # delete branch From 805d2454ee0fd68e1bf0778b38d05789998daadf Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 9 Jul 2012 14:31:17 +0200 Subject: [PATCH 15/22] Credit where credit is due. --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index f7d1e6638..aded955fc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -19,5 +19,6 @@ Authors are (ordered by first commit date): - Emre Berge Ergenekon - Eric Holmes - Vedang Manerikar +- Myke Hines Portions derived from other open source works are clearly marked. From c7e50eed6ed23002778bcaaccd70c4e91a7d5cea Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 9 Jul 2012 14:37:29 +0200 Subject: [PATCH 16/22] Revert unnecessary changes. --- git-flow-feature | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index 39c1d1957..e97d67825 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -9,17 +9,17 @@ # http://github.com/nvie/gitflow # # Copyright 2010 Vincent Driessen. All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: -# +# # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. -# +# # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# +# # THIS SOFTWARE IS PROVIDED BY VINCENT DRIESSEN ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -30,7 +30,7 @@ # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# +# # The views and conclusions contained in the software and documentation are # those of the authors and should not be interpreted as representing official # policies, either expressed or implied, of Vincent Driessen. @@ -244,7 +244,7 @@ cmd_finish() { # TODO: detect that we're working on the correct branch here! # The user need not necessarily have given the same $NAME twice here # (although he/she should). - # + # # TODO: git_is_clean_working_tree() should provide an alternative # exit code for "unmerged changes in working tree", which we should @@ -270,7 +270,7 @@ cmd_finish() { echo "Merge conflicts not resolved yet, use:" echo " git mergetool" echo " git commit" - echo + echo echo "You can then complete the finish by running it again:" echo " git flow feature finish $NAME" echo @@ -324,7 +324,7 @@ cmd_finish() { echo "There were merge conflicts. To resolve the merge conflict manually, use:" echo " git mergetool" echo " git commit" - echo + echo echo "You can then complete the finish by running it again:" echo " git flow feature finish $NAME" echo @@ -344,8 +344,8 @@ helper_finish_cleanup() { if flag fetch; then git push "$ORIGIN" ":refs/heads/$BRANCH" fi - - + + if noflag keep; then if flag force_delete; then git branch -D "$BRANCH" From 76ec133f9d2a643a930c05b126e5673f4c2c5f75 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 9 Jul 2012 14:38:01 +0200 Subject: [PATCH 17/22] Revert changes installer location. --- contrib/gitflow-installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/gitflow-installer.sh b/contrib/gitflow-installer.sh index 68dcec018..0e92ffcef 100644 --- a/contrib/gitflow-installer.sh +++ b/contrib/gitflow-installer.sh @@ -17,7 +17,7 @@ if [ -z "$REPO_NAME" ] ; then fi if [ -z "$REPO_HOME" ] ; then - REPO_HOME="http://github.com/vedang/gitflow.git" + REPO_HOME="http://github.com/nvie/gitflow.git" fi EXEC_FILES="git-flow" From b72a395ba6d0659f1008754000bb6a066a7fb551 Mon Sep 17 00:00:00 2001 From: Fred Condo Date: Mon, 9 Jul 2012 18:37:12 -0700 Subject: [PATCH 18/22] Prevent error message on git flow init As explained by Peter van der Does, the init command does not have the init function, nor does it need one. --- git-flow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow b/git-flow index 19c337ef7..cdf0e07c1 100755 --- a/git-flow +++ b/git-flow @@ -109,7 +109,7 @@ main() { fi # run the specified action - if [ $SUBACTION != "help" ]; then + if [ $SUBACTION != "help" ] && [ $SUBCOMMAND != "init" ] ; then init fi cmd_$SUBACTION "$@" From 5bca8d9358f5b08af40ac32f289bb14b18965cec Mon Sep 17 00:00:00 2001 From: Jerome Baum Date: Tue, 25 Sep 2012 15:46:44 +0200 Subject: [PATCH 19/22] Create a git_do command to log git actions --- git-flow | 5 +++++ gitflow-common | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/git-flow b/git-flow index cdf0e07c1..fd16d5168 100755 --- a/git-flow +++ b/git-flow @@ -80,6 +80,11 @@ main() { # use the shFlags project to parse the command line arguments . "$GITFLOW_DIR/gitflow-shFlags" FLAGS_PARENT="git flow" + + # allow user to request git action logging + DEFINE_boolean show_commands false 'show actions taken (git commands)' g + + # do actual parsing FLAGS "$@" || exit $? eval set -- "${FLAGS_ARGV}" diff --git a/gitflow-common b/gitflow-common index 4834cf102..332740533 100644 --- a/gitflow-common +++ b/gitflow-common @@ -70,6 +70,14 @@ noflag() { local FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -ne $FLAGS_TRUE ]; } # Git specific common functionality # +git_do() { + # equivalent to git, used to indicate actions that make modifications + if flag show_commands; then + echo "git $@" >&2 + fi + git "$@" +} + git_local_branches() { git branch --no-color | sed 's/^[* ] //'; } git_remote_branches() { git branch -r --no-color | sed 's/^[* ] //'; } git_all_branches() { ( git branch --no-color; git branch -r --no-color) | sed 's/^[* ] //'; } From 15aab26490facf285acef56cb5d61025eacb3a69 Mon Sep 17 00:00:00 2001 From: Jerome Baum Date: Tue, 25 Sep 2012 15:46:52 +0200 Subject: [PATCH 20/22] Use git_do where appropriate --- git-flow-feature | 58 ++++++++++++++++++++++++------------------------ git-flow-hotfix | 38 +++++++++++++++---------------- git-flow-init | 28 +++++++++++------------ git-flow-release | 56 +++++++++++++++++++++++----------------------- git-flow-support | 4 ++-- 5 files changed, 92 insertions(+), 92 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index 3ee35efc2..55198ad82 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -204,7 +204,7 @@ cmd_start() { # update the local repo with remote changes, if asked if flag fetch; then - git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" + git_do fetch -q "$ORIGIN" "$DEVELOP_BRANCH" fi # if the origin branch counterpart exists, assert that the local branch @@ -214,7 +214,7 @@ cmd_start() { fi # create branch - if ! git checkout -b "$BRANCH" "$BASE"; then + if ! git_do checkout -b "$BRANCH" "$BASE"; then die "Could not create feature branch '$BRANCH'" fi @@ -287,8 +287,8 @@ cmd_finish() { # update local repo with remote changes first, if asked if has "$ORIGIN/$BRANCH" $(git_remote_branches); then if flag fetch; then - git fetch -q "$ORIGIN" "$BRANCH" - git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" + git_do fetch -q "$ORIGIN" "$BRANCH" + git_do fetch -q "$ORIGIN" "$DEVELOP_BRANCH" fi fi @@ -311,16 +311,16 @@ cmd_finish() { fi # merge into BASE - git checkout "$DEVELOP_BRANCH" + git_do checkout "$DEVELOP_BRANCH" if [ "$(git rev-list -n2 "$DEVELOP_BRANCH..$BRANCH" | wc -l)" -eq 1 ]; then - git merge --ff "$BRANCH" + git_do merge --ff "$BRANCH" else if noflag squash; then - git merge --no-ff "$BRANCH" + git_do merge --no-ff "$BRANCH" else - git merge --squash "$BRANCH" - git commit - git merge "$BRANCH" + git_do merge --squash "$BRANCH" + git_do commit + git_do merge "$BRANCH" fi fi @@ -351,15 +351,15 @@ helper_finish_cleanup() { # delete branch if flag fetch; then - git push "$ORIGIN" ":refs/heads/$BRANCH" + git_do push "$ORIGIN" ":refs/heads/$BRANCH" fi if noflag keep; then if flag force_delete; then - git branch -D "$BRANCH" + git_do branch -D "$BRANCH" else - git branch -d "$BRANCH" + git_do branch -d "$BRANCH" fi fi @@ -383,17 +383,17 @@ cmd_publish() { # sanity checks require_clean_working_tree require_branch "$BRANCH" - git fetch -q "$ORIGIN" + git_do fetch -q "$ORIGIN" require_branch_absent "$ORIGIN/$BRANCH" # create remote branch - git push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH" - git fetch -q "$ORIGIN" + git_do push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH" + git_do fetch -q "$ORIGIN" # configure remote tracking - git config "branch.$BRANCH.remote" "$ORIGIN" - git config "branch.$BRANCH.merge" "refs/heads/$BRANCH" - git checkout "$BRANCH" + git_do config "branch.$BRANCH.remote" "$ORIGIN" + git_do config "branch.$BRANCH.merge" "refs/heads/$BRANCH" + git_do checkout "$BRANCH" echo echo "Summary of actions:" @@ -410,11 +410,11 @@ cmd_track() { # sanity checks require_clean_working_tree require_branch_absent "$BRANCH" - git fetch -q "$ORIGIN" + git_do fetch -q "$ORIGIN" require_branch "$ORIGIN/$BRANCH" # create tracking branch - git checkout -b "$BRANCH" "$ORIGIN/$BRANCH" + git_do checkout -b "$BRANCH" "$ORIGIN/$BRANCH" echo echo "Summary of actions:" @@ -445,7 +445,7 @@ cmd_checkout() { if [ "$NAME" != "" ]; then expand_nameprefix_arg - git checkout "$BRANCH" + git_do checkout "$BRANCH" else die "Name a feature branch explicitly." fi @@ -464,12 +464,12 @@ cmd_rebase() { require_clean_working_tree require_branch "$BRANCH" - git checkout -q "$BRANCH" + git_do checkout -q "$BRANCH" local OPTS= if flag interactive; then OPTS="$OPTS -i" fi - git rebase $OPTS "$DEVELOP_BRANCH" + git_do rebase $OPTS "$DEVELOP_BRANCH" } avoid_accidental_cross_branch_action() { @@ -511,20 +511,20 @@ cmd_pull() { # we already have a local branch called like this, so simply pull the # remote changes in if flag rebase; then - if ! git pull --rebase -q "$REMOTE" "$BRANCH"; then + if ! git_do pull --rebase -q "$REMOTE" "$BRANCH"; then warn "Pull was aborted. There might be conflicts during rebase or '$REMOTE' might be inaccessible." exit 1 fi else - git pull -q "$REMOTE" "$BRANCH" || die "Failed to pull from remote '$REMOTE'." + git_do pull -q "$REMOTE" "$BRANCH" || die "Failed to pull from remote '$REMOTE'." fi echo "Pulled $REMOTE's changes into $BRANCH." else # setup the local branch clone for the first time - git fetch -q "$REMOTE" "$BRANCH" || die "Fetch failed." # stores in FETCH_HEAD - git branch --no-track "$BRANCH" FETCH_HEAD || die "Branch failed." - git checkout -q "$BRANCH" || die "Checking out new local branch failed." + git_do fetch -q "$REMOTE" "$BRANCH" || die "Fetch failed." # stores in FETCH_HEAD + git_do branch --no-track "$BRANCH" FETCH_HEAD || die "Branch failed." + git_do checkout -q "$BRANCH" || die "Checking out new local branch failed." echo "Created local branch $BRANCH based on $REMOTE's $BRANCH." fi } diff --git a/git-flow-hotfix b/git-flow-hotfix index a3bcfd15b..ba485f6fe 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -169,14 +169,14 @@ cmd_start() { require_branch_absent "$BRANCH" require_tag_absent "$VERSION_PREFIX$VERSION" if flag fetch; then - git fetch -q "$ORIGIN" "$MASTER_BRANCH" + git_do fetch -q "$ORIGIN" "$MASTER_BRANCH" fi if has "$ORIGIN/$MASTER_BRANCH" $(git_remote_branches); then require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH" fi # create branch - git checkout -b "$BRANCH" "$BASE" + git_do checkout -b "$BRANCH" "$BASE" echo echo "Summary of actions:" @@ -199,17 +199,17 @@ cmd_publish() { # sanity checks require_clean_working_tree require_branch "$BRANCH" - git fetch -q "$ORIGIN" + git_do fetch -q "$ORIGIN" require_branch_absent "$ORIGIN/$BRANCH" # create remote branch - git push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH" - git fetch -q "$ORIGIN" + git_do push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH" + git_do fetch -q "$ORIGIN" # configure remote tracking git config "branch.$BRANCH.remote" "$ORIGIN" git config "branch.$BRANCH.merge" "refs/heads/$BRANCH" - git checkout "$BRANCH" + git_do checkout "$BRANCH" echo echo "Summary of actions:" @@ -226,11 +226,11 @@ cmd_track() { # sanity checks require_clean_working_tree require_branch_absent "$BRANCH" - git fetch -q "$ORIGIN" + git_do fetch -q "$ORIGIN" require_branch "$ORIGIN/$BRANCH" # create tracking branch - git checkout -b "$BRANCH" "$ORIGIN/$BRANCH" + git_do checkout -b "$BRANCH" "$ORIGIN/$BRANCH" echo echo "Summary of actions:" @@ -260,9 +260,9 @@ cmd_finish() { require_branch "$BRANCH" require_clean_working_tree if flag fetch; then - git fetch -q "$ORIGIN" "$MASTER_BRANCH" || \ + git_do fetch -q "$ORIGIN" "$MASTER_BRANCH" || \ die "Could not fetch $MASTER_BRANCH from $ORIGIN." - git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" || \ + git_do fetch -q "$ORIGIN" "$DEVELOP_BRANCH" || \ die "Could not fetch $DEVELOP_BRANCH from $ORIGIN." fi if has "$ORIGIN/$MASTER_BRANCH" $(git_remote_branches); then @@ -276,9 +276,9 @@ cmd_finish() { # in case a previous attempt to finish this release branch has failed, # but the merge into master was successful, we skip it now if ! git_is_branch_merged_into "$BRANCH" "$MASTER_BRANCH"; then - git checkout "$MASTER_BRANCH" || \ + git_do checkout "$MASTER_BRANCH" || \ die "Could not check out $MASTER_BRANCH." - git merge --no-ff "$BRANCH" || \ + git_do merge --no-ff "$BRANCH" || \ die "There were merge conflicts." # TODO: What do we do now? fi @@ -294,7 +294,7 @@ cmd_finish() { [ "$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" "$BRANCH" || \ + eval git_do tag $opts "$VERSION_PREFIX$VERSION" "$BRANCH" || \ die "Tagging failed. Please run finish again to retry." fi fi @@ -303,28 +303,28 @@ cmd_finish() { # in case a previous attempt to finish this release branch has failed, # but the merge into develop was successful, we skip it now if ! git_is_branch_merged_into "$BRANCH" "$DEVELOP_BRANCH"; then - git checkout "$DEVELOP_BRANCH" || \ + git_do checkout "$DEVELOP_BRANCH" || \ die "Could not check out $DEVELOP_BRANCH." # TODO: Actually, accounting for 'git describe' pays, so we should # ideally git merge --no-ff $tagname here, instead! - git merge --no-ff "$BRANCH" || \ + git_do merge --no-ff "$BRANCH" || \ die "There were merge conflicts." # TODO: What do we do now? fi # delete branch if noflag keep; then - git branch -d "$BRANCH" + git_do branch -d "$BRANCH" fi if flag push; then - git push "$ORIGIN" "$DEVELOP_BRANCH" || \ + git_do push "$ORIGIN" "$DEVELOP_BRANCH" || \ die "Could not push to $DEVELOP_BRANCH from $ORIGIN." - git push "$ORIGIN" "$MASTER_BRANCH" || \ + git_do push "$ORIGIN" "$MASTER_BRANCH" || \ die "Could not push to $MASTER_BRANCH from $ORIGIN." if noflag notag; then - git push --tags "$ORIGIN" || \ + git_do push --tags "$ORIGIN" || \ die "Could not push tags to $ORIGIN." fi fi diff --git a/git-flow-init b/git-flow-init index 00646fed7..5b4e7e807 100644 --- a/git-flow-init +++ b/git-flow-init @@ -53,7 +53,7 @@ cmd_default() { parse_args "$@" if ! git rev-parse --git-dir >/dev/null 2>&1; then - git init + git_do init else # assure that we are not working in a repo with local changes git_repo_is_headless || require_clean_working_tree @@ -121,14 +121,14 @@ cmd_default() { # name exists, checkout that branch and use it for master if ! git_local_branch_exists "$master_branch" && \ git_remote_branch_exists "origin/$master_branch"; then - git branch "$master_branch" "origin/$master_branch" >/dev/null 2>&1 + git_do branch "$master_branch" "origin/$master_branch" >/dev/null 2>&1 elif ! git_local_branch_exists "$master_branch"; then die "Local branch '$master_branch' does not exist." fi fi # store the name of the master branch - git config gitflow.branch.master "$master_branch" + git_do config gitflow.branch.master "$master_branch" fi # add a develop branch if no such branch exists yet @@ -185,7 +185,7 @@ cmd_default() { fi # store the name of the develop branch - git config gitflow.branch.develop "$develop_branch" + git_do config gitflow.branch.develop "$develop_branch" fi # Creation of HEAD @@ -194,8 +194,8 @@ cmd_default() { # it to be able to create new branches. local created_gitflow_branch=0 if ! git rev-parse --quiet --verify HEAD >/dev/null 2>&1; then - git symbolic-ref HEAD "refs/heads/$master_branch" - git commit --allow-empty --quiet -m "Initial commit" + git_do symbolic-ref HEAD "refs/heads/$master_branch" + git_do commit --allow-empty --quiet -m "Initial commit" created_gitflow_branch=1 fi @@ -213,9 +213,9 @@ cmd_default() { # the develop branch now in that case (we base it on master, of course) if ! git_local_branch_exists "$develop_branch"; then if git_remote_branch_exists "origin/$develop_branch"; then - git branch "$develop_branch" "origin/$develop_branch" >/dev/null 2>&1 + git_do branch "$develop_branch" "origin/$develop_branch" >/dev/null 2>&1 else - git branch --no-track "$develop_branch" "$master_branch" + git_do branch --no-track "$develop_branch" "$master_branch" fi created_gitflow_branch=1 fi @@ -225,7 +225,7 @@ cmd_default() { # switch to develop branch if its newly created if [ $created_gitflow_branch -eq 1 ]; then - git checkout -q "$develop_branch" + git_do checkout -q "$develop_branch" fi # finally, ask the user for naming conventions (branch and tag prefixes) @@ -251,7 +251,7 @@ cmd_default() { printf "\n" fi [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} - git config gitflow.prefix.feature "$prefix" + git_do config gitflow.prefix.feature "$prefix" fi # Release branches @@ -264,7 +264,7 @@ cmd_default() { printf "\n" fi [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} - git config gitflow.prefix.release "$prefix" + git_do config gitflow.prefix.release "$prefix" fi @@ -278,7 +278,7 @@ cmd_default() { printf "\n" fi [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} - git config gitflow.prefix.hotfix "$prefix" + git_do config gitflow.prefix.hotfix "$prefix" fi @@ -292,7 +292,7 @@ cmd_default() { printf "\n" fi [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} - git config gitflow.prefix.support "$prefix" + git_do config gitflow.prefix.support "$prefix" fi @@ -306,7 +306,7 @@ cmd_default() { printf "\n" fi [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} - git config gitflow.prefix.versiontag "$prefix" + git_do config gitflow.prefix.versiontag "$prefix" fi diff --git a/git-flow-release b/git-flow-release index 2d81ed62d..cb95bd486 100644 --- a/git-flow-release +++ b/git-flow-release @@ -136,7 +136,7 @@ require_version_arg() { } require_base_is_on_develop() { - if ! git branch --no-color --contains "$BASE" 2>/dev/null \ + if ! git_do branch --no-color --contains "$BASE" 2>/dev/null \ | sed 's/[* ] //g' \ | grep -q "^$DEVELOP_BRANCH\$"; then die "fatal: Given base '$BASE' is not a valid commit on '$DEVELOP_BRANCH'." @@ -164,14 +164,14 @@ cmd_start() { require_branch_absent "$BRANCH" require_tag_absent "$VERSION_PREFIX$VERSION" if flag fetch; then - git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" + git_do fetch -q "$ORIGIN" "$DEVELOP_BRANCH" fi if has "$ORIGIN/$DEVELOP_BRANCH" $(git_remote_branches); then require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" fi # create branch - git checkout -b "$BRANCH" "$BASE" + git_do checkout -b "$BRANCH" "$BASE" echo echo "Summary of actions:" @@ -210,9 +210,9 @@ cmd_finish() { require_branch "$BRANCH" require_clean_working_tree if flag fetch; then - git fetch -q "$ORIGIN" "$MASTER_BRANCH" || \ + git_do fetch -q "$ORIGIN" "$MASTER_BRANCH" || \ die "Could not fetch $MASTER_BRANCH from $ORIGIN." - git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" || \ + git_do fetch -q "$ORIGIN" "$DEVELOP_BRANCH" || \ die "Could not fetch $DEVELOP_BRANCH from $ORIGIN." fi if has "$ORIGIN/$MASTER_BRANCH" $(git_remote_branches); then @@ -226,16 +226,16 @@ cmd_finish() { # in case a previous attempt to finish this release branch has failed, # but the merge into master was successful, we skip it now if ! git_is_branch_merged_into "$BRANCH" "$MASTER_BRANCH"; then - git checkout "$MASTER_BRANCH" || \ + git_do checkout "$MASTER_BRANCH" || \ die "Could not check out $MASTER_BRANCH." if noflag squash; then - git merge --no-ff "$BRANCH" || \ + git_do merge --no-ff "$BRANCH" || \ die "There were merge conflicts." # TODO: What do we do now? else - git merge --squash "$BRANCH" || \ + git_do merge --squash "$BRANCH" || \ die "There were merge conflicts." - git commit + git_do commit fi fi @@ -250,7 +250,7 @@ cmd_finish() { [ "$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" "$BRANCH" || \ + eval git_do tag $opts "$tagname" "$BRANCH" || \ die "Tagging failed. Please run finish again to retry." fi fi @@ -259,41 +259,41 @@ cmd_finish() { # in case a previous attempt to finish this release branch has failed, # but the merge into develop was successful, we skip it now if ! git_is_branch_merged_into "$BRANCH" "$DEVELOP_BRANCH"; then - git checkout "$DEVELOP_BRANCH" || \ + git_do checkout "$DEVELOP_BRANCH" || \ die "Could not check out $DEVELOP_BRANCH." # TODO: Actually, accounting for 'git describe' pays, so we should # ideally git merge --no-ff $tagname here, instead! if noflag squash; then - git merge --no-ff "$BRANCH" || \ + git_do merge --no-ff "$BRANCH" || \ die "There were merge conflicts." # TODO: What do we do now? else - git merge --squash "$BRANCH" || \ + git_do merge --squash "$BRANCH" || \ die "There were merge conflicts." # TODO: What do we do now? - git commit + git_do commit fi fi # delete branch if noflag keep; then if [ "$BRANCH" = "$(git_current_branch)" ]; then - git checkout "$MASTER_BRANCH" + git_do checkout "$MASTER_BRANCH" fi - git branch -d "$BRANCH" + git_do branch -d "$BRANCH" fi if flag push; then - git push "$ORIGIN" "$DEVELOP_BRANCH" || \ + git_do push "$ORIGIN" "$DEVELOP_BRANCH" || \ die "Could not push to $DEVELOP_BRANCH from $ORIGIN." - git push "$ORIGIN" "$MASTER_BRANCH" || \ + git_do push "$ORIGIN" "$MASTER_BRANCH" || \ die "Could not push to $MASTER_BRANCH from $ORIGIN." if noflag notag; then - git push --tags "$ORIGIN" || \ + git_do push --tags "$ORIGIN" || \ die "Could not push tags to $ORIGIN." fi - git push "$ORIGIN" :"$BRANCH" || \ + git_do push "$ORIGIN" :"$BRANCH" || \ die "Could not delete the remote $BRANCH in $ORIGIN." fi @@ -324,17 +324,17 @@ cmd_publish() { # sanity checks require_clean_working_tree require_branch "$BRANCH" - git fetch -q "$ORIGIN" + git_do fetch -q "$ORIGIN" require_branch_absent "$ORIGIN/$BRANCH" # create remote branch - git push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH" - git fetch -q "$ORIGIN" + git_do push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH" + git_do fetch -q "$ORIGIN" # configure remote tracking - git config "branch.$BRANCH.remote" "$ORIGIN" - git config "branch.$BRANCH.merge" "refs/heads/$BRANCH" - git checkout "$BRANCH" + git_do config "branch.$BRANCH.remote" "$ORIGIN" + git_do config "branch.$BRANCH.merge" "refs/heads/$BRANCH" + git_do checkout "$BRANCH" echo echo "Summary of actions:" @@ -351,11 +351,11 @@ cmd_track() { # sanity checks require_clean_working_tree require_branch_absent "$BRANCH" - git fetch -q "$ORIGIN" + git_do fetch -q "$ORIGIN" require_branch "$ORIGIN/$BRANCH" # create tracking branch - git checkout -b "$BRANCH" "$ORIGIN/$BRANCH" + git_do checkout -b "$BRANCH" "$ORIGIN/$BRANCH" echo echo "Summary of actions:" diff --git a/git-flow-support b/git-flow-support index ba4d92f2f..cdbfc717c 100644 --- a/git-flow-support +++ b/git-flow-support @@ -169,12 +169,12 @@ cmd_start() { # fetch remote changes if flag fetch; then - git fetch -q "$ORIGIN" "$BASE" + git_do fetch -q "$ORIGIN" "$BASE" fi require_branch_absent "$BRANCH" # create branch - git checkout -b "$BRANCH" "$BASE" + git_do checkout -b "$BRANCH" "$BASE" echo echo "Summary of actions:" From 550a5e3f5c6c6d49b4e537e28963efa60e5dd6cb Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 14 Oct 2025 10:54:29 +0200 Subject: [PATCH 21/22] Announce git-flow-next --- README.mdown | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.mdown b/README.mdown index a01079b4b..cadd71ab7 100644 --- a/README.mdown +++ b/README.mdown @@ -1,3 +1,34 @@ +> [!IMPORTANT] +> +> # ⚠️ git-flow has moved to git-flow-next! +> +> **This repository is no longer maintained.** The wonderful team at [Tower](https://www.git-tower.com/) has created [**git-flow-next**](https://git-flow.sh) — a modern, fully customizable evolution of git-flow, built on a generic branch dependency model. It’s fully backward compatible with git-flow, open source, and actively maintained. +> +> ### Get started with git-flow-next: +> +> - **Website:** https://git-flow.sh +> - **GitHub:** https://github.com/gittower/git-flow-next +> - **Evolution Story:** Read about the journey from git-flow → git-flow-avh → git-flow-next in [their blog post](https://git-flow.sh/blog) +> +> ### Why git-flow-next? +> +> git-flow-next builds upon the foundation laid by the original git-flow, offering: +> +> - Full customization of branch names and workflow +> - Modern implementation with active maintenance +> - Backward compatibility with existing git-flow workflows +> - Upcoming features like stacked branches and topic branch syncing +> +> ### Thank you ❤️ +> +> To everyone who has used, contributed to, and supported git-flow over the past 15+ years — thank you! Your feedback, contributions, and adoption made git-flow one of the most widely-used Git workflow tools. Special thanks to Peter van der Does for maintaining git-flow-avh, and to the folks at Tower for carrying the torch forward with git-flow-next. + +--- + +(Below, you’ll find the original documentation for historical reference.) + +--- + git-flow ======== From d2eee63886e23c27a0c0418603c8264276a86340 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 14 Oct 2025 11:12:50 +0200 Subject: [PATCH 22/22] Clean up README by removing outdated sections --- README.mdown | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/README.mdown b/README.mdown index cadd71ab7..b720b125e 100644 --- a/README.mdown +++ b/README.mdown @@ -71,37 +71,6 @@ See the [FAQ](http://github.com/nvie/gitflow/wiki/FAQ) section of the project Wiki. -Please help out ---------------- -This project is still under development. Feedback and suggestions are very -welcome and I encourage you to use the [Issues -list](http://github.com/nvie/gitflow/issues) on Github to provide that -feedback. - -Feel free to fork this repo and to commit your additions. For a list of all -contributors, please see the [AUTHORS](AUTHORS) file. - -Any questions, tips, or general discussion can be posted to our Google group: -[http://groups.google.com/group/gitflow-users](http://groups.google.com/group/gitflow-users) - -Contributing ------------- -Fork the repository. Then, run: - - git clone --recursive git@github.com:/gitflow.git - cd gitflow - git branch master origin/master - git flow init -d - git flow feature start - -Then, do work and commit your changes. **Hint**: ``export PATH=`pwd`:$PATH`` -from within the gitflow directory makes sure you're using the version of -gitflow you're currently developing. - - git flow feature publish - -When done, open a pull request to your feature branch. - License terms ------------- git-flow is published under the liberal terms of the BSD License, see the @@ -162,18 +131,3 @@ The ``-d`` flag will accept all defaults. git flow support start For support branches, the `` arg must be a commit on `master`. - - -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/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: - -[![Flattr this][2]][1] - -[1]: http://flattr.com/thing/53771/git-flow -[2]: http://api.flattr.com/button/button-static-50x60.png