From 133c43c8d8fecd6f68385ad7125eb88c4e0944e3 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 19 Mar 2010 19:27:19 +0100 Subject: [PATCH 001/174] Bump the version number to 0.2.1 --- git-flow-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-version b/git-flow-version index cd5bb456b..347e6f48f 100644 --- a/git-flow-version +++ b/git-flow-version @@ -11,7 +11,7 @@ # Copyright (c) 2010 by Vincent Driessen # Copyright (c) 2010 by Benedikt Böhm # -GITFLOW_VERSION=0.2 +GITFLOW_VERSION=0.2.1 usage() { echo "usage: git flow version" From e0b54c070abf014e29f7991d76f867fab17e534d Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 19 Mar 2010 19:27:38 +0100 Subject: [PATCH 002/174] Strip the GIT_EXEC_PATH Makefile parameter. Replaced it by the more Unixy ``prefix''. There is no need to install git-flow inside git's libexec dir by default. It just needs to be *somewhere* on the PATH. --- Makefile | 13 ++++++------- README.mdown | 11 +++-------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 11bf22d91..bb1117e91 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ -AUTO_DETECTED_GIT_EXEC_PATH := $(shell git --exec-path 2>/dev/null || echo /usr/libexec/git-core) -GIT_EXEC_PATH=$(AUTO_DETECTED_GIT_EXEC_PATH) +prefix=/usr/local # files that need mode 755 EXEC_FILES=git-flow @@ -20,11 +19,11 @@ all: install: @test -f gitflow-shFlags || (echo "Run 'git submodule init && git submodule update' first." ; exit 1 ) - install -d -m 0755 $(GIT_EXEC_PATH) - install -m 0755 $(EXEC_FILES) $(GIT_EXEC_PATH) - install -m 0644 $(SCRIPT_FILES) $(GIT_EXEC_PATH) + install -d -m 0755 $(prefix)/bin + install -m 0755 $(EXEC_FILES) $(prefix)/bin + install -m 0644 $(SCRIPT_FILES) $(prefix)/bin uninstall: - test -d $(GIT_EXEC_PATH) && \ - cd $(GIT_EXEC_PATH) && \ + test -d $(prefix)/bin && \ + cd $(prefix)/bin && \ rm -f $(EXEC_FILES) $(SCRIPT_FILES) diff --git a/README.mdown b/README.mdown index ed5be3313..aabdb4dae 100644 --- a/README.mdown +++ b/README.mdown @@ -21,15 +21,10 @@ Then, you can install `git-flow`, using: $ sudo make install -By default, this will look for the directory where Git is already installed, -and install the git-flow extension alongside the other Git subcommands. If git -is not on the system's `PATH`, it tries `/usr/libexec/git-core`. To explicitly -override this setting in case you have installed Git in another location, use: +By default, git-flow will be installed in /usr/local. To change the prefix +where git-flow will be installed, simply specify it explicitly, using: - $ sudo make GIT_EXEC_PATH=/your/custom/path install - -You rarely need to override this manually, the default 'make install' should do -fine. + $ sudo make prefix=/opt/local install Or simply point your `PATH` environment variable to your git-flow checkout directory. From b1033aa3d3d50e5c2df61cad04b6e79c0c542793 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 23 Mar 2010 21:10:13 +0100 Subject: [PATCH 003/174] gitflow-init honors global gitflow configuration that may exist before a new repo is created. --- git-flow-init | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/git-flow-init b/git-flow-init index ffc9e96f0..1408a9ad2 100644 --- a/git-flow-init +++ b/git-flow-init @@ -61,7 +61,7 @@ cmd_default() { if [ "$branch_count" -eq 0 ]; then echo "No branches exist yet. Base branches must be created now." should_check_existence=NO - default_suggestion=master + default_suggestion=$(git config --get gitflow.branch.master || echo master) else echo echo "Which branch should be used for bringing forth production releases?" @@ -69,7 +69,8 @@ cmd_default() { should_check_existence=YES default_suggestion= - for guess in 'production' 'main' 'master'; do + for guess in $(git config --get gitflow.branch.master) \ + 'production' 'main' 'master'; do if git_local_branch_exists "$guess"; then default_suggestion="$guess" break @@ -103,7 +104,7 @@ cmd_default() { branch_count=$(git_local_branches | grep -v "^${master_branch}\$" | wc -l) if [ "$branch_count" -eq 0 ]; then should_check_existence=NO - default_suggestion=develop + default_suggestion=$(git config --get gitflow.branch.develop || echo develop) else echo echo "Which branch should be used for integration of the \"next release\"?" @@ -111,7 +112,8 @@ cmd_default() { should_check_existence=YES default_suggestion= - for guess in 'develop' 'int' 'integration' 'master'; do + for guess in $(git config --get gitflow.branch.develop) \ + 'develop' 'int' 'integration' 'master'; do if git_local_branch_exists "$guess"; then default_suggestion="$guess" break @@ -174,8 +176,15 @@ cmd_default() { fi # finally, ask the user for naming conventions (branch and tag prefixes) - echo - echo "How to name your supporting branch prefixes?" + if flag force || \ + ! git config --get gitflow.prefix.feature >/dev/null 2>&1 || + ! git config --get gitflow.prefix.release >/dev/null 2>&1 || + ! git config --get gitflow.prefix.hotfix >/dev/null 2>&1 || + ! git config --get gitflow.prefix.support >/dev/null 2>&1 || + ! git config --get gitflow.prefix.versiontag >/dev/null 2>&1; then + echo + echo "How to name your supporting branch prefixes?" + fi local prefix From f6228ed8aa49ff942437b5a10425a57f00d2e114 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 23 Mar 2010 21:19:54 +0100 Subject: [PATCH 004/174] Replace \c-terminated echo calls by more portable printf calls. --- git-flow-init | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/git-flow-init b/git-flow-init index 1408a9ad2..46e95afd1 100644 --- a/git-flow-init +++ b/git-flow-init @@ -78,7 +78,7 @@ cmd_default() { done fi - echo "Branch name for production releases: [$default_suggestion] \c" + printf "Branch name for production releases: [$default_suggestion] " read answer master_branch=${answer:-$default_suggestion} @@ -121,7 +121,7 @@ cmd_default() { done fi - echo "Branch name for \"next release\" development: [$default_suggestion] \c" + printf "Branch name for \"next release\" development: [$default_suggestion] " read answer develop_branch=${answer:-$default_suggestion} @@ -191,7 +191,7 @@ cmd_default() { # Feature branches if ! git config --get gitflow.prefix.feature >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.feature || echo feature/) - echo "Feature branches? [$default_suggestion] \c" + printf "Feature branches? [$default_suggestion] " read answer [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} git config gitflow.prefix.feature "$prefix" @@ -200,7 +200,7 @@ cmd_default() { # Release branches if ! git config --get gitflow.prefix.release >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.release || echo release/) - echo "Release branches? [$default_suggestion] \c" + printf "Release branches? [$default_suggestion] " read answer [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} git config gitflow.prefix.release "$prefix" @@ -210,7 +210,7 @@ cmd_default() { # Hotfix branches if ! git config --get gitflow.prefix.hotfix >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.hotfix || echo hotfix/) - echo "Hotfix branches? [$default_suggestion] \c" + printf "Hotfix branches? [$default_suggestion] " read answer [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} git config gitflow.prefix.hotfix "$prefix" @@ -220,7 +220,7 @@ cmd_default() { # Support branches if ! git config --get gitflow.prefix.support >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.support || echo support/) - echo "Support branches? [$default_suggestion] \c" + printf "Support branches? [$default_suggestion] " read answer [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} git config gitflow.prefix.support "$prefix" @@ -230,7 +230,7 @@ cmd_default() { # Version tag prefix if ! git config --get gitflow.prefix.versiontag >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.versiontag || echo "") - echo "Version tag prefix? [$default_suggestion] \c" + printf "Version tag prefix? [$default_suggestion] " read answer [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} git config gitflow.prefix.versiontag "$prefix" From 3176f74eb9de154d0255454d21ee5daaa44d193d Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 25 Mar 2010 15:30:58 +0100 Subject: [PATCH 005/174] Explicitly avoid setting up tracking between develop and master. --- git-flow-init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-init b/git-flow-init index 46e95afd1..e34cb1443 100644 --- a/git-flow-init +++ b/git-flow-init @@ -163,7 +163,7 @@ cmd_default() { # default production branch and develop was "created". We should create # the develop branch now in that case (we base it on master, of course) if ! git_local_branch_exists "$develop_branch"; then - git branch "$develop_branch" "$master_branch" + git branch --no-track "$develop_branch" "$master_branch" created_gitflow_branch=1 fi From b5500d4b3abf5e6f8606e4091fde504edb2e2871 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 25 Mar 2010 15:41:56 +0100 Subject: [PATCH 006/174] Removed left-behind helper functions in git-flow. They were left behind in the main git-flow script, since they are moved over to gitflow-common. --- git-flow | 7 ------- 1 file changed, 7 deletions(-) diff --git a/git-flow b/git-flow index 84adc05e4..d1e17c665 100755 --- a/git-flow +++ b/git-flow @@ -78,11 +78,4 @@ main() { cmd_$SUBACTION "$@" } -# helper functions for common reuse -max() { if [ "$1" -gt "$2" ]; then echo "$1"; else echo "$2"; fi; } - -# convenience functions for checking whether flags have been set or not -flag() { eval FLAG=\$FLAGS_$1; [ $FLAG -eq $FLAGS_TRUE ]; } -noflag() { eval FLAG=\$FLAGS_$1; [ $FLAG -ne $FLAGS_TRUE ]; } - main "$@" From 192ff525ea3be850684338af176d0bbd3354c4e0 Mon Sep 17 00:00:00 2001 From: gmallard Date: Thu, 1 Apr 2010 19:31:09 -0400 Subject: [PATCH 007/174] Correct advisory message. Wording was reversed. --- git-flow-feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-feature b/git-flow-feature index d8d4bb79d..a29cd0111 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -172,7 +172,7 @@ cmd_start() { echo "" echo "Now, start committing on your feature. When done, use:" echo "" - echo " git flow finish feature $NAME" + echo " git flow feature finish $NAME" echo } From 5d1dbe74052c8f1baaf5585915b369aa000611f7 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sun, 4 Apr 2010 15:52:55 +0200 Subject: [PATCH 008/174] Added (BSD) licensing terms to the project. --- LICENSE | 26 ++++++++++++++++++++++++++ README.mdown | 9 +++++++++ 2 files changed, 35 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..e24e26b23 --- /dev/null +++ b/LICENSE @@ -0,0 +1,26 @@ +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 EVENT +SHALL VINCENT DRIESSEN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 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. diff --git a/README.mdown b/README.mdown index aabdb4dae..be21d205c 100644 --- a/README.mdown +++ b/README.mdown @@ -40,6 +40,15 @@ feedback. Feel free to fork this repo and to commit your additions. +License terms +------------- +git-flow is published under the liberal terms of the BSD License, see the +[LICENSE](LICENSE) file. Although the BSD License does not require you to share +any modifications you make to the source code, you are very much encouraged and +invited to contribute back your modifications to the community, preferably +in a Github fork, of course. + + Typical usage: -------------- From 2e1579f760da6ee0ffa9e3a64b4358e553ce55a3 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sun, 4 Apr 2010 16:07:57 +0200 Subject: [PATCH 009/174] Added AUTHORS file. --- AUTHORS | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 AUTHORS diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 000000000..2416f800f --- /dev/null +++ b/AUTHORS @@ -0,0 +1,8 @@ +git-flow was originally written by Vincent Driessen. + +Contributors are: + +- Benedikt Böhm +- Daniel Truemper + +Portions derived from other open source works are clearly marked. From 72c4f94a53ee17ee0d00b69bc0ab23a25c0827a2 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sun, 4 Apr 2010 16:09:56 +0200 Subject: [PATCH 010/174] Whitespace issue. --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index e24e26b23..cedd18231 100644 --- a/LICENSE +++ b/LICENSE @@ -7,7 +7,7 @@ are permitted provided that the following conditions are met: 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 + 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 From d72acbaf7dbdb57bfa559cb106368ea2cf1297ab Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sun, 4 Apr 2010 16:10:17 +0200 Subject: [PATCH 011/174] Added inline license terms to all source files. --- Makefile | 28 ++++++++++++++++++++++++++++ git-flow | 28 ++++++++++++++++++++++++++-- git-flow-feature | 28 ++++++++++++++++++++++++++-- git-flow-hotfix | 28 ++++++++++++++++++++++++++-- git-flow-init | 28 ++++++++++++++++++++++++++-- git-flow-release | 28 ++++++++++++++++++++++++++-- git-flow-support | 28 ++++++++++++++++++++++++++-- git-flow-version | 29 +++++++++++++++++++++++++++-- gitflow-common | 28 ++++++++++++++++++++++++++-- 9 files changed, 237 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index bb1117e91..6f82544fe 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,31 @@ +# +# 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 +# EVENT SHALL VINCENT DRIESSEN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# 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. +# prefix=/usr/local # files that need mode 755 diff --git a/git-flow b/git-flow index d1e17c665..a94bbeb61 100755 --- a/git-flow +++ b/git-flow @@ -9,8 +9,32 @@ # Feel free to contribute to this project at: # http://github.com/nvie/gitflow # -# Copyright (c) 2010 by Vincent Driessen -# Copyright (c) 2010 by Benedikt Böhm +# 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 +# EVENT SHALL VINCENT DRIESSEN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# 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. # # enable debug mode diff --git a/git-flow-feature b/git-flow-feature index a29cd0111..7cba61b26 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -8,8 +8,32 @@ # Feel free to contribute to this project at: # http://github.com/nvie/gitflow # -# Copyright (c) 2010 by Vincent Driessen -# Copyright (c) 2010 by Benedikt Böhm +# 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 +# EVENT SHALL VINCENT DRIESSEN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# 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. # require_git_repo diff --git a/git-flow-hotfix b/git-flow-hotfix index 586617811..65dbaa315 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -8,8 +8,32 @@ # Feel free to contribute to this project at: # http://github.com/nvie/gitflow # -# Copyright (c) 2010 by Vincent Driessen -# Copyright (c) 2010 by Benedikt Böhm +# 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 +# EVENT SHALL VINCENT DRIESSEN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# 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. # require_git_repo diff --git a/git-flow-init b/git-flow-init index e34cb1443..5750fd1e7 100644 --- a/git-flow-init +++ b/git-flow-init @@ -8,8 +8,32 @@ # Feel free to contribute to this project at: # http://github.com/nvie/gitflow # -# Copyright (c) 2010 by Vincent Driessen -# Copyright (c) 2010 by Benedikt Böhm +# 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 +# EVENT SHALL VINCENT DRIESSEN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# 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. # usage() { diff --git a/git-flow-release b/git-flow-release index 2a46a7aa9..882a7be47 100644 --- a/git-flow-release +++ b/git-flow-release @@ -8,8 +8,32 @@ # Feel free to contribute to this project at: # http://github.com/nvie/gitflow # -# Copyright (c) 2010 by Vincent Driessen -# Copyright (c) 2010 by Benedikt Böhm +# 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 +# EVENT SHALL VINCENT DRIESSEN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# 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. # require_git_repo diff --git a/git-flow-support b/git-flow-support index 9403c12c1..1357d1fa3 100644 --- a/git-flow-support +++ b/git-flow-support @@ -8,8 +8,32 @@ # Feel free to contribute to this project at: # http://github.com/nvie/gitflow # -# Copyright (c) 2010 by Vincent Driessen -# Copyright (c) 2010 by Benedikt Böhm +# 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 +# EVENT SHALL VINCENT DRIESSEN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# 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. # require_git_repo diff --git a/git-flow-version b/git-flow-version index 347e6f48f..2fc8eda04 100644 --- a/git-flow-version +++ b/git-flow-version @@ -8,9 +8,34 @@ # Feel free to contribute to this project at: # http://github.com/nvie/gitflow # -# Copyright (c) 2010 by Vincent Driessen -# Copyright (c) 2010 by Benedikt Böhm +# 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 +# EVENT SHALL VINCENT DRIESSEN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# 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. # + GITFLOW_VERSION=0.2.1 usage() { diff --git a/gitflow-common b/gitflow-common index aa337007c..615b36710 100644 --- a/gitflow-common +++ b/gitflow-common @@ -8,8 +8,32 @@ # Feel free to contribute to this project at: # http://github.com/nvie/gitflow # -# Copyright (c) 2010 by Vincent Driessen -# Copyright (c) 2010 by Benedikt Böhm +# 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 +# EVENT SHALL VINCENT DRIESSEN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# 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. # # From d79a0d45d35cf55241e33c7dfc532953e56884c6 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sun, 4 Apr 2010 16:11:44 +0200 Subject: [PATCH 012/174] Added referral link to the AUTHORS file. --- README.mdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index be21d205c..064e37232 100644 --- a/README.mdown +++ b/README.mdown @@ -37,7 +37,8 @@ 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. +Feel free to fork this repo and to commit your additions. For a list of all +contributors, please see the [AUTHORS](AUTHORS) file. License terms From c118a85b44011a1ab102e40650b1e87a4d7254e9 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sun, 4 Apr 2010 16:32:04 +0200 Subject: [PATCH 013/174] Fix: unnecessary requirement of origin when creating a new feature branch. Only test if local branch is behind origin if origin exists. --- git-flow-feature | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/git-flow-feature b/git-flow-feature index 7cba61b26..a1c2ff896 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -182,7 +182,11 @@ cmd_start() { git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" fi - require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" + # if the origin branch counterpart exists, assert that the local branch + # isn't behind it (to avoid unnecessary rebasing) + if git_branch_exists "$ORIGIN/$DEVELOP_BRANCH"; then + require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" + fi # create branch if ! git checkout -b "$BRANCH" "$BASE"; then From d43ab849eb527912b08f6aec4a79ea69ef4ef25c Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 27 May 2010 11:26:01 -0700 Subject: [PATCH 014/174] Added 'feature checkout' subcommand. This can be used as a shortcut to "git checkout feature/full-feature-name". Feature branch prefix names may be used for convenience. --- git-flow-feature | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/git-flow-feature b/git-flow-feature index a1c2ff896..56dd38d27 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -49,6 +49,7 @@ usage() { echo " git flow feature track " echo " git flow feature diff []" echo " git flow feature rebase [-i] []" + echo " git flow feature checkout []" } cmd_default() { @@ -389,6 +390,17 @@ cmd_diff() { fi } +cmd_checkout() { + parse_args "$@" + + if [ "$NAME" != "" ]; then + expand_nameprefix_arg + git checkout "$BRANCH" + else + die "Name a feature branch explicitly." + fi +} + cmd_rebase() { DEFINE_boolean interactive false 'do an interactive rebase' i parse_args "$@" From 5b05ad78d10f8cb596fce1eb8ecf76a232962ace Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 27 May 2010 11:51:50 -0700 Subject: [PATCH 015/174] Fix: incorrect order of arguments in determining whether local branch exists. --- gitflow-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitflow-common b/gitflow-common index 615b36710..f0748acdc 100644 --- a/gitflow-common +++ b/gitflow-common @@ -206,7 +206,7 @@ gitflow_resolve_nameprefix() { local num_matches # first, check if there is a perfect match - if has "$(git_local_branches)" "$prefix$name"; then + if git_local_branch_exists "$prefix$name"; then echo "$name" return 0 fi From a2baef958773cf3d5342fac63c09ee3513f05468 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 27 May 2010 11:52:31 -0700 Subject: [PATCH 016/174] Added alias 'co' for new 'checkout' subcommand. --- git-flow-feature | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git-flow-feature b/git-flow-feature index 56dd38d27..98154ef12 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -401,6 +401,11 @@ cmd_checkout() { fi } +cmd_co() { + # Alias for checkout + cmd_checkout "$@" +} + cmd_rebase() { DEFINE_boolean interactive false 'do an interactive rebase' i parse_args "$@" From b681b4522d51fa20a20a8aacf647b0148d4a803b Mon Sep 17 00:00:00 2001 From: Randy Merrill Date: Sat, 26 Jun 2010 13:14:15 +0800 Subject: [PATCH 017/174] Adding extra instructions when running the list option without any corresponding branches found. --- git-flow-feature | 4 ++++ git-flow-hotfix | 4 ++++ git-flow-release | 5 +++++ git-flow-support | 4 ++++ 4 files changed, 17 insertions(+) diff --git a/git-flow-feature b/git-flow-feature index 98154ef12..e5d0ed641 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -66,6 +66,10 @@ cmd_list() { feature_branches=$(echo "$(git_local_branches)" | grep "^$PREFIX") if [ -z "$feature_branches" ]; then warn "No feature branches exist." + warn "" + warn "You can start a new feature branch:" + warn "" + warn " git flow feature start []" exit 0 fi current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') diff --git a/git-flow-hotfix b/git-flow-hotfix index 65dbaa315..e3ea03533 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -62,6 +62,10 @@ cmd_list() { hotfix_branches=$(echo "$(git_local_branches)" | grep "^$PREFIX") if [ -z "$hotfix_branches" ]; then warn "No hotfix branches exist." + warn "" + warn "You can start a new hotfix branch:" + warn "" + warn " git flow hotfix start []" exit 0 fi current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') diff --git a/git-flow-release b/git-flow-release index 882a7be47..37f44f0df 100644 --- a/git-flow-release +++ b/git-flow-release @@ -62,6 +62,11 @@ cmd_list() { release_branches=$(echo "$(git_local_branches)" | grep "^$PREFIX") if [ -z "$release_branches" ]; then warn "No release branches exist." + warn "" + warn "You can start a new release branch:" + warn "" + warn " git flow release start []" + exit 0 fi diff --git a/git-flow-support b/git-flow-support index 1357d1fa3..ab98fd3f0 100644 --- a/git-flow-support +++ b/git-flow-support @@ -64,6 +64,10 @@ cmd_list() { support_branches=$(echo "$(git_local_branches)" | grep "^$PREFIX") if [ -z "$support_branches" ]; then warn "No support branches exist." + warn "" + warn "You can start a new support branch:" + warn "" + warn " git flow support start " exit 0 fi current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') From 4de01f2572a61b533a4bafe4272763f7697a1a5f Mon Sep 17 00:00:00 2001 From: Randy Merrill Date: Sat, 26 Jun 2010 13:19:06 +0800 Subject: [PATCH 018/174] Adding an extra line to the output for extra spacing. --- git-flow-feature | 1 + git-flow-hotfix | 1 + git-flow-release | 2 +- git-flow-support | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/git-flow-feature b/git-flow-feature index e5d0ed641..618d7f1ac 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -70,6 +70,7 @@ cmd_list() { warn "You can start a new feature branch:" warn "" warn " git flow feature start []" + warn "" exit 0 fi current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') diff --git a/git-flow-hotfix b/git-flow-hotfix index e3ea03533..b505b7650 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -66,6 +66,7 @@ cmd_list() { warn "You can start a new hotfix branch:" warn "" warn " git flow hotfix start []" + warn "" exit 0 fi current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') diff --git a/git-flow-release b/git-flow-release index 37f44f0df..19a9da274 100644 --- a/git-flow-release +++ b/git-flow-release @@ -66,7 +66,7 @@ cmd_list() { warn "You can start a new release branch:" warn "" warn " git flow release start []" - + warn "" exit 0 fi diff --git a/git-flow-support b/git-flow-support index ab98fd3f0..0e58451bf 100644 --- a/git-flow-support +++ b/git-flow-support @@ -68,6 +68,7 @@ cmd_list() { warn "You can start a new support branch:" warn "" warn " git flow support start " + warn "" exit 0 fi current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') From e4badddb56264c1afd45cbbf4bab6eb08f3e6b24 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 5 Jul 2010 14:21:59 +0200 Subject: [PATCH 019/174] Added Randy Merrill to the AUTHORS. --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 2416f800f..a5295ce9a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,5 +4,6 @@ Contributors are: - Benedikt Böhm - Daniel Truemper +- Randy Merrill Portions derived from other open source works are clearly marked. From 06a5de7111e1b6799b40697881ed9a6b038abb3c Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 8 Jul 2010 13:59:54 +0200 Subject: [PATCH 020/174] Forgot to mention Jason L. Shiffer in AUTHORS file. Sorry! --- AUTHORS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index a5295ce9a..c764de449 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,9 +1,9 @@ -git-flow was originally written by Vincent Driessen. - -Contributors are: +Authors are (ordered by first commit date): +- Vincent Driessen - Benedikt Böhm - Daniel Truemper +- Jason L. Shiffer - Randy Merrill Portions derived from other open source works are clearly marked. From e761e355f4c29dbad1ddc8022fa393ebbadcd78c Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 8 Jul 2010 14:41:14 +0200 Subject: [PATCH 021/174] Force deletion of the feature branch after finish. This fix also works when feature branches are created manually, based on remote (i.e. other developers) feature branches, to work on features together. `git branch -d` won't remove local feature branches that are set up to track remote branches, `-D` will. Fixes ticket #31. --- git-flow-feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-feature b/git-flow-feature index 618d7f1ac..d37857bdf 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -320,7 +320,7 @@ helper_finish_cleanup() { if flag fetch; then git push "$ORIGIN" ":refs/heads/$BRANCH" fi - git branch -d "$BRANCH" + git branch -D "$BRANCH" echo echo "Summary of actions:" From 4132de9ec4c94d6de3282c9b8f8cb55675a24769 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 9 Jul 2010 09:30:09 +0200 Subject: [PATCH 022/174] Allow new feature branches in dirty working trees. Before this change, `git-flow feature start` would nag about the working tree being dirty and disallow continuation. Then, there were two alternatives: - stash away your changes manually, create the new branch, restore the stash; or - use `git-flow feature start -f` to force creation There is absolutely no good reason for git-flow to forbid this creation, as git allows it already. Therefore, the -f behaviour is now the default, without an option to turn that behaviour off. Git takes care of unsafe situations again now. --- git-flow-feature | 4 ---- 1 file changed, 4 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index d37857bdf..45a821b16 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -172,15 +172,11 @@ parse_args() { cmd_start() { DEFINE_boolean fetch false 'fetch from origin before performing local operation' F - DEFINE_boolean force false 'force creation of feature branch (ignores dirty working tree)' f parse_args "$@" BASE=${2:-$DEVELOP_BRANCH} require_name_arg # sanity checks - if noflag force; then - require_clean_working_tree - fi require_branch_absent "$BRANCH" # update the local repo with remote changes, if asked From 2b829ce7b7bad547e9fd20e2a3fe0f804a436a8f Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 9 Jul 2010 09:36:20 +0200 Subject: [PATCH 023/174] Forgot to update usage text. --- git-flow-feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-feature b/git-flow-feature index 45a821b16..051e5d395 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -43,7 +43,7 @@ PREFIX=$(git config --get gitflow.prefix.feature) usage() { echo "usage: git flow feature [list] [-v]" - echo " git flow feature start [-Ff] []" + echo " git flow feature start [-F] []" echo " git flow feature finish [-rF] " echo " git flow feature publish " echo " git flow feature track " From ddb350b3f26192a4adc3487312915803fd19e8ff Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 9 Jul 2010 09:42:09 +0200 Subject: [PATCH 024/174] Change the URL of the original blog post. --- git-flow | 2 +- git-flow-feature | 2 +- git-flow-hotfix | 2 +- git-flow-init | 2 +- git-flow-release | 2 +- git-flow-support | 2 +- git-flow-version | 2 +- gitflow-common | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/git-flow b/git-flow index a94bbeb61..e95d4ad0b 100755 --- a/git-flow +++ b/git-flow @@ -4,7 +4,7 @@ # repository operations for Vincent Driessen's branching model. # # Original blog post presenting this model is found at: -# http://nvie.com/archives/323 +# http://nvie.com/git-model # # Feel free to contribute to this project at: # http://github.com/nvie/gitflow diff --git a/git-flow-feature b/git-flow-feature index 051e5d395..ab3fa0172 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -3,7 +3,7 @@ # repository operations for Vincent Driessen's branching model. # # Original blog post presenting this model is found at: -# http://nvie.com/archives/323 +# http://nvie.com/git-model # # Feel free to contribute to this project at: # http://github.com/nvie/gitflow diff --git a/git-flow-hotfix b/git-flow-hotfix index b505b7650..fe8c804a7 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -3,7 +3,7 @@ # repository operations for Vincent Driessen's branching model. # # Original blog post presenting this model is found at: -# http://nvie.com/archives/323 +# http://nvie.com/git-model # # Feel free to contribute to this project at: # http://github.com/nvie/gitflow diff --git a/git-flow-init b/git-flow-init index 5750fd1e7..461ee8cc6 100644 --- a/git-flow-init +++ b/git-flow-init @@ -3,7 +3,7 @@ # repository operations for Vincent Driessen's branching model. # # Original blog post presenting this model is found at: -# http://nvie.com/archives/323 +# http://nvie.com/git-model # # Feel free to contribute to this project at: # http://github.com/nvie/gitflow diff --git a/git-flow-release b/git-flow-release index 19a9da274..bff956165 100644 --- a/git-flow-release +++ b/git-flow-release @@ -3,7 +3,7 @@ # repository operations for Vincent Driessen's branching model. # # Original blog post presenting this model is found at: -# http://nvie.com/archives/323 +# http://nvie.com/git-model # # Feel free to contribute to this project at: # http://github.com/nvie/gitflow diff --git a/git-flow-support b/git-flow-support index 0e58451bf..1ec1b4e9d 100644 --- a/git-flow-support +++ b/git-flow-support @@ -3,7 +3,7 @@ # repository operations for Vincent Driessen's branching model. # # Original blog post presenting this model is found at: -# http://nvie.com/archives/323 +# http://nvie.com/git-model # # Feel free to contribute to this project at: # http://github.com/nvie/gitflow diff --git a/git-flow-version b/git-flow-version index 2fc8eda04..349517ecd 100644 --- a/git-flow-version +++ b/git-flow-version @@ -3,7 +3,7 @@ # repository operations for Vincent Driessen's branching model. # # Original blog post presenting this model is found at: -# http://nvie.com/archives/323 +# http://nvie.com/git-model # # Feel free to contribute to this project at: # http://github.com/nvie/gitflow diff --git a/gitflow-common b/gitflow-common index f0748acdc..29ef38889 100644 --- a/gitflow-common +++ b/gitflow-common @@ -3,7 +3,7 @@ # repository operations for Vincent Driessen's branching model. # # Original blog post presenting this model is found at: -# http://nvie.com/archives/323 +# http://nvie.com/git-model # # Feel free to contribute to this project at: # http://github.com/nvie/gitflow From f68d405cc3a11e9df3671f567658a6ab6ed8e0a1 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 9 Jul 2010 12:34:18 +0200 Subject: [PATCH 025/174] Added new experimental `feature pull` subcommand. This new subcommand lets you easily work together with peers on features. It's intended to be extremely simple to pull changes from your co-developers. This implementation may also be ported to release and/or hotfix branches in the near future, if we agree on the final implementation details. Example use =========== Sharing development of feature branches goes as follows: Suppose Alice and Bob are both developers on project Foo. They have local repos that are up-to-date with `origin`. Then, Alice starts working on some feature: alice$ git flow feature start newprotocol Switched to a new branch 'feature/newprotocol' ... Then, she hacks on the new feature, commits as desired, until the feature's finished. She then likes Bob to code-review the feature, so she asks Bob to pull from her. (Assuming Bob has a Git remote defined, pointing to Alice's repo.) bob$ git remote alice bob$ git branch * develop feature/reader master bob$ git flow feature pull alice newprotocol Created local branch feature/newprotocol based on alice's feature/newprotocol. bob$ git branch develop * feature/newprotocol feature/reader master Since the new feature branch is already checked out, Bob can immediately start peer reviewing the code. He changes the code as desired and commits each comment individually, so Alice can later read the Git commit log as the peer review log. bob$ git commit [feature/newprotocol 1f6fa95] Forgot return statement. 1 files changed, 1 insertions(+), 1 deletions(-) ... When he's finished, he tells Alice he's done. Alice then, in turn pulls in the peer review commits from Bob, using the same command Bob used to fetch the changes initially. (Because feature/newprotocol is still her current branch, she may omit the explicit 'newprotocols' argument.) alice$ git flow feature pull bob Pulled bob's changes into feature/newprotocol. If she disagrees with Bob's comments, she may again commit changes and ask Bob to do the same again. This leads to a continuous pull cycle until both parties agree on the final implementation. Then, Alice (as the feature owner) finished the feature. Bob may discard his feature branch. --- git-flow-feature | 93 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 11 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index ab3fa0172..3ed06d029 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -50,6 +50,7 @@ usage() { echo " git flow feature diff []" echo " git flow feature rebase [-i] []" echo " git flow feature checkout []" + echo " git flow feature pull []" } cmd_default() { @@ -142,34 +143,56 @@ expand_nameprefix_arg() { esac } +use_current_feature_branch_name() { + local current_branch=$(git_current_branch) + if startswith "$current_branch" "$PREFIX"; then + BRANCH=$current_branch + NAME=${BRANCH#$PREFIX} + else + warn "The current HEAD is no feature branch." + warn "Please specify a argument." + exit 1 + fi +} + expand_nameprefix_arg_or_current() { if [ "$NAME" != "" ]; then expand_nameprefix_arg require_branch "$PREFIX$NAME" else - local current_branch=$(git_current_branch) - if startswith "$current_branch" "$PREFIX"; then - BRANCH=$current_branch - NAME=${BRANCH#$PREFIX} - else - warn "The current HEAD is no feature branch." - warn "To diff a feature, specify a argument." - usage - exit 1 - fi + use_current_feature_branch_name fi } -parse_args() { +name_or_current() { + if [ -z "$NAME" ]; then + use_current_feature_branch_name + fi +} + +parse_cmdline() { # parse options FLAGS "$@" || exit $? eval set -- "${FLAGS_ARGV}" +} + +parse_args() { + parse_cmdline "$@" # read arguments into global variables NAME=$1 BRANCH=$PREFIX$NAME } +parse_remote_name() { + parse_cmdline "$@" + + # read arguments into global variables + REMOTE=$1 + NAME=$2 + BRANCH=$PREFIX$NAME +} + cmd_start() { DEFINE_boolean fetch false 'fetch from origin before performing local operation' F parse_args "$@" @@ -422,3 +445,51 @@ cmd_rebase() { fi git rebase $OPTS "$DEVELOP_BRANCH" } + +avoid_accidental_cross_branch_action() { + local current_branch=$(git_current_branch) + if [ "$BRANCH" != "$current_branch" ]; then + warn "Trying to pull from '$BRANCH' while currently on branch '$current_branch'." + warn "To avoid unintended merges, git-flow aborted." + return 1 + fi + return 0 +} + +cmd_pull() { + #DEFINE_string prefix false 'alternative remote feature branch name prefix' p + parse_remote_name "$@" + + if [ -z "$REMOTE" ]; then + die "Name a remote explicitly." + fi + name_or_current + + # To avoid accidentally merging different feature branches into each other, + # die if the current feature branch differs from the requested $NAME + # argument. + local current_branch=$(git_current_branch) + if startswith "$current_branch" "$PREFIX"; then + # we are on a local feature branch already, so $BRANCH must be equal to + # the current branch + avoid_accidental_cross_branch_action || die + fi + + require_clean_working_tree + + if git_branch_exists "$BRANCH"; then + # Again, avoid accidental merges + avoid_accidental_cross_branch_action || die + + # 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'." + 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." + echo "Created local branch $BRANCH based on $REMOTE's $BRANCH." + fi +} From 4f0f539130e0a4ab7883701dfd43fd8aec6799fc Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sat, 10 Jul 2010 17:05:27 +0200 Subject: [PATCH 026/174] Added Rick Osborne's super-easy gitflow installer oneliner to the project. See the README file for instructions on how to use it. --- AUTHORS | 1 + README.mdown | 6 +++ contrib/gitflow-installer.sh | 78 ++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 contrib/gitflow-installer.sh diff --git a/AUTHORS b/AUTHORS index c764de449..b54d16b41 100644 --- a/AUTHORS +++ b/AUTHORS @@ -5,5 +5,6 @@ Authors are (ordered by first commit date): - Daniel Truemper - Jason L. Shiffer - Randy Merrill +- Rick Osborne Portions derived from other open source works are clearly marked. diff --git a/README.mdown b/README.mdown index 064e37232..15766489b 100644 --- a/README.mdown +++ b/README.mdown @@ -12,6 +12,12 @@ blog post"). Installing git-flow ------------------- +The easiest way to install git-flow is using Rick Osborne's excellent +git-flow installer, which can be run using the following command: + + $ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh + +If you prefer a manual installation, please use the following instructions. After downloading the sources from Github, also fetch the submodules: $ git submodule init diff --git a/contrib/gitflow-installer.sh b/contrib/gitflow-installer.sh new file mode 100644 index 000000000..33dbe583c --- /dev/null +++ b/contrib/gitflow-installer.sh @@ -0,0 +1,78 @@ +#!/bin/sh + +# git-flow make-less installer for *nix systems, by Rick Osborne +# Based on the git-flow core Makefile: +# http://github.com/nvie/gitflow/blob/master/Makefile + +# Licensed under the same restrictions as git-flow: +# http://github.com/nvie/gitflow/blob/develop/LICENSE + +# Does this need to be smarter for each host OS? +if [ -z "$INSTALL_PREFIX" ] ; then + INSTALL_PREFIX="/usr/local/bin" +fi + +if [ -z "$REPO_NAME" ] ; then + REPO_NAME="gitflow" +fi + +if [ -z "$REPO_HOME" ] ; then + REPO_HOME="http://github.com/nvie/gitflow.git" +fi + +EXEC_FILES="git-flow" +SCRIPT_FILES="git-flow-init git-flow-feature git-flow-hotfix git-flow-release git-flow-support git-flow-version gitflow-common gitflow-shFlags" +SUBMODULE_FILE="gitflow-shFlags" + +echo "### gitflow no-make installer ###" + +case "$1" in + uninstall) + echo "Uninstalling git-flow from $INSTALL_PREFIX" + if [ -d "$INSTALL_PREFIX" ] ; then + for script_file in $SCRIPT_FILES $EXEC_FILES ; do + echo "rm -vf $INSTALL_PREFIX/$script_file" + rm -vf "$INSTALL_PREFIX/$script_file" + done + else + echo "The '$INSTALL_PREFIX' directory was not found." + echo "Do you need to set INSTALL_PREFIX ?" + fi + exit + ;; + help) + echo "Usage: [environment] gitflow-installer.sh [install|uninstall]" + echo "Environment:" + echo " INSTALL_PREFIX=$INSTALL_PREFIX" + echo " REPO_HOME=$REPO_HOME" + echo " REPO_NAME=$REPO_NAME" + exit + ;; + *) + echo "Installing git-flow to $INSTALL_PREFIX" + if [[ -d "$REPO_NAME" && -d "$REPO_NAME/.git" ]] ; then + echo "Using existing repo: $REPO_NAME" + else + echo "Cloning repo from GitHub to $REPO_NAME" + git clone "$REPO_HOME" "$REPO_NAME" + fi + if [ -f "$REPO_NAME/$SUBMODULE_FILE" ] ; then + echo "Submodules look up to date" + else + echo "Updating submodules" + lastcwd=$PWD + cd "$REPO_NAME" + git submodule init + git submodule update + cd "$lastcwd" + fi + install -v -d -m 0755 "$INSTALL_PREFIX" + for exec_file in $EXEC_FILES ; do + install -v -m 0755 "$REPO_NAME/$exec_file" "$INSTALL_PREFIX" + done + for script_file in $SCRIPT_FILES ; do + install -v -m 0644 "$REPO_NAME/$script_file" "$INSTALL_PREFIX" + done + exit + ;; +esac From 309e74f9889feab3f8276e144d226cc0f9de0791 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sun, 11 Jul 2010 10:55:54 +0200 Subject: [PATCH 027/174] Bumped version number to 0.3-dev Should have done this way earlier on the develop branch. --- git-flow-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-version b/git-flow-version index 349517ecd..93a0df240 100644 --- a/git-flow-version +++ b/git-flow-version @@ -36,7 +36,7 @@ # policies, either expressed or implied, of Vincent Driessen. # -GITFLOW_VERSION=0.2.1 +GITFLOW_VERSION=0.3-dev usage() { echo "usage: git flow version" From 1fd5bcfee6f4bc8456ac6fe3a128cce2b095b952 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 15 Jul 2010 23:21:21 -0700 Subject: [PATCH 028/174] Added link to Google group. --- README.mdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.mdown b/README.mdown index 15766489b..b41e9ed2a 100644 --- a/README.mdown +++ b/README.mdown @@ -46,6 +46,9 @@ 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 + License terms ------------- From 1911101cc27dd10bb4f7265f760ae7f2738208c6 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 15 Jul 2010 23:21:55 -0700 Subject: [PATCH 029/174] Fix markdown issue. --- README.mdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index b41e9ed2a..83eacd23c 100644 --- a/README.mdown +++ b/README.mdown @@ -47,7 +47,7 @@ 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 License terms From 8a86c48a1b223684124c04f3fd2ff1db3bb5a958 Mon Sep 17 00:00:00 2001 From: Mark Derricutt Date: Tue, 20 Jul 2010 21:11:48 +1200 Subject: [PATCH 030/174] Finishing features now only update / and / if they exists, this allows you to work on a unpushed repo, or a git svn repo --- git-flow-feature | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index 3ed06d029..91a7749bf 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -282,14 +282,18 @@ cmd_finish() { require_clean_working_tree # update local repo with remote changes first, if asked - if flag fetch; then - git fetch -q "$ORIGIN" "$BRANCH" + if has "$ORIGIN/$BRANCH" "$(git_remote_branches)"; then + if flag fetch; then + git fetch -q "$ORIGIN" "$BRANCH" + fi fi if has "$ORIGIN/$BRANCH" "$(git_remote_branches)"; then require_branches_equal "$BRANCH" "$ORIGIN/$BRANCH" fi - require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" + if has "$ORIGIN/$DEVELOP_BRANCH" "$(git_remote_branches)"; then + require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" + fi # if the user wants to rebase, do that first if flag rebase; then From cb654b189e61ce29744c58c1d4600c8793a35430 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Wed, 21 Jul 2010 13:28:54 +0200 Subject: [PATCH 031/174] Fix whitespace issues. --- git-flow-feature | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index 91a7749bf..2fdba2537 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -283,17 +283,17 @@ 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" - fi + if flag fetch; then + git fetch -q "$ORIGIN" "$BRANCH" + fi fi if has "$ORIGIN/$BRANCH" "$(git_remote_branches)"; then require_branches_equal "$BRANCH" "$ORIGIN/$BRANCH" fi if has "$ORIGIN/$DEVELOP_BRANCH" "$(git_remote_branches)"; then - require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" - fi + require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" + fi # if the user wants to rebase, do that first if flag rebase; then From 79d4b4fef300dac6d0ae5bdb3403dca10f7fc77f Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Wed, 21 Jul 2010 13:31:36 +0200 Subject: [PATCH 032/174] Add Mark to AUTHORS. --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index b54d16b41..9de970db8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -6,5 +6,6 @@ Authors are (ordered by first commit date): - Jason L. Shiffer - Randy Merrill - Rick Osborne +- Mark Derricutt Portions derived from other open source works are clearly marked. From d76add9ee2ea68a4649d0df9615f3ef7ec2c6bba Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 22 Jul 2010 14:56:30 +0200 Subject: [PATCH 033/174] Remove "important" 0.2 message. It disturbs the layout of the README file and nobody uses 0.1 anymore anyway. At least I hope (for them). --- README.mdown | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.mdown b/README.mdown index 83eacd23c..c01f9b8e1 100644 --- a/README.mdown +++ b/README.mdown @@ -5,11 +5,6 @@ for Vincent Driessen's [branching model](http://nvie.com/git-model "original blog post"). -> **IMPORTANT NOTE:** -> In release 0.2, the order of the arguments has changed to provide a logical -> subcommand hierarchy. - - Installing git-flow ------------------- The easiest way to install git-flow is using Rick Osborne's excellent From ec0b854b3e37e586b61f19782f38d6babcc9c230 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 22 Jul 2010 14:57:16 +0200 Subject: [PATCH 034/174] Add link to git-flow-completion project. Also, invite users to help out on the git-flow completion for zsh. Personal itch that needs some serious scratching :) --- README.mdown | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.mdown b/README.mdown index c01f9b8e1..35bd90a89 100644 --- a/README.mdown +++ b/README.mdown @@ -31,6 +31,21 @@ Or simply point your `PATH` environment variable to your git-flow checkout directory. +Integration with your shell +--------------------------- +For those who use the [Bash](http://www.gnu.org/software/bash/) shell, please +check out the excellent work on the +[git-flow-completion](http://github.com/bobthecow/git-flow-completion) project +by [bobthecow](http://github.com/bobthecow). It offers tab-completion for all +git-flow subcommands and branch names. + +If you are a [zsh](http://www.zsh.org) user with some plugin-writing +experience, please help us develop a +[completion plugin](http://github.com/bobthecow/git-flow-completion/issues#issue/1) +for zsh, too. Please contact me on [Github](http://github.com/inbox/new/nvie) +or [Twitter](http://twitter.com/nvie) to discuss details. + + Please help out --------------- This project is still under development. Feedback and suggestions are very From de95e004ab8f70269e0e32a327f8d7bbeb5a2aac Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 22 Jul 2010 15:11:17 +0200 Subject: [PATCH 035/174] Change the default behaviour of all scripts to NOT fetch. This already was the default behaviour of git-flow-feature, but now it is the default for the other scripts, too. RATIONALE: Due to limitations on some platforms (and some implementations of getopt), it's impossible to turn off the -f (fetch) option. Therefore, it must now be set explicitly. Also, this makes git-flow work in stand-alone repositories (i.e. repos that do not have an origin remote at all). --- git-flow-hotfix | 16 +++++++++++----- git-flow-release | 16 +++++++++++----- git-flow-support | 2 +- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/git-flow-hotfix b/git-flow-hotfix index fe8c804a7..390e537ad 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -153,7 +153,7 @@ require_no_existing_hotfix_branches() { } cmd_start() { - DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F + DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F parse_args "$@" BASE=${2:-$MASTER_BRANCH} require_version_arg @@ -167,7 +167,9 @@ cmd_start() { if flag fetch; then git fetch -q "$ORIGIN" "$MASTER_BRANCH" fi - require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH" + 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" @@ -187,7 +189,7 @@ cmd_start() { } cmd_finish() { - DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F + DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F 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 @@ -209,8 +211,12 @@ cmd_finish() { git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" || \ die "Could not fetch $DEVELOP_BRANCH from $ORIGIN." fi - require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH" - require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" + if has "$ORIGIN/$MASTER_BRANCH" "$(git_remote_branches)"; then + require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH" + fi + if has "$ORIGIN/$DEVELOP_BRANCH" "$(git_remote_branches)"; then + require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" + fi # try to merge into master # in case a previous attempt to finish this release branch has failed, diff --git a/git-flow-release b/git-flow-release index bff956165..b99867334 100644 --- a/git-flow-release +++ b/git-flow-release @@ -148,7 +148,7 @@ require_no_existing_release_branches() { } cmd_start() { - DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F + DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F parse_args "$@" BASE=${2:-$DEVELOP_BRANCH} require_version_arg @@ -162,7 +162,9 @@ cmd_start() { if flag fetch; then git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" fi - require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" + 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" @@ -182,7 +184,7 @@ cmd_start() { } cmd_finish() { - DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F + DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F 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 @@ -205,8 +207,12 @@ cmd_finish() { git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" || \ die "Could not fetch $DEVELOP_BRANCH from $ORIGIN." fi - require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH" - require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" + if has "$ORIGIN/$MASTER_BRANCH" "$(git_remote_branches)"; then + require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH" + fi + if has "$ORIGIN/$DEVELOP_BRANCH" "$(git_remote_branches)"; then + require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" + fi # try to merge into master # in case a previous attempt to finish this release branch has failed, diff --git a/git-flow-support b/git-flow-support index 1ec1b4e9d..ba92cb9a8 100644 --- a/git-flow-support +++ b/git-flow-support @@ -156,7 +156,7 @@ require_base_is_on_master() { } cmd_start() { - DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F + DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F parse_args "$@" require_version_arg require_base_arg From 2da8810fa051c5ba562c46707e5072e2cecb1bf0 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 22 Jul 2010 16:03:22 +0200 Subject: [PATCH 036/174] Add a Changelog, for keeping a clean overview of what changed. --- Changes.mdown | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Changes.mdown diff --git a/Changes.mdown b/Changes.mdown new file mode 100644 index 000000000..7a5f311bc --- /dev/null +++ b/Changes.mdown @@ -0,0 +1,42 @@ +0.3 (released 2010/07/22): +-------------------------- +* New subcommands for `git flow feature`: + - **checkout**: + For easily checking out features by their short name. Even allows + unique prefixes as arguments (see below). + + - **pull**: + This subcommand allows you to painlessly work on a feature branch + together with another peer. This is especially valuable for doing + peer reviews of other people's code. For more detailed info, see the + [commit log][1]. + +* Easier addressing of branch names by using name prefixes. + For example, when using: + + git flow feature finish fo + + this automatically finishes the feature branch `foobar` if that's the only + feature branch name starting with `fo`. + +* No force flag anymore for new feature branches + `git flow feature start` lost its `-f` (force) flag. You now don't + have to be in a clean repo anymore to start a new feature branch. This + avoids the manual `git stash`, `git flow feature start`, `git stash + pop` cycle. + +* You can use `git-flow` in stand-alone repo's now. + This means it does not assume you have an `origin` repository. + +* No commands fetch from `origin` by default anymore. + There were some issues related to disabling this flag on some platforms. + +* Init guesses branch names you may want to use for `develop` and `master`. + +* Added super-easy installation script (thanks Rick Osborne) + +* Added BSD license. + +[1]: http://github.com/nvie/gitflow/commit/f68d405cc3a11e9df3671f567658a6ab6ed8e0a1 + +(No change history recorded for pre-0.3 releases.) From 02548fb79fcf445995aa67e301c9a62dfdbcbb01 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 22 Jul 2010 16:12:26 +0200 Subject: [PATCH 037/174] Fix minor markdown issue and credit contributers. --- Changes.mdown | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Changes.mdown b/Changes.mdown index 7a5f311bc..c7b92c86d 100644 --- a/Changes.mdown +++ b/Changes.mdown @@ -1,5 +1,7 @@ -0.3 (released 2010/07/22): --------------------------- +0.3: +---- +Release date: **2010/07/22** + * New subcommands for `git flow feature`: - **checkout**: For easily checking out features by their short name. Even allows @@ -14,7 +16,7 @@ * Easier addressing of branch names by using name prefixes. For example, when using: - git flow feature finish fo + git flow feature finish fo this automatically finishes the feature branch `foobar` if that's the only feature branch name starting with `fo`. @@ -27,16 +29,22 @@ * You can use `git-flow` in stand-alone repo's now. This means it does not assume you have an `origin` repository. + (Thanks [Mark][2].) * No commands fetch from `origin` by default anymore. There were some issues related to disabling this flag on some platforms. * Init guesses branch names you may want to use for `develop` and `master`. -* Added super-easy installation script (thanks Rick Osborne) +* Added super-easy installation script. (Thanks [Rick][3].) * Added BSD license. [1]: http://github.com/nvie/gitflow/commit/f68d405cc3a11e9df3671f567658a6ab6ed8e0a1 +[2]: http://github.com/talios +[3]: http://github.com/rickosborne + -(No change history recorded for pre-0.3 releases.) +Older versions +-------------- +No change history is recorded for pre-0.3 releases. From 7c4cc65963056d81fb05a213409a2d40d3c369a7 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 22 Jul 2010 16:14:08 +0200 Subject: [PATCH 038/174] Bump version to 0.3. --- git-flow-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-version b/git-flow-version index 93a0df240..7371595f7 100644 --- a/git-flow-version +++ b/git-flow-version @@ -36,7 +36,7 @@ # policies, either expressed or implied, of Vincent Driessen. # -GITFLOW_VERSION=0.3-dev +GITFLOW_VERSION=0.3 usage() { echo "usage: git flow version" From 3d41ea0e91c7d86ace0e135a551bd5852bdd7b3d Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 22 Jul 2010 16:16:17 +0200 Subject: [PATCH 039/174] Bump version to 0.4-dev. --- Changes.mdown | 7 +++++++ git-flow-version | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Changes.mdown b/Changes.mdown index c7b92c86d..f23244c33 100644 --- a/Changes.mdown +++ b/Changes.mdown @@ -1,3 +1,10 @@ +0.4: +--- +Release date: ??? + +(No changes yet.) + + 0.3: ---- Release date: **2010/07/22** diff --git a/git-flow-version b/git-flow-version index 93a0df240..e0b766317 100644 --- a/git-flow-version +++ b/git-flow-version @@ -36,7 +36,7 @@ # policies, either expressed or implied, of Vincent Driessen. # -GITFLOW_VERSION=0.3-dev +GITFLOW_VERSION=0.4-dev usage() { echo "usage: git flow version" From b731e6f81068024ae8039ad45db5f8f3579e5afa Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 19 Aug 2010 20:00:02 +0200 Subject: [PATCH 040/174] Mention Jeff's great article on the README file. --- README.mdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.mdown b/README.mdown index 35bd90a89..7f472e71d 100644 --- a/README.mdown +++ b/README.mdown @@ -71,6 +71,11 @@ in a Github fork, of course. Typical usage: -------------- +For the best introduction to get started to `git flow`, please read Jeff +Kreeftmeijer's blog post: + +http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/ + ### Initialization From 4d8b379ad4754caa59ed411f7ea30db2d4beb91b Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 19 Aug 2010 20:01:30 +0200 Subject: [PATCH 041/174] Make the links manually. I thought Markdown did support URL recognition automatically. --- README.mdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.mdown b/README.mdown index 7f472e71d..cdf9d69d1 100644 --- a/README.mdown +++ b/README.mdown @@ -57,7 +57,7 @@ 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](http://groups.google.com/group/gitflow-users) License terms @@ -74,7 +74,7 @@ Typical usage: For the best introduction to get started to `git flow`, please read Jeff Kreeftmeijer's blog post: -http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/ +[http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/) ### Initialization From ea738ef31dcabfb6b17a4ee776e0cede593bfd2f Mon Sep 17 00:00:00 2001 From: JP Toto Date: Fri, 20 Aug 2010 04:56:57 +0800 Subject: [PATCH 042/174] Added installation instructions for Windows users --- README.mdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.mdown b/README.mdown index cdf9d69d1..8971aa28c 100644 --- a/README.mdown +++ b/README.mdown @@ -12,6 +12,11 @@ git-flow installer, which can be run using the following command: $ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh +For Windows users who wish to use the automated install, it is suggested that you install Cygwin http://www.cygwin.com/ +first to install tools like sh and wget. Then simply follow the command: + + c:\Users\ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh + If you prefer a manual installation, please use the following instructions. After downloading the sources from Github, also fetch the submodules: From ac949bfb8120eb38657488a101b4a3dd649720ba Mon Sep 17 00:00:00 2001 From: JP Toto Date: Fri, 20 Aug 2010 05:01:52 +0800 Subject: [PATCH 043/174] Fixed link to Cygwin and msysgit --- README.mdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index 8971aa28c..bcb5f8a2c 100644 --- a/README.mdown +++ b/README.mdown @@ -12,7 +12,7 @@ git-flow installer, which can be run using the following command: $ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh -For Windows users who wish to use the automated install, it is suggested that you install Cygwin http://www.cygwin.com/ +For Windows users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/) first to install tools like sh and wget. Then simply follow the command: c:\Users\ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh @@ -50,6 +50,8 @@ experience, please help us develop a for zsh, too. Please contact me on [Github](http://github.com/inbox/new/nvie) or [Twitter](http://twitter.com/nvie) to discuss details. +For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good starting place for installing git. + Please help out --------------- From 871f5edee23fa4e00ba65d7295a8658eb4b895b6 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sat, 21 Aug 2010 10:58:01 +0200 Subject: [PATCH 044/174] Bugfix to avoid errors due to Git subcommands returning ANSI color output. --- git-flow-feature | 2 +- git-flow-hotfix | 4 ++-- git-flow-release | 4 ++-- git-flow-support | 4 ++-- gitflow-common | 10 +++++----- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index 2fdba2537..872e0bb90 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -74,7 +74,7 @@ cmd_list() { warn "" exit 0 fi - current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') + current_branch=$(git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') short_names=$(echo "$feature_branches" | sed "s ^$PREFIX g") # determine column width first diff --git a/git-flow-hotfix b/git-flow-hotfix index 390e537ad..d21426217 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -69,7 +69,7 @@ cmd_list() { warn "" exit 0 fi - current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') + current_branch=$(git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') short_names=$(echo "$hotfix_branches" | sed "s ^$PREFIX g") # determine column width first @@ -137,7 +137,7 @@ require_version_arg() { } require_base_is_on_master() { - if ! git branch --contains "$BASE" 2>/dev/null \ + if ! git branch --color=never --contains "$BASE" 2>/dev/null \ | sed 's/[* ] //g' \ | grep -q "^$MASTER_BRANCH\$"; then die "fatal: Given base '$BASE' is not a valid commit on '$MASTER_BRANCH'." diff --git a/git-flow-release b/git-flow-release index b99867334..443dd406f 100644 --- a/git-flow-release +++ b/git-flow-release @@ -70,7 +70,7 @@ cmd_list() { exit 0 fi - current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') + current_branch=$(git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') short_names=$(echo "$release_branches" | sed "s ^$PREFIX g") # determine column width first @@ -132,7 +132,7 @@ require_version_arg() { } require_base_is_on_develop() { - if ! git branch --contains "$BASE" 2>/dev/null \ + if ! git branch --color=never --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'." diff --git a/git-flow-support b/git-flow-support index ba92cb9a8..e95dfcb7b 100644 --- a/git-flow-support +++ b/git-flow-support @@ -71,7 +71,7 @@ cmd_list() { warn "" exit 0 fi - current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') + current_branch=$(git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') short_names=$(echo "$support_branches" | sed "s ^$PREFIX g") # determine column width first @@ -148,7 +148,7 @@ require_base_arg() { } require_base_is_on_master() { - if ! git branch --contains "$BASE" 2>/dev/null \ + if ! git branch --color=never --contains "$BASE" 2>/dev/null \ | sed 's/[* ] //g' \ | grep -q "^$MASTER_BRANCH\$"; then die "fatal: Given base '$BASE' is not a valid commit on '$MASTER_BRANCH'." diff --git a/gitflow-common b/gitflow-common index 29ef38889..f30cd5f65 100644 --- a/gitflow-common +++ b/gitflow-common @@ -66,13 +66,13 @@ noflag() { local FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -ne $FLAGS_TRUE ]; } # Git specific common functionality # -git_local_branches() { git branch | sed 's/^[* ] //'; } -git_remote_branches() { git branch -r | sed 's/^[* ] //'; } -git_all_branches() { ( git branch; git branch -r) | sed 's/^[* ] //'; } +git_local_branches() { git branch --color=never | sed 's/^[* ] //'; } +git_remote_branches() { git branch -r --color=never | sed 's/^[* ] //'; } +git_all_branches() { ( git branch --color=never; git branch -r --color=never) | sed 's/^[* ] //'; } git_all_tags() { git tag; } git_current_branch() { - git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g' + git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g' } git_is_clean_working_tree() { @@ -140,7 +140,7 @@ git_compare_branches() { git_is_branch_merged_into() { local subject=$1 local base=$2 - local all_merges=$(git branch --contains $subject | sed 's/^[* ] //') + local all_merges=$(git branch --color=never --contains $subject | sed 's/^[* ] //') has $base $all_merges } From cf3da5a75c0db58263c5fe6b8620b9731ba8ae23 Mon Sep 17 00:00:00 2001 From: Adam Gibbins Date: Sun, 22 Aug 2010 19:13:34 +0100 Subject: [PATCH 045/174] Fixed incorrect color flag --- git-flow-feature | 2 +- git-flow-hotfix | 4 ++-- git-flow-release | 4 ++-- git-flow-support | 4 ++-- gitflow-common | 10 +++++----- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index 872e0bb90..8c7cacdae 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -74,7 +74,7 @@ cmd_list() { warn "" exit 0 fi - current_branch=$(git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') + current_branch=$(git branch --no-color | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') short_names=$(echo "$feature_branches" | sed "s ^$PREFIX g") # determine column width first diff --git a/git-flow-hotfix b/git-flow-hotfix index d21426217..84b2ac50c 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -69,7 +69,7 @@ cmd_list() { warn "" exit 0 fi - current_branch=$(git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') + current_branch=$(git branch --no-color | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') short_names=$(echo "$hotfix_branches" | sed "s ^$PREFIX g") # determine column width first @@ -137,7 +137,7 @@ require_version_arg() { } require_base_is_on_master() { - if ! git branch --color=never --contains "$BASE" 2>/dev/null \ + if ! git branch --no-color --contains "$BASE" 2>/dev/null \ | sed 's/[* ] //g' \ | grep -q "^$MASTER_BRANCH\$"; then die "fatal: Given base '$BASE' is not a valid commit on '$MASTER_BRANCH'." diff --git a/git-flow-release b/git-flow-release index 443dd406f..85ff54221 100644 --- a/git-flow-release +++ b/git-flow-release @@ -70,7 +70,7 @@ cmd_list() { exit 0 fi - current_branch=$(git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') + current_branch=$(git branch --no-color | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') short_names=$(echo "$release_branches" | sed "s ^$PREFIX g") # determine column width first @@ -132,7 +132,7 @@ require_version_arg() { } require_base_is_on_develop() { - if ! git branch --color=never --contains "$BASE" 2>/dev/null \ + if ! git 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'." diff --git a/git-flow-support b/git-flow-support index e95dfcb7b..13091d63d 100644 --- a/git-flow-support +++ b/git-flow-support @@ -71,7 +71,7 @@ cmd_list() { warn "" exit 0 fi - current_branch=$(git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') + current_branch=$(git branch --no-color | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') short_names=$(echo "$support_branches" | sed "s ^$PREFIX g") # determine column width first @@ -148,7 +148,7 @@ require_base_arg() { } require_base_is_on_master() { - if ! git branch --color=never --contains "$BASE" 2>/dev/null \ + if ! git branch --no-color --contains "$BASE" 2>/dev/null \ | sed 's/[* ] //g' \ | grep -q "^$MASTER_BRANCH\$"; then die "fatal: Given base '$BASE' is not a valid commit on '$MASTER_BRANCH'." diff --git a/gitflow-common b/gitflow-common index f30cd5f65..dcb58bdd3 100644 --- a/gitflow-common +++ b/gitflow-common @@ -66,13 +66,13 @@ noflag() { local FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -ne $FLAGS_TRUE ]; } # Git specific common functionality # -git_local_branches() { git branch --color=never | sed 's/^[* ] //'; } -git_remote_branches() { git branch -r --color=never | sed 's/^[* ] //'; } -git_all_branches() { ( git branch --color=never; git branch -r --color=never) | sed 's/^[* ] //'; } +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/^[* ] //'; } git_all_tags() { git tag; } git_current_branch() { - git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g' + git branch --no-color | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g' } git_is_clean_working_tree() { @@ -140,7 +140,7 @@ git_compare_branches() { git_is_branch_merged_into() { local subject=$1 local base=$2 - local all_merges=$(git branch --color=never --contains $subject | sed 's/^[* ] //') + local all_merges=$(git branch --no-color --contains $subject | sed 's/^[* ] //') has $base $all_merges } From b33ea8ac67bd5efffe7fa9e35431f4c12ae4644d Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 24 Aug 2010 13:58:32 +0200 Subject: [PATCH 046/174] Added a Flattr button to the README file. This has been requested by at least 10 people now, so it might be time for one. --- README.mdown | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.mdown b/README.mdown index bcb5f8a2c..6120337ec 100644 --- a/README.mdown +++ b/README.mdown @@ -129,3 +129,17 @@ those questions to accept the (sane) default suggestions. 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/git-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 From b17b8986c8968f95b5271fd5aa55f7dc70f5099b Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Wed, 25 Aug 2010 21:25:36 +0200 Subject: [PATCH 047/174] Add installation note on how to install getopt. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks Alexander Groß. --- README.mdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.mdown b/README.mdown index 6120337ec..804efc786 100644 --- a/README.mdown +++ b/README.mdown @@ -35,6 +35,12 @@ where git-flow will be installed, simply specify it explicitly, using: Or simply point your `PATH` environment variable to your git-flow checkout directory. +*Installation note:* +git-flow depends on the availability of the command line utility `getopt`, +which may not be available in your Unix/Linux environment. Please use your +favorite package manager to install `getopt`. For Cygwin, install the +`util-linux` package to get `getopt`. + Integration with your shell --------------------------- From 25def71af96f346e7a44f5b41e0e8d0dd6458036 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Wed, 25 Aug 2010 21:25:57 +0200 Subject: [PATCH 048/174] Mention the ZSH support for git-flow-completion. --- README.mdown | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/README.mdown b/README.mdown index 804efc786..43f014552 100644 --- a/README.mdown +++ b/README.mdown @@ -44,19 +44,14 @@ favorite package manager to install `getopt`. For Cygwin, install the Integration with your shell --------------------------- -For those who use the [Bash](http://www.gnu.org/software/bash/) shell, please -check out the excellent work on the +For those who use the [Bash](http://www.gnu.org/software/bash/) or +[ZSH](http://www.zsh.org) shell, please check out the excellent work on the [git-flow-completion](http://github.com/bobthecow/git-flow-completion) project by [bobthecow](http://github.com/bobthecow). It offers tab-completion for all git-flow subcommands and branch names. -If you are a [zsh](http://www.zsh.org) user with some plugin-writing -experience, please help us develop a -[completion plugin](http://github.com/bobthecow/git-flow-completion/issues#issue/1) -for zsh, too. Please contact me on [Github](http://github.com/inbox/new/nvie) -or [Twitter](http://twitter.com/nvie) to discuss details. - -For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good starting place for installing git. +For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good +starting place for installing git. Please help out From c213052c9ff8f2fb61ae95bd7ac1016ac937511d Mon Sep 17 00:00:00 2001 From: eddie cianci Date: Sun, 5 Sep 2010 01:19:35 +0800 Subject: [PATCH 049/174] added OSX instructions using curl (because wget isn't available by default) --- README.mdown | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index 43f014552..4150e07c6 100644 --- a/README.mdown +++ b/README.mdown @@ -12,7 +12,11 @@ git-flow installer, which can be run using the following command: $ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh -For Windows users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/) +For __OSX__ users, the `wget` command isn't available by default, but `curl` is, so you can run: + + $ curl http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh + +For __Windows__ users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/) first to install tools like sh and wget. Then simply follow the command: c:\Users\ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh From 11965b3259748a204b9cbcff3cf1256b78d700c5 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 6 Sep 2010 12:19:20 +0200 Subject: [PATCH 050/174] Added two FAQs. --- README.mdown | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.mdown b/README.mdown index 4150e07c6..25bf6d576 100644 --- a/README.mdown +++ b/README.mdown @@ -58,6 +58,38 @@ For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good starting place for installing git. +FAQ +--- +* **Can I still do manual branches and merges when I use git-flow?** + Of course you can. ``git-flow`` does not forbid you to keep using vanilla Git + commands! + + So if you want to merge `master` into `develop` for whatever reason you want + to, you can safely do so without breaking `git-flow` compatibility. Do you + want to manually merge a feature branch X into another feature branch Y? Not + a problem. As long as you do it conciously and realize what this means for + finishing those branches later on. + +* **I'm getting errors when I use flags with git-flow!** + ``git-flow`` uses the [shFlags](http://code.google.com/p/shflags/) library to + provide platform independent flag parsing (using wichever low-level flag + parsing libraries like `getopt` or `getopts` are available). However, + `shFlags` does not work too well on a few platforms that haven't been tested + originally. This results in errors like this: + + flags:WARN getopt: option invalide -- 'f' -- 'init' flags:FATAL unable to parse provided options with getopt + + The platforms that suffer these errors include: + + - Gentoo + - Ubuntu + - Redhat Enterprise Linux + + There are open issues related to this: #28 and #39. Unfortunately, there is + no simple fix for it and all hope is placed on the Python rewrite of + `git-flow`, see issue #33. + + Please help out --------------- This project is still under development. Feedback and suggestions are very From f74a3a77002e0699631d4bac8aebf31114243b96 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 6 Sep 2010 12:21:23 +0200 Subject: [PATCH 051/174] Fix markdown links to issues. --- README.mdown | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.mdown b/README.mdown index 25bf6d576..e196f0cd4 100644 --- a/README.mdown +++ b/README.mdown @@ -85,9 +85,11 @@ FAQ - Ubuntu - Redhat Enterprise Linux - There are open issues related to this: #28 and #39. Unfortunately, there is - no simple fix for it and all hope is placed on the Python rewrite of - `git-flow`, see issue #33. + There are open issues related to this: + [#28](http://github.com/nvie/gitflow/issues/28) and + [#39](http://github.com/nvie/gitflow/issues/39). Unfortunately, there is no + simple fix for it and all hope is placed on the Python rewrite of `git-flow`, + see issue [#33](http://github.com/nvie/gitflow/issues/33). Please help out From 0c92777046715dcf84739d2377bfefab6fea6a11 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 6 Sep 2010 12:22:10 +0200 Subject: [PATCH 052/174] Fix more Markdown syntax. --- README.mdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.mdown b/README.mdown index e196f0cd4..4b56580f7 100644 --- a/README.mdown +++ b/README.mdown @@ -61,7 +61,7 @@ starting place for installing git. FAQ --- * **Can I still do manual branches and merges when I use git-flow?** - Of course you can. ``git-flow`` does not forbid you to keep using vanilla Git + Of course you can. `git-flow` does not forbid you to keep using vanilla Git commands! So if you want to merge `master` into `develop` for whatever reason you want @@ -71,7 +71,7 @@ FAQ finishing those branches later on. * **I'm getting errors when I use flags with git-flow!** - ``git-flow`` uses the [shFlags](http://code.google.com/p/shflags/) library to + `git-flow` uses the [shFlags](http://code.google.com/p/shflags/) library to provide platform independent flag parsing (using wichever low-level flag parsing libraries like `getopt` or `getopts` are available). However, `shFlags` does not work too well on a few platforms that haven't been tested From f8b34b237995b0b3d8d33b25fc6429720d617b9a Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 6 Sep 2010 12:37:04 +0200 Subject: [PATCH 053/174] Add another FAQ. --- README.mdown | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.mdown b/README.mdown index 4b56580f7..7fe03c947 100644 --- a/README.mdown +++ b/README.mdown @@ -70,6 +70,33 @@ FAQ a problem. As long as you do it conciously and realize what this means for finishing those branches later on. +* **Why does git-describe not work for me?** + When finishing release and hotfix branches, that branch's HEAD is first + merged into `master` and then into `develop`. It is not the resulting new + merge commit from `master` that is merged back into `develop`. This means + that a linear path from the new `develop` branch to the new `master` commit + is not created. Even worse, a linear path is created from the new `develop` + branch to the *previous* `master` commit. Although unintended, this is + simply an effect of using the current branching rules. + + When using `git-describe` in these cases, you can get very confusing and + misleading results, since `git-describe` scans the current commits linear + history for the most recent tag it finds, which will always be the *previous* + tag. + + I will change this behaviour in the next version of the branching model + explicitly and I will include this behavioural change in the first version of + the Python rewrite. + + For more references to this problem, see: + + - Issue [#49](http://github.com/nvie/gitflow/issues/49) + - These + [two](http://groups.google.com/group/gitflow-users/browse\_thread/thread/9920a7df3d1c4908/0bb18a0bf7275ad6#0bb18a0bf7275ad6) + [discussions](http://groups.google.com/group/gitflow-users/browse\_thread/thread/19efac724bb6418a) + on the [git-flow-users](http://groups.google.com/group/gitflow-users) + mailinglist. + * **I'm getting errors when I use flags with git-flow!** `git-flow` uses the [shFlags](http://code.google.com/p/shflags/) library to provide platform independent flag parsing (using wichever low-level flag From 19a6e24a11b76049feed76cbc5604a7fcb90ac14 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Wed, 15 Sep 2010 20:08:38 +0200 Subject: [PATCH 054/174] Change submodule URL from git:// to http:// This makes it easy to download the submodule from behind a corporate firewall. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 85665678e..f4a246eea 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "shFlags"] path = shFlags - url = git://github.com/nvie/shFlags.git + url = https://nvie@github.com/nvie/shFlags.git From cb9222811959f923482c0ce4d945aa4763492cb4 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Wed, 22 Sep 2010 20:38:55 +0200 Subject: [PATCH 055/174] Add FAQ note for Windows users. --- README.mdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.mdown b/README.mdown index 7fe03c947..aeb50fb71 100644 --- a/README.mdown +++ b/README.mdown @@ -118,6 +118,12 @@ FAQ simple fix for it and all hope is placed on the Python rewrite of `git-flow`, see issue [#33](http://github.com/nvie/gitflow/issues/33). +* **Can I use it with Windows?** + There have been reports of Windows users using `git-flow`. + Unfortunately, I have no Windows environment to test it on, but + this [issue](http://github.com/nvie/gitflow/issues/issue/25) should be + helpful in setting it up. + Please help out --------------- From 03f27baa4dfaf14f8d5e9a71e820909bb4d5311b Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 23 Sep 2010 08:57:47 +0200 Subject: [PATCH 056/174] Revert "Change submodule URL from git:// to http://" This reverts commit 19a6e24a11b76049feed76cbc5604a7fcb90ac14. This was a local experiment that I pushed to Github accidentally. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index f4a246eea..85665678e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "shFlags"] path = shFlags - url = https://nvie@github.com/nvie/shFlags.git + url = git://github.com/nvie/shFlags.git From fbcf4a0e648ec868345f72bebf745a2844a786bd Mon Sep 17 00:00:00 2001 From: Felipe Talavera Date: Thu, 30 Sep 2010 12:03:01 -0700 Subject: [PATCH 057/174] add publish and track command to the release flow --- git-flow-release | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/git-flow-release b/git-flow-release index 85ff54221..082a8d4a8 100644 --- a/git-flow-release +++ b/git-flow-release @@ -276,3 +276,50 @@ cmd_finish() { fi echo } + +cmd_publish() { + parse_args "$@" + expand_nameprefix_arg + + # sanity checks + require_clean_working_tree + require_branch "$BRANCH" + git fetch -q "$ORIGIN" + require_branch_absent "$ORIGIN/$BRANCH" + + # create remote branch + git push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH" + git fetch -q "$ORIGIN" + + # configure remote tracking + git config "branch.$BRANCH.remote" "$ORIGIN" + git config "branch.$BRANCH.merge" "refs/heads/$BRANCH" + git checkout "$BRANCH" + + echo + echo "Summary of actions:" + echo "- A new remote branch '$BRANCH' was created" + echo "- The local branch '$BRANCH' was configured to track the remote branch" + echo "- You are now on branch '$BRANCH'" + echo +} + +cmd_track() { + parse_args "$@" + require_name_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 +} From bbca9229de93010a53fab2f7d8b7e1acb35223b6 Mon Sep 17 00:00:00 2001 From: Felipe Talavera Date: Thu, 30 Sep 2010 12:25:08 -0700 Subject: [PATCH 058/174] add the banner message to the release --- git-flow-release | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git-flow-release b/git-flow-release index 082a8d4a8..f53ef4e26 100644 --- a/git-flow-release +++ b/git-flow-release @@ -46,6 +46,8 @@ usage() { echo "usage: git flow release [list] [-v]" echo " git flow release start [-F] " echo " git flow release finish [-Fsump] " + echo " git flow release publish " + echo " git flow release track " } cmd_default() { From df706aced0f4bbac8c53a5b9633e6331d3a9ee3a Mon Sep 17 00:00:00 2001 From: Felipe Talavera Date: Thu, 30 Sep 2010 13:11:34 -0700 Subject: [PATCH 059/174] flow-release now checking if the version is set correctly --- git-flow-release | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-flow-release b/git-flow-release index f53ef4e26..6570b90ff 100644 --- a/git-flow-release +++ b/git-flow-release @@ -281,7 +281,7 @@ cmd_finish() { cmd_publish() { parse_args "$@" - expand_nameprefix_arg + require_version_arg # sanity checks require_clean_working_tree @@ -308,7 +308,7 @@ cmd_publish() { cmd_track() { parse_args "$@" - require_name_arg + require_version_arg # sanity checks require_clean_working_tree From 4c90d928ee72f0b2ba491d67ea79f80dab40f8f4 Mon Sep 17 00:00:00 2001 From: Felipe Talavera Date: Thu, 30 Sep 2010 13:30:03 -0700 Subject: [PATCH 060/174] lets add automatic delete of the branch when the remote flag is set under the release --- git-flow-release | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git-flow-release b/git-flow-release index 6570b90ff..e71c87ba0 100644 --- a/git-flow-release +++ b/git-flow-release @@ -264,6 +264,8 @@ cmd_finish() { die "Could not push to $MASTER_BRANCH from $ORIGIN." git push --tags "$ORIGIN" || \ die "Could not push tags to $ORIGIN." + git push "$ORIGIN" :"$BRANCH" || \ + die "Could not delete the remote $BRANCH in $ORIGIN." fi echo @@ -275,6 +277,7 @@ cmd_finish() { echo "- Release branch '$BRANCH' has been deleted" if flag push; then echo "- '$DEVELOP_BRANCH', '$MASTER_BRANCH' and tags have been pushed to '$ORIGIN'" + echo "- Release branch '$BRANCH' in '$ORIGIN' has been deleted." fi echo } From 92c16a9eadcb6039b370760f711409c9473cc41b Mon Sep 17 00:00:00 2001 From: Felipe Talavera Date: Thu, 30 Sep 2010 13:47:02 -0700 Subject: [PATCH 061/174] adds a check to avoid the delete release branch problem in release finish --- git-flow-release | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/git-flow-release b/git-flow-release index e71c87ba0..d573da183 100644 --- a/git-flow-release +++ b/git-flow-release @@ -149,6 +149,15 @@ require_no_existing_release_branches() { die "There is an existing release branch ($first_branch). Finish that one first." } +git_actual_branch(){ + git branch --no-color | grep '^*' | sed 's/^[* ] //' +} +require_not_being_in_release_branch() { + if has $BRANCH $(git_actual_branch); then + die "You cannot be in the '$BRANCH' branch when you finnish it." + fi +} + cmd_start() { DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F parse_args "$@" @@ -203,6 +212,7 @@ cmd_finish() { # sanity checks require_branch "$BRANCH" require_clean_working_tree + require_not_being_in_release_branch if flag fetch; then git fetch -q "$ORIGIN" "$MASTER_BRANCH" || \ die "Could not fetch $MASTER_BRANCH from $ORIGIN." From b9765da7ec2f64caecbc558b9a4d383f8d66790b Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 5 Oct 2010 08:43:34 +0200 Subject: [PATCH 062/174] No need to reimplement the git_current_branch function. --- git-flow-release | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/git-flow-release b/git-flow-release index d573da183..bc7795c1f 100644 --- a/git-flow-release +++ b/git-flow-release @@ -149,11 +149,8 @@ require_no_existing_release_branches() { die "There is an existing release branch ($first_branch). Finish that one first." } -git_actual_branch(){ - git branch --no-color | grep '^*' | sed 's/^[* ] //' -} require_not_being_in_release_branch() { - if has $BRANCH $(git_actual_branch); then + if [ "$BRANCH" = "$(git_current_branch)"]; then die "You cannot be in the '$BRANCH' branch when you finnish it." fi } From 4d8239a9c7866c4d8ec9fed4aa4ad2e4dbae4328 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 5 Oct 2010 08:43:56 +0200 Subject: [PATCH 063/174] Fix minor typo. --- git-flow-release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-release b/git-flow-release index bc7795c1f..255c08b31 100644 --- a/git-flow-release +++ b/git-flow-release @@ -151,7 +151,7 @@ require_no_existing_release_branches() { require_not_being_in_release_branch() { if [ "$BRANCH" = "$(git_current_branch)"]; then - die "You cannot be in the '$BRANCH' branch when you finnish it." + die "You cannot be in the '$BRANCH' branch when you finish it." fi } From d256bbfe57c3424198feae2282ca19dde93cad8f Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 5 Oct 2010 08:59:08 +0200 Subject: [PATCH 064/174] Rename the helper function. --- git-flow-release | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-flow-release b/git-flow-release index 255c08b31..b28bf42b0 100644 --- a/git-flow-release +++ b/git-flow-release @@ -149,7 +149,7 @@ require_no_existing_release_branches() { die "There is an existing release branch ($first_branch). Finish that one first." } -require_not_being_in_release_branch() { +require_not_on_release_branch() { if [ "$BRANCH" = "$(git_current_branch)"]; then die "You cannot be in the '$BRANCH' branch when you finish it." fi @@ -209,7 +209,7 @@ cmd_finish() { # sanity checks require_branch "$BRANCH" require_clean_working_tree - require_not_being_in_release_branch + require_not_on_release_branch if flag fetch; then git fetch -q "$ORIGIN" "$MASTER_BRANCH" || \ die "Could not fetch $MASTER_BRANCH from $ORIGIN." From 8fee0c224fdf46d7f196e99346a214c7be99ca80 Mon Sep 17 00:00:00 2001 From: Guillaume-Jean Herbiet Date: Mon, 4 Oct 2010 11:35:10 +0200 Subject: [PATCH 065/174] Added -k option to keep (feature|hotfix|relase) branch when calling 'finish'. --- git-flow-feature | 19 +++++++++++++++---- git-flow-hotfix | 17 +++++++++++++---- git-flow-release | 17 +++++++++++++---- 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index 8c7cacdae..a38b0cce9 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 [-rF] " + echo " git flow feature finish [-rFk] " echo " git flow feature publish " echo " git flow feature track " echo " git flow feature diff []" @@ -180,7 +180,7 @@ parse_args() { parse_cmdline "$@" # read arguments into global variables - NAME=$1 + NAME=${!#} BRANCH=$PREFIX$NAME } @@ -232,6 +232,7 @@ cmd_start() { cmd_finish() { DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F DEFINE_boolean rebase false 'rebase instead of merge' r + DEFINE_boolean keep false 'keep branch after performing finish' k parse_args "$@" expand_nameprefix_arg @@ -343,13 +344,23 @@ helper_finish_cleanup() { if flag fetch; then git push "$ORIGIN" ":refs/heads/$BRANCH" fi - git branch -D "$BRANCH" + + + if flag keep; then + echo "Keep this branch" > /dev/null + else + git branch -d "$BRANCH" + fi echo echo "Summary of actions:" echo "- The feature branch '$BRANCH' was merged into '$DEVELOP_BRANCH'" #echo "- Merge conflicts were resolved" # TODO: Add this line when it's supported - echo "- Feature branch '$BRANCH' has been removed" + if flag keep; then + echo "- Feature branch '$BRANCH' has been kept" + else + echo "- Feature branch '$BRANCH' has been removed" + fi echo "- You are now on branch '$DEVELOP_BRANCH'" echo } diff --git a/git-flow-hotfix b/git-flow-hotfix index 84b2ac50c..a05c4aacd 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -45,7 +45,7 @@ PREFIX=$(git config --get gitflow.prefix.hotfix) usage() { echo "usage: git flow hotfix [list] [-v]" echo " git flow hotfix start [-F] []" - echo " git flow hotfix finish [-Fsump] " + echo " git flow hotfix finish [-Fsumpk] " } cmd_default() { @@ -124,7 +124,7 @@ parse_args() { eval set -- "${FLAGS_ARGV}" # read arguments into global variables - VERSION=$1 + VERSION=${!#} BRANCH=$PREFIX$VERSION } @@ -194,6 +194,7 @@ cmd_finish() { 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_boolean push false "push to $ORIGIN after performing finish" p + DEFINE_boolean keep false 'keep branch after performing finish' k parse_args "$@" require_version_arg @@ -257,7 +258,11 @@ cmd_finish() { fi # delete branch - git branch -d "$BRANCH" + if flag keep; then + echo "Keep this branch" > /dev/null + else + git branch -d "$BRANCH" + fi if flag push; then git push "$ORIGIN" "$DEVELOP_BRANCH" || \ @@ -274,7 +279,11 @@ cmd_finish() { echo "- Hotfix branch has been merged into '$MASTER_BRANCH'" echo "- The hotfix was tagged '$VERSION_PREFIX$VERSION'" echo "- Hotfix branch has been back-merged into '$DEVELOP_BRANCH'" - echo "- Hotfix branch '$BRANCH' has been deleted" + if flag keep; then + echo "- Hotfix branch '$BRANCH' has been kept" + else + echo "- Hotfix branch '$BRANCH' has been deleted" + fi if flag push; then echo "- '$DEVELOP_BRANCH', '$MASTER_BRANCH' and tags have been pushed to '$ORIGIN'" fi diff --git a/git-flow-release b/git-flow-release index b28bf42b0..d436bb198 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 [-Fsump] " + echo " git flow release finish [-Fsumpk] " echo " git flow release publish " echo " git flow release track " } @@ -121,7 +121,7 @@ parse_args() { eval set -- "${FLAGS_ARGV}" # read arguments into global variables - VERSION=$1 + VERSION=${!#} BRANCH=$PREFIX$VERSION } @@ -197,6 +197,7 @@ cmd_finish() { 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_boolean push false "push to $ORIGIN after performing finish" p + DEFINE_boolean keep false 'keep branch after performing finish' k parse_args "$@" require_version_arg @@ -262,7 +263,11 @@ cmd_finish() { fi # delete branch - git branch -d "$BRANCH" + if flag keep; then + echo "Keep this branch" > /dev/null + else + git branch -d "$BRANCH" + fi if flag push; then git push "$ORIGIN" "$DEVELOP_BRANCH" || \ @@ -281,7 +286,11 @@ cmd_finish() { echo "- Release branch has been merged into '$MASTER_BRANCH'" echo "- The release was tagged '$tagname'" echo "- Release branch has been back-merged into '$DEVELOP_BRANCH'" - echo "- Release branch '$BRANCH' has been deleted" + if flag keep; then + echo "- Release branch '$BRANCH' has been kept" + else + echo "- Release branch '$BRANCH' has been deleted" + fi if flag push; then echo "- '$DEVELOP_BRANCH', '$MASTER_BRANCH' and tags have been pushed to '$ORIGIN'" echo "- Release branch '$BRANCH' in '$ORIGIN' has been deleted." From ff275fa6c8e1529be7db8518d88f799f7cb09add Mon Sep 17 00:00:00 2001 From: Nowell Strite Date: Wed, 22 Sep 2010 13:19:30 -0400 Subject: [PATCH 066/174] Changed versiontag prefix to allow addition of dynamic data (i.e. date) For example, you could set the versiontag prefix to be: git config --global gitflow.prefix.versiontag "production/\$(date +%Y/%m/%d/)" which would result in tag names like: production/2010/09/22/my-hotfix-or-feature-name NOTE: Although this is a useful addition in the current version of git-flow, in a future reimplementation of it in Python, this will be replaced by hook scripts, so be sure not to rely on this feature too much for now. --- git-flow-hotfix | 2 +- git-flow-release | 2 +- git-flow-support | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/git-flow-hotfix b/git-flow-hotfix index a05c4aacd..fe71fd32a 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -39,7 +39,7 @@ require_git_repo require_gitflow_initialized gitflow_load_settings -VERSION_PREFIX=$(git config --get gitflow.prefix.versiontag) +VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`") PREFIX=$(git config --get gitflow.prefix.hotfix) usage() { diff --git a/git-flow-release b/git-flow-release index d436bb198..6705856f1 100644 --- a/git-flow-release +++ b/git-flow-release @@ -39,7 +39,7 @@ require_git_repo require_gitflow_initialized gitflow_load_settings -VERSION_PREFIX=$(git config --get gitflow.prefix.versiontag) +VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`") PREFIX=$(git config --get gitflow.prefix.release) usage() { diff --git a/git-flow-support b/git-flow-support index 13091d63d..605694dc9 100644 --- a/git-flow-support +++ b/git-flow-support @@ -39,7 +39,7 @@ require_git_repo require_gitflow_initialized gitflow_load_settings -VERSION_PREFIX=$(git config --get gitflow.prefix.versiontag) +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!" From 3ef45cd4ef5e0eaf0aff291c9793aeb409875660 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 5 Oct 2010 10:03:48 +0200 Subject: [PATCH 067/174] Add Nowell, Felipe and Guillaume to the AUTHORS list. Thanks, guys! --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 9de970db8..4b6bd0ac7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -7,5 +7,8 @@ Authors are (ordered by first commit date): - Randy Merrill - Rick Osborne - Mark Derricutt +- Nowell Strite +- Felipe Talavera +- Guillaume-Jean Herbiet Portions derived from other open source works are clearly marked. From ddd9dfe9880dd8e25150c0016d878022ad35631a Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 5 Oct 2010 12:34:38 +0200 Subject: [PATCH 068/174] Tidy up a bit. --- git-flow-feature | 10 ++++------ git-flow-hotfix | 8 +++----- git-flow-release | 8 +++----- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index a38b0cce9..a413534a5 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -231,8 +231,8 @@ cmd_start() { cmd_finish() { DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F - DEFINE_boolean rebase false 'rebase instead of merge' r - DEFINE_boolean keep false 'keep branch after performing finish' k + DEFINE_boolean rebase false "rebase instead of merge" r + DEFINE_boolean keep false "keep branch after performing finish" k parse_args "$@" expand_nameprefix_arg @@ -346,9 +346,7 @@ helper_finish_cleanup() { fi - if flag keep; then - echo "Keep this branch" > /dev/null - else + if noflag keep; then git branch -d "$BRANCH" fi @@ -357,7 +355,7 @@ helper_finish_cleanup() { echo "- The feature branch '$BRANCH' was merged into '$DEVELOP_BRANCH'" #echo "- Merge conflicts were resolved" # TODO: Add this line when it's supported if flag keep; then - echo "- Feature branch '$BRANCH' has been kept" + echo "- Feature branch '$BRANCH' is still available" else echo "- Feature branch '$BRANCH' has been removed" fi diff --git a/git-flow-hotfix b/git-flow-hotfix index fe71fd32a..07bee23f9 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -194,7 +194,7 @@ cmd_finish() { 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_boolean push false "push to $ORIGIN after performing finish" p - DEFINE_boolean keep false 'keep branch after performing finish' k + DEFINE_boolean keep false "keep branch after performing finish" k parse_args "$@" require_version_arg @@ -258,9 +258,7 @@ cmd_finish() { fi # delete branch - if flag keep; then - echo "Keep this branch" > /dev/null - else + if noflag keep; then git branch -d "$BRANCH" fi @@ -280,7 +278,7 @@ cmd_finish() { echo "- The hotfix was tagged '$VERSION_PREFIX$VERSION'" echo "- Hotfix branch has been back-merged into '$DEVELOP_BRANCH'" if flag keep; then - echo "- Hotfix branch '$BRANCH' has been kept" + echo "- Hotfix branch '$BRANCH' is still available" else echo "- Hotfix branch '$BRANCH' has been deleted" fi diff --git a/git-flow-release b/git-flow-release index 6705856f1..521a9d822 100644 --- a/git-flow-release +++ b/git-flow-release @@ -197,7 +197,7 @@ cmd_finish() { 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_boolean push false "push to $ORIGIN after performing finish" p - DEFINE_boolean keep false 'keep branch after performing finish' k + DEFINE_boolean keep false "keep branch after performing finish" k parse_args "$@" require_version_arg @@ -263,9 +263,7 @@ cmd_finish() { fi # delete branch - if flag keep; then - echo "Keep this branch" > /dev/null - else + if noflag keep; then git branch -d "$BRANCH" fi @@ -287,7 +285,7 @@ cmd_finish() { echo "- The release was tagged '$tagname'" echo "- Release branch has been back-merged into '$DEVELOP_BRANCH'" if flag keep; then - echo "- Release branch '$BRANCH' has been kept" + echo "- Release branch '$BRANCH' is still available" else echo "- Release branch '$BRANCH' has been deleted" fi From 46f9998f37d8726f6499d336adb2b41770fe37d1 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 5 Oct 2010 12:45:29 +0200 Subject: [PATCH 069/174] Don't stop the script when the release branch is the current branch. Simply step aside to the master branch instead. --- git-flow-release | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/git-flow-release b/git-flow-release index 521a9d822..2b3684fbe 100644 --- a/git-flow-release +++ b/git-flow-release @@ -149,12 +149,6 @@ require_no_existing_release_branches() { die "There is an existing release branch ($first_branch). Finish that one first." } -require_not_on_release_branch() { - if [ "$BRANCH" = "$(git_current_branch)"]; then - die "You cannot be in the '$BRANCH' branch when you finish it." - fi -} - cmd_start() { DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F parse_args "$@" @@ -210,7 +204,6 @@ cmd_finish() { # sanity checks require_branch "$BRANCH" require_clean_working_tree - require_not_on_release_branch if flag fetch; then git fetch -q "$ORIGIN" "$MASTER_BRANCH" || \ die "Could not fetch $MASTER_BRANCH from $ORIGIN." @@ -264,6 +257,9 @@ cmd_finish() { # delete branch if noflag keep; then + if [ "$BRANCH" = "$(git_current_branch)" ]; then + git checkout "$MASTER_BRANCH" + fi git branch -d "$BRANCH" fi From ca8be5275ff6fd3e5f8012f31054c34d25ff0d9a Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 5 Oct 2010 14:33:50 +0200 Subject: [PATCH 070/174] Allow finishing release branches without creating a tag. This is useful for small projects. --- git-flow-hotfix | 35 +++++++++++++++++++++-------------- git-flow-release | 35 +++++++++++++++++++++-------------- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/git-flow-hotfix b/git-flow-hotfix index 07bee23f9..436760c36 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -195,6 +195,7 @@ cmd_finish() { DEFINE_string message "" "use the given tag message" m 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 parse_args "$@" require_version_arg @@ -230,17 +231,19 @@ cmd_finish() { # TODO: What do we do now? fi - # try to tag the release - # in case a previous attempt to finish this release branch has failed, - # but the tag was set successful, we skip it now - local tagname=$VERSION_PREFIX$VERSION - if ! git_tag_exists "$tagname"; then - local opts="-a" - flag sign && opts="$opts -s" - [ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'" - [ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'" - git tag $opts "$VERSION_PREFIX$VERSION" || \ - die "Tagging failed. Please run finish again to retry." + if noflag notag; then + # try to tag the release + # in case a previous attempt to finish this release branch has failed, + # but the tag was set successful, we skip it now + local tagname=$VERSION_PREFIX$VERSION + if ! git_tag_exists "$tagname"; then + local opts="-a" + flag sign && opts="$opts -s" + [ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'" + [ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'" + git tag $opts "$VERSION_PREFIX$VERSION" || \ + die "Tagging failed. Please run finish again to retry." + fi fi # try to merge into develop @@ -267,15 +270,19 @@ cmd_finish() { die "Could not push to $DEVELOP_BRANCH from $ORIGIN." git push "$ORIGIN" "$MASTER_BRANCH" || \ die "Could not push to $MASTER_BRANCH from $ORIGIN." - git push --tags "$ORIGIN" || \ - die "Could not push tags to $ORIGIN." + if noflag notag; then + git push --tags "$ORIGIN" || \ + die "Could not push tags to $ORIGIN." + fi fi echo echo "Summary of actions:" echo "- Latest objects have been fetched from '$ORIGIN'" echo "- Hotfix branch has been merged into '$MASTER_BRANCH'" - echo "- The hotfix was tagged '$VERSION_PREFIX$VERSION'" + if noflag notag; then + echo "- The hotfix was tagged '$VERSION_PREFIX$VERSION'" + fi echo "- Hotfix branch has been back-merged into '$DEVELOP_BRANCH'" if flag keep; then echo "- Hotfix branch '$BRANCH' is still available" diff --git a/git-flow-release b/git-flow-release index 2b3684fbe..e24c55e2a 100644 --- a/git-flow-release +++ b/git-flow-release @@ -192,6 +192,7 @@ cmd_finish() { DEFINE_string message "" "use the given tag message" m 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 parse_args "$@" require_version_arg @@ -228,17 +229,19 @@ cmd_finish() { # TODO: What do we do now? fi - # try to tag the release - # in case a previous attempt to finish this release branch has failed, - # but the tag was set successful, we skip it now - local tagname=$VERSION_PREFIX$VERSION - if ! git_tag_exists "$tagname"; then - local opts="-a" - flag sign && opts="$opts -s" - [ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'" - [ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'" - git tag $opts "$tagname" || \ - die "Tagging failed. Please run finish again to retry." + if noflag notag; then + # try to tag the release + # in case a previous attempt to finish this release branch has failed, + # but the tag was set successful, we skip it now + local tagname=$VERSION_PREFIX$VERSION + if ! git_tag_exists "$tagname"; then + local opts="-a" + flag sign && opts="$opts -s" + [ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'" + [ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'" + git tag $opts "$tagname" || \ + die "Tagging failed. Please run finish again to retry." + fi fi # try to merge into develop @@ -268,8 +271,10 @@ cmd_finish() { die "Could not push to $DEVELOP_BRANCH from $ORIGIN." git push "$ORIGIN" "$MASTER_BRANCH" || \ die "Could not push to $MASTER_BRANCH from $ORIGIN." - git push --tags "$ORIGIN" || \ - die "Could not push tags to $ORIGIN." + if noflag notag; then + git push --tags "$ORIGIN" || \ + die "Could not push tags to $ORIGIN." + fi git push "$ORIGIN" :"$BRANCH" || \ die "Could not delete the remote $BRANCH in $ORIGIN." fi @@ -278,7 +283,9 @@ cmd_finish() { echo "Summary of actions:" echo "- Latest objects have been fetched from '$ORIGIN'" echo "- Release branch has been merged into '$MASTER_BRANCH'" - echo "- The release was tagged '$tagname'" + if noflag notag; then + echo "- The release was tagged '$tagname'" + fi echo "- Release branch has been back-merged into '$DEVELOP_BRANCH'" if flag keep; then echo "- Release branch '$BRANCH' is still available" From f50df990af7a8cc70a8b42cd539538728c067df7 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 8 Oct 2010 08:39:25 +0200 Subject: [PATCH 071/174] Manually select the last argument. This implementation does not rely on Bash-specific functionality. --- git-flow-feature | 2 +- git-flow-hotfix | 2 +- git-flow-release | 2 +- gitflow-common | 8 ++++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index a413534a5..88935982c 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -180,7 +180,7 @@ parse_args() { parse_cmdline "$@" # read arguments into global variables - NAME=${!#} + NAME=$(last_arg "$@") BRANCH=$PREFIX$NAME } diff --git a/git-flow-hotfix b/git-flow-hotfix index 436760c36..a675619d8 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -124,7 +124,7 @@ parse_args() { eval set -- "${FLAGS_ARGV}" # read arguments into global variables - VERSION=${!#} + VERSION=$(last_arg "$@") BRANCH=$PREFIX$VERSION } diff --git a/git-flow-release b/git-flow-release index e24c55e2a..aea6e42ad 100644 --- a/git-flow-release +++ b/git-flow-release @@ -121,7 +121,7 @@ parse_args() { eval set -- "${FLAGS_ARGV}" # read arguments into global variables - VERSION=${!#} + VERSION=$(last_arg "$@") BRANCH=$PREFIX$VERSION } diff --git a/gitflow-common b/gitflow-common index dcb58bdd3..e5ffc748f 100644 --- a/gitflow-common +++ b/gitflow-common @@ -44,6 +44,14 @@ warn() { echo "$@" >&2; } die() { warn "$@"; exit 1; } +# argument processing +last_arg() { + if [ $# -ne 0 ]; then + shift $(expr $# - 1) + echo "$1" + fi +} + # set logic has() { local item=$1; shift From 47d1b9d7d07bc9fea793967831e02a618a3d7848 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 8 Oct 2010 11:20:00 +0200 Subject: [PATCH 072/174] Made a note on the apt-get installer's package name. This fixes issue #59. --- README.mdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index aeb50fb71..ecaa11a2a 100644 --- a/README.mdown +++ b/README.mdown @@ -43,7 +43,8 @@ directory. git-flow depends on the availability of the command line utility `getopt`, which may not be available in your Unix/Linux environment. Please use your favorite package manager to install `getopt`. For Cygwin, install the -`util-linux` package to get `getopt`. +`util-linux` package to get `getopt`. If you use `apt-get` as your install +manager, the package name is `opt`. Integration with your shell From e1ec57d48ac5c234262d84469af56b00b38929ab Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 18 Oct 2010 17:25:12 +0200 Subject: [PATCH 073/174] Tell getopt to parse POSIX compatible. By setting the environmental variable POSIXLY_CORRECT, getopt behaves strictly POSIX-compatible. This fixes the incorrect getopt parsing style that breaks git-flow in several flavours of Linux. Many thanks to Thiana for figuring this one out. This should fix issues #28 and #29. --- git-flow | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git-flow b/git-flow index e95d4ad0b..fa87e71f4 100755 --- a/git-flow +++ b/git-flow @@ -67,6 +67,11 @@ main() { # load common functionality . "$GITFLOW_DIR/gitflow-common" + # This environmental variable fixes non-POSIX getopt style argument + # parsing, effectively breaking git-flow subcommand parsing on several + # Linux platforms. + export POSIXLY_CORRECT=1 + # use the shFlags project to parse the command line arguments . "$GITFLOW_DIR/gitflow-shFlags" FLAGS_PARENT="git flow" From 60491d2da570f7f1a5d3aabb6150a2f842f7e07c Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 18 Oct 2010 21:46:20 +0200 Subject: [PATCH 074/174] Bump the version number. --- git-flow-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-version b/git-flow-version index e0b766317..cc8fd274d 100644 --- a/git-flow-version +++ b/git-flow-version @@ -36,7 +36,7 @@ # policies, either expressed or implied, of Vincent Driessen. # -GITFLOW_VERSION=0.4-dev +GITFLOW_VERSION=0.4 usage() { echo "usage: git flow version" From 1c289cf3089baa14738da0e198f2a3a80fb7b4bf Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 18 Oct 2010 21:46:28 +0200 Subject: [PATCH 075/174] Update changelog for this release. --- Changes.mdown | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Changes.mdown b/Changes.mdown index f23244c33..fe62f3486 100644 --- a/Changes.mdown +++ b/Changes.mdown @@ -1,8 +1,19 @@ 0.4: --- -Release date: ??? +Release date: **2010/10/18** -(No changes yet.) +* The flag parsing issues of git-flow subcommands are solved for most + platforms. + +* `git flow {feature,hotfix,release} finish` now takes a `-k` flag, to keep the + branch around after finishing. + +* `git flow release finish` takes a `-n` flag, to skip tagging. + +* For consistency, `git flow {release,hotfix}` now, too, have a `publish` and + `track` subcommand, just like `feature`. + +* Various minor fixes. 0.3: From b9250b04b81721aeede70da9b53200a5b85300e8 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 18 Oct 2010 23:39:01 +0200 Subject: [PATCH 076/174] Finally, we can get rid of this nasty FAQ! --- README.mdown | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/README.mdown b/README.mdown index ecaa11a2a..836aad1ff 100644 --- a/README.mdown +++ b/README.mdown @@ -98,27 +98,6 @@ FAQ on the [git-flow-users](http://groups.google.com/group/gitflow-users) mailinglist. -* **I'm getting errors when I use flags with git-flow!** - `git-flow` uses the [shFlags](http://code.google.com/p/shflags/) library to - provide platform independent flag parsing (using wichever low-level flag - parsing libraries like `getopt` or `getopts` are available). However, - `shFlags` does not work too well on a few platforms that haven't been tested - originally. This results in errors like this: - - flags:WARN getopt: option invalide -- 'f' -- 'init' flags:FATAL unable to parse provided options with getopt - - The platforms that suffer these errors include: - - - Gentoo - - Ubuntu - - Redhat Enterprise Linux - - There are open issues related to this: - [#28](http://github.com/nvie/gitflow/issues/28) and - [#39](http://github.com/nvie/gitflow/issues/39). Unfortunately, there is no - simple fix for it and all hope is placed on the Python rewrite of `git-flow`, - see issue [#33](http://github.com/nvie/gitflow/issues/33). - * **Can I use it with Windows?** There have been reports of Windows users using `git-flow`. Unfortunately, I have no Windows environment to test it on, but From 149d1544e0394320af8d067c88dfd16ef7dd85c7 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Wed, 20 Oct 2010 22:11:25 +0200 Subject: [PATCH 077/174] Add installation instructions for homebrew and MacPorts. --- README.mdown | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.mdown b/README.mdown index 836aad1ff..517611a68 100644 --- a/README.mdown +++ b/README.mdown @@ -7,19 +7,23 @@ blog post"). Installing git-flow ------------------- -The easiest way to install git-flow is using Rick Osborne's excellent -git-flow installer, which can be run using the following command: +If you're on a Mac and use "homebrew":http://github.com/mxcl/homebrew, it's simple: - $ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh + $ brew install git-flow + +If you're on a Mac and use "MacPorts":http://macports.org/, it's simple: -For __OSX__ users, the `wget` command isn't available by default, but `curl` is, so you can run: + $ port install git-flow - $ curl http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh +Another easy way to install git-flow is using Rick Osborne's excellent git-flow +installer, which can be run using the following command: + + $ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh For __Windows__ users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/) first to install tools like sh and wget. Then simply follow the command: - c:\Users\ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh + C:\> wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh If you prefer a manual installation, please use the following instructions. After downloading the sources from Github, also fetch the submodules: From 7567868912154cac3fdd34ad156bde6107662113 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 25 Oct 2010 22:25:41 +0200 Subject: [PATCH 078/174] Move the FAQ over to the Wiki on Github. I hope this makes it easier for people to contribute to git-flow. --- README.mdown | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/README.mdown b/README.mdown index 517611a68..da9ad7898 100644 --- a/README.mdown +++ b/README.mdown @@ -65,48 +65,7 @@ starting place for installing git. FAQ --- -* **Can I still do manual branches and merges when I use git-flow?** - Of course you can. `git-flow` does not forbid you to keep using vanilla Git - commands! - - So if you want to merge `master` into `develop` for whatever reason you want - to, you can safely do so without breaking `git-flow` compatibility. Do you - want to manually merge a feature branch X into another feature branch Y? Not - a problem. As long as you do it conciously and realize what this means for - finishing those branches later on. - -* **Why does git-describe not work for me?** - When finishing release and hotfix branches, that branch's HEAD is first - merged into `master` and then into `develop`. It is not the resulting new - merge commit from `master` that is merged back into `develop`. This means - that a linear path from the new `develop` branch to the new `master` commit - is not created. Even worse, a linear path is created from the new `develop` - branch to the *previous* `master` commit. Although unintended, this is - simply an effect of using the current branching rules. - - When using `git-describe` in these cases, you can get very confusing and - misleading results, since `git-describe` scans the current commits linear - history for the most recent tag it finds, which will always be the *previous* - tag. - - I will change this behaviour in the next version of the branching model - explicitly and I will include this behavioural change in the first version of - the Python rewrite. - - For more references to this problem, see: - - - Issue [#49](http://github.com/nvie/gitflow/issues/49) - - These - [two](http://groups.google.com/group/gitflow-users/browse\_thread/thread/9920a7df3d1c4908/0bb18a0bf7275ad6#0bb18a0bf7275ad6) - [discussions](http://groups.google.com/group/gitflow-users/browse\_thread/thread/19efac724bb6418a) - on the [git-flow-users](http://groups.google.com/group/gitflow-users) - mailinglist. - -* **Can I use it with Windows?** - There have been reports of Windows users using `git-flow`. - Unfortunately, I have no Windows environment to test it on, but - this [issue](http://github.com/nvie/gitflow/issues/issue/25) should be - helpful in setting it up. +See the [FAQ](http://github.com/nvie/gitflow/wiki) section of the project Wiki. Please help out From 61f2c691b615c053f313022a43e874c5f65cd557 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sun, 31 Oct 2010 06:22:36 +0100 Subject: [PATCH 079/174] Fix FAQ link. --- README.mdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index da9ad7898..9c510c8f6 100644 --- a/README.mdown +++ b/README.mdown @@ -65,7 +65,8 @@ starting place for installing git. FAQ --- -See the [FAQ](http://github.com/nvie/gitflow/wiki) section of the project Wiki. +See the [FAQ](http://github.com/nvie/gitflow/wiki/FAQ) section of the project +Wiki. Please help out From e26bfbc5b537b9c65cc6a27ed0579168e6ac4a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Gro=C3=9F?= Date: Tue, 2 Nov 2010 14:05:44 +0100 Subject: [PATCH 080/174] Adding more detailed installation information for Windows users on Cygwin and msysgit --- README.mdown | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/README.mdown b/README.mdown index 9c510c8f6..ffd3d20da 100644 --- a/README.mdown +++ b/README.mdown @@ -7,24 +7,59 @@ blog post"). Installing git-flow ------------------- -If you're on a Mac and use "homebrew":http://github.com/mxcl/homebrew, it's simple: + +### Mac OS +If you're on a Mac and use [homebrew](http://github.com/mxcl/homebrew), it's simple: $ brew install git-flow -If you're on a Mac and use "MacPorts":http://macports.org/, it's simple: +If you're on a Mac and use [MacPorts](http://macports.org/), it's simple: $ port install git-flow +### Linux, etc. Another easy way to install git-flow is using Rick Osborne's excellent git-flow installer, which can be run using the following command: $ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh -For __Windows__ users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/) -first to install tools like sh and wget. Then simply follow the command: +### Windows +#### Using Cygwin +For Windows users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/) +first to install tools like `git`, `util-linux` and `wget` (with those three being packages that can be selected +during installation). Then simply run this command from a Cygwin shell: + + $ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh + +#### Using msysgit +This is much like the manual installation below, but there are additional steps required to install some extra tools that +are not distributed with [msysgit](http://code.google.com/p/msysgit/). + +After cloning the git-flow sources from Github, also fetch the submodules: + + $ git submodule init + $ git submodule update + +Copy git-flow's relevant files to your msysgit installation directory: + + $ mkdir /usr/local/bin + $ cp git-flow* gitflow* /usr/local/bin/ + $ cp shFlags/src/shflags /usr/local/bin/gitflow-shFlags + +Next up we need to borrow a couple of binaries from [Cygwin](http://www.cygwin.com/). If you don't have Cygwin installed, please +install it including the `util-linux` package. Apart from `util-linux`'s dependencies, no other packages are required. When you +finished installation, copy the following files using msysgit's _Git Bash_. We assume the Cygwin's default installation path in C:\cygwin. + + $ cd /c/cygwin/ + $ cp bin/getopt.exe /usr/local/bin/ + $ cp bin/cyggcc_s-1.dll /usr/local/bin/ + $ cp bin/cygiconv-2.dll /usr/local/bin/ + $ cp bin/cygintl-8.dll /usr/local/bin/ + $ cp bin/cygwin1.dll /usr/local/bin/ - C:\> wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh +After copying the files above, you can safely uninstall your Cygwin installation by deleting the C:\cygwin directory. +### Manual installation If you prefer a manual installation, please use the following instructions. After downloading the sources from Github, also fetch the submodules: From 5ff0b47909be3e8bdd4da04b9a22cfc1b170609f Mon Sep 17 00:00:00 2001 From: "Brian St. Pierre" Date: Wed, 3 Nov 2010 16:40:58 -0400 Subject: [PATCH 081/174] Fix issue 34: "release finish" error: bad variable name. On some systems, /bin/sh is a symlink to dash. "local" here wants to create variables for multiple words on the line. Added quotes so that these are not treated as multiple variables. --- gitflow-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitflow-common b/gitflow-common index e5ffc748f..4255f99f5 100644 --- a/gitflow-common +++ b/gitflow-common @@ -148,7 +148,7 @@ git_compare_branches() { git_is_branch_merged_into() { local subject=$1 local base=$2 - local all_merges=$(git branch --no-color --contains $subject | sed 's/^[* ] //') + local all_merges="$(git branch --no-color --contains $subject | sed 's/^[* ] //')" has $base $all_merges } From 6f199b97db0b2b5c46ff60575ef5f0a17997a674 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 11 Nov 2010 08:57:01 +0100 Subject: [PATCH 082/174] Make Github download URL in README https. --- README.mdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.mdown b/README.mdown index ffd3d20da..94d6c2589 100644 --- a/README.mdown +++ b/README.mdown @@ -21,7 +21,7 @@ If you're on a Mac and use [MacPorts](http://macports.org/), it's simple: Another easy way to install git-flow is using Rick Osborne's excellent git-flow installer, which can be run using the following command: - $ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh + $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh ### Windows #### Using Cygwin @@ -29,7 +29,7 @@ For Windows users who wish to use the automated install, it is suggested that yo first to install tools like `git`, `util-linux` and `wget` (with those three being packages that can be selected during installation). Then simply run this command from a Cygwin shell: - $ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh + $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh #### Using msysgit This is much like the manual installation below, but there are additional steps required to install some extra tools that From c4d0cb15b875819a6015b3ced031ead1be08ecd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schu=CC=88=C3=9Fler?= Date: Thu, 2 Dec 2010 18:55:06 +0800 Subject: [PATCH 083/174] fixed typo --- git-flow-hotfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-hotfix b/git-flow-hotfix index a675619d8..545b5e7a4 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -65,7 +65,7 @@ cmd_list() { warn "" warn "You can start a new hotfix branch:" warn "" - warn " git flow hotfix start []" + warn " git flow hotfix start []" warn "" exit 0 fi From 3770f07638909650154fa6d54144b78ad3f5099c Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 6 Dec 2010 14:53:51 -0800 Subject: [PATCH 084/174] Add stillmaintained link. --- README.mdown | 1 + 1 file changed, 1 insertion(+) diff --git a/README.mdown b/README.mdown index 94d6c2589..93daca62e 100644 --- a/README.mdown +++ b/README.mdown @@ -1,5 +1,6 @@ git-flow ======== +![Project status](http://stillmaintained.com/nvie/gitflow.png) A collection of Git extensions to provide high-level repository operations for Vincent Driessen's [branching model](http://nvie.com/git-model "original blog post"). From 877f5fe8c778f8424617e8cb3f4e82fa93d3c1db Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 6 Dec 2010 14:54:50 -0800 Subject: [PATCH 085/174] Fix placement. --- README.mdown | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.mdown b/README.mdown index 93daca62e..11474235f 100644 --- a/README.mdown +++ b/README.mdown @@ -1,6 +1,5 @@ -git-flow +git-flow ![Project status](http://stillmaintained.com/nvie/gitflow.png) ======== -![Project status](http://stillmaintained.com/nvie/gitflow.png) A collection of Git extensions to provide high-level repository operations for Vincent Driessen's [branching model](http://nvie.com/git-model "original blog post"). From fe1d4c9f70efd631f3e9d8e6e4733051a76bf186 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 31 Jan 2011 22:39:17 +0100 Subject: [PATCH 086/174] Add links to the great screen casts on git-flow to the README. Thanks Mark and David! --- README.mdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.mdown b/README.mdown index 11474235f..e4f368217 100644 --- a/README.mdown +++ b/README.mdown @@ -134,6 +134,11 @@ Kreeftmeijer's blog post: [http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/) +Or have a look at one of these screen casts: + +* [A short introduction to git-flow](http://vimeo.com/16018419) (by Mark Derricutt) +* [On the path with git-flow](http://codesherpas.com/screencasts/on_the_path_gitflow.mov) (by Dave Bock) + ### Initialization From 553776fd08c288fa221817ce118939c358d08ecb Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 31 Jan 2011 22:43:06 +0100 Subject: [PATCH 087/174] Move up the "getting started" paragraph. It's the most important one that should be on top. --- README.mdown | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.mdown b/README.mdown index e4f368217..16704d7b6 100644 --- a/README.mdown +++ b/README.mdown @@ -5,6 +5,19 @@ for Vincent Driessen's [branching model](http://nvie.com/git-model "original blog post"). +Getting started +--------------- +For the best introduction to get started with `git flow`, please read Jeff +Kreeftmeijer's blog post: + +[http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/) + +Or have a look at one of these screen casts: + +* [A short introduction to git-flow](http://vimeo.com/16018419) (by Mark Derricutt) +* [On the path with git-flow](http://codesherpas.com/screencasts/on_the_path_gitflow.mov) (by Dave Bock) + + Installing git-flow ------------------- @@ -127,19 +140,6 @@ invited to contribute back your modifications to the community, preferably in a Github fork, of course. -Typical usage: --------------- -For the best introduction to get started to `git flow`, please read Jeff -Kreeftmeijer's blog post: - -[http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/) - -Or have a look at one of these screen casts: - -* [A short introduction to git-flow](http://vimeo.com/16018419) (by Mark Derricutt) -* [On the path with git-flow](http://codesherpas.com/screencasts/on_the_path_gitflow.mov) (by Dave Bock) - - ### Initialization To initialize a new repo with the basic branch structure, use: From f1eaa4e0d05a1edc1023a1922c7cc5e2d5bcb546 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 3 Feb 2011 16:11:25 +0100 Subject: [PATCH 088/174] Don't just take the last argument, take the first. This patch was originally contributed as a workaround for the cases where there were flags that took the first argument position. This fix was just plain wrong and this commit reverts it. --- git-flow-feature | 2 +- git-flow-hotfix | 2 +- git-flow-release | 2 +- gitflow-common | 8 -------- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index 88935982c..b69cc73ce 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -180,7 +180,7 @@ parse_args() { parse_cmdline "$@" # read arguments into global variables - NAME=$(last_arg "$@") + NAME=$1 BRANCH=$PREFIX$NAME } diff --git a/git-flow-hotfix b/git-flow-hotfix index 545b5e7a4..5660131bf 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -124,7 +124,7 @@ parse_args() { eval set -- "${FLAGS_ARGV}" # read arguments into global variables - VERSION=$(last_arg "$@") + VERSION=$1 BRANCH=$PREFIX$VERSION } diff --git a/git-flow-release b/git-flow-release index aea6e42ad..05815bcf0 100644 --- a/git-flow-release +++ b/git-flow-release @@ -121,7 +121,7 @@ parse_args() { eval set -- "${FLAGS_ARGV}" # read arguments into global variables - VERSION=$(last_arg "$@") + VERSION=$1 BRANCH=$PREFIX$VERSION } diff --git a/gitflow-common b/gitflow-common index 4255f99f5..c58cca03d 100644 --- a/gitflow-common +++ b/gitflow-common @@ -44,14 +44,6 @@ warn() { echo "$@" >&2; } die() { warn "$@"; exit 1; } -# argument processing -last_arg() { - if [ $# -ne 0 ]; then - shift $(expr $# - 1) - echo "$1" - fi -} - # set logic has() { local item=$1; shift From 68e53aae80f9b3b74edffd1ecb5458063bb9d6ed Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 3 Feb 2011 16:29:50 +0100 Subject: [PATCH 089/174] Fix: "eval set" called in the wrong context. This is the real fix for the incorrect fix that I reverted in the previous commit. parse_cmdline was used to DRY up the source, but this introduced a bug because the "eval set" line changes the positional parameters semantics, but does it in the wrong context, so the calling function never receives the changes. This closes at least the GitHub issues #54 and #86. --- git-flow-feature | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index b69cc73ce..226730a9b 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -170,14 +170,10 @@ name_or_current() { fi } -parse_cmdline() { +parse_args() { # parse options FLAGS "$@" || exit $? eval set -- "${FLAGS_ARGV}" -} - -parse_args() { - parse_cmdline "$@" # read arguments into global variables NAME=$1 @@ -185,7 +181,9 @@ parse_args() { } parse_remote_name() { - parse_cmdline "$@" + # parse options + FLAGS "$@" || exit $? + eval set -- "${FLAGS_ARGV}" # read arguments into global variables REMOTE=$1 From 0f74cf4f8d8a78f16a112ef28425b75aefeaea1f Mon Sep 17 00:00:00 2001 From: raybec Date: Mon, 6 Dec 2010 13:00:13 -0800 Subject: [PATCH 090/174] This patch prevents silent failure of the auto-installer. Original commit message: Allows wget to work rather than failing silently. The actual error is "ERROR: certificate common name `*.github.com' doesn't match requested host name `github.com'." Tested on Ubuntu 10.10. Not tested on Windows, so I haven't changed that line. Signed-off-by: Vincent Driessen --- README.mdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index 16704d7b6..901653828 100644 --- a/README.mdown +++ b/README.mdown @@ -34,7 +34,7 @@ If you're on a Mac and use [MacPorts](http://macports.org/), it's simple: Another easy way to install git-flow is using Rick Osborne's excellent git-flow installer, which can be run using the following command: - $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh + $ wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh ### Windows #### Using Cygwin From 1b471a66b43ee95067b53937c62dc42d4bc561e6 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 4 Feb 2011 08:25:38 +0100 Subject: [PATCH 091/174] Escape characters from tags that have special meaning in grep. In particular, this fixes the case where a dot in a version name (not too uncommon ;)) unintentionally matches a pre-existing tag. For example, if these tags exist: 1.0.1 1.0b2 And you try to start a new release for 1.0.2, git-flow prevented it, since the '.' matches the 'b' in 1.0b2. This resulted in the invalid error message: Tag '1.0.2' already exists. Pick another name. --- gitflow-common | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gitflow-common b/gitflow-common index c58cca03d..75eb210ee 100644 --- a/gitflow-common +++ b/gitflow-common @@ -44,10 +44,14 @@ warn() { echo "$@" >&2; } die() { warn "$@"; exit 1; } +escape() { + echo "$1" | sed 's/\([\.\+\$\*]\)/\\\1/g' +} + # set logic has() { local item=$1; shift - echo " $@ " | grep -q " $item " + echo " $@ " | grep -q " $(escape $item) " } # basic math @@ -211,7 +215,7 @@ gitflow_resolve_nameprefix() { return 0 fi - matches=$(echo "$(git_local_branches)" | grep "^$prefix$name") + matches=$(echo "$(git_local_branches)" | grep "^$(escape "$prefix$name")") num_matches=$(echo "$matches" | wc -l) if [ -z "$matches" ]; then # no prefix match, so take it literally From d2eccaa7d759c06ff82a7f6ccfb67a94610a0e09 Mon Sep 17 00:00:00 2001 From: "Joseph A. Levin" Date: Fri, 4 Feb 2011 21:30:15 -0600 Subject: [PATCH 092/174] Issue: 88 Added support for using defaults without prompts when using git flow init. --- git-flow-init | 51 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/git-flow-init b/git-flow-init index 461ee8cc6..3726ce046 100644 --- a/git-flow-init +++ b/git-flow-init @@ -37,7 +37,7 @@ # usage() { - echo "usage: git flow init [-f]" + echo "usage: git flow init [-f] [--defaults]" } parse_args() { @@ -49,8 +49,9 @@ parse_args() { # Default entry when no SUBACTION is given cmd_default() { DEFINE_boolean force false 'force setting of gitflow branches, even if already configured' f + DEFINE_boolean defaults false 'use default branch names' 'defaults' parse_args "$@" - + if ! git rev-parse --git-dir >/dev/null 2>&1; then git init else @@ -101,9 +102,17 @@ cmd_default() { fi done fi + + if flag defaults; then + warn "Using default branch names." + fi printf "Branch name for production releases: [$default_suggestion] " - read answer + if ! flag defaults; then + read answer + else + printf "\n" + fi master_branch=${answer:-$default_suggestion} # check existence in case of an already existing repo @@ -146,7 +155,11 @@ cmd_default() { fi printf "Branch name for \"next release\" development: [$default_suggestion] " - read answer + if ! flag defaults; then + read answer + else + printf "\n" + fi develop_branch=${answer:-$default_suggestion} if [ "$master_branch" = "$develop_branch" ]; then @@ -216,7 +229,11 @@ cmd_default() { if ! git config --get gitflow.prefix.feature >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.feature || echo feature/) printf "Feature branches? [$default_suggestion] " - read answer + if ! flag defaults; then + read answer + else + printf "\n" + fi [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} git config gitflow.prefix.feature "$prefix" fi @@ -225,7 +242,11 @@ cmd_default() { if ! git config --get gitflow.prefix.release >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.release || echo release/) printf "Release branches? [$default_suggestion] " - read answer + if ! flag defaults; then + read answer + else + printf "\n" + fi [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} git config gitflow.prefix.release "$prefix" fi @@ -235,7 +256,11 @@ cmd_default() { if ! git config --get gitflow.prefix.hotfix >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.hotfix || echo hotfix/) printf "Hotfix branches? [$default_suggestion] " - read answer + if ! flag defaults; then + read answer + else + printf "\n" + fi [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} git config gitflow.prefix.hotfix "$prefix" fi @@ -245,7 +270,11 @@ cmd_default() { if ! git config --get gitflow.prefix.support >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.support || echo support/) printf "Support branches? [$default_suggestion] " - read answer + if ! flag defaults; then + read answer + else + printf "\n" + fi [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} git config gitflow.prefix.support "$prefix" fi @@ -255,7 +284,11 @@ cmd_default() { if ! git config --get gitflow.prefix.versiontag >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.versiontag || echo "") printf "Version tag prefix? [$default_suggestion] " - read answer + if ! flag defaults; then + read answer + else + printf "\n" + fi [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} git config gitflow.prefix.versiontag "$prefix" fi From 5f860bf350ee355071b3708a8f63d31376265d43 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sat, 5 Feb 2011 08:22:38 +0100 Subject: [PATCH 093/174] Rewrite Joseph Levin's solution a bit. Thanks Joseph! I've added you to the AUTHORS file, too. --- AUTHORS | 1 + git-flow-init | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/AUTHORS b/AUTHORS index 4b6bd0ac7..060f09ffe 100644 --- a/AUTHORS +++ b/AUTHORS @@ -10,5 +10,6 @@ Authors are (ordered by first commit date): - Nowell Strite - Felipe Talavera - Guillaume-Jean Herbiet +- Joseph A. Levin Portions derived from other open source works are clearly marked. diff --git a/git-flow-init b/git-flow-init index 3726ce046..e901696a4 100644 --- a/git-flow-init +++ b/git-flow-init @@ -37,7 +37,7 @@ # usage() { - echo "usage: git flow init [-f] [--defaults]" + echo "usage: git flow init [-fd]" } parse_args() { @@ -49,7 +49,7 @@ parse_args() { # Default entry when no SUBACTION is given cmd_default() { DEFINE_boolean force false 'force setting of gitflow branches, even if already configured' f - DEFINE_boolean defaults false 'use default branch names' 'defaults' + DEFINE_boolean defaults false 'use default branch naming conventions' d parse_args "$@" if ! git rev-parse --git-dir >/dev/null 2>&1; then @@ -108,7 +108,7 @@ cmd_default() { fi printf "Branch name for production releases: [$default_suggestion] " - if ! flag defaults; then + if noflag defaults; then read answer else printf "\n" @@ -155,7 +155,7 @@ cmd_default() { fi printf "Branch name for \"next release\" development: [$default_suggestion] " - if ! flag defaults; then + if noflag defaults; then read answer else printf "\n" @@ -229,7 +229,7 @@ cmd_default() { if ! git config --get gitflow.prefix.feature >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.feature || echo feature/) printf "Feature branches? [$default_suggestion] " - if ! flag defaults; then + if noflag defaults; then read answer else printf "\n" @@ -242,7 +242,7 @@ cmd_default() { if ! git config --get gitflow.prefix.release >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.release || echo release/) printf "Release branches? [$default_suggestion] " - if ! flag defaults; then + if noflag defaults; then read answer else printf "\n" @@ -256,7 +256,7 @@ cmd_default() { if ! git config --get gitflow.prefix.hotfix >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.hotfix || echo hotfix/) printf "Hotfix branches? [$default_suggestion] " - if ! flag defaults; then + if noflag defaults; then read answer else printf "\n" @@ -270,7 +270,7 @@ cmd_default() { if ! git config --get gitflow.prefix.support >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.support || echo support/) printf "Support branches? [$default_suggestion] " - if ! flag defaults; then + if noflag defaults; then read answer else printf "\n" @@ -284,7 +284,7 @@ cmd_default() { if ! git config --get gitflow.prefix.versiontag >/dev/null 2>&1 || flag force; then default_suggestion=$(git config --get gitflow.prefix.versiontag || echo "") printf "Version tag prefix? [$default_suggestion] " - if ! flag defaults; then + if noflag defaults; then read answer else printf "\n" From 2d0cbec65f88c1dacef94ea0603e457c1ed05dab Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sun, 6 Feb 2011 07:52:43 +0100 Subject: [PATCH 094/174] Add some changelog notes. --- Changes.mdown | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Changes.mdown b/Changes.mdown index fe62f3486..c4f4c8b12 100644 --- a/Changes.mdown +++ b/Changes.mdown @@ -1,3 +1,17 @@ +0.4.1: +----- +Release date: *Not released yet* + +* New option `-d` added to `git flow init`, to initialize with defaults without + asking for input. Ideal for creating git-flow enabled repos in custom + scripts. + +* The parsing issues related to git-flow feature's flags are now dealt with on + all known platforms. (Fixed #54, #62, #86, #97) + +* Escape queries for detecting branch/tag names. (Fixed #91) + + 0.4: --- Release date: **2010/10/18** From 69f205c13bb70549e8f818b5eb6049885322fae7 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Fri, 11 Feb 2011 09:15:18 +0100 Subject: [PATCH 095/174] I only just discovered the --recursive flag to git clone. Using --recursive simplifies instructions related to the submodule initialization for shFlags. --- README.mdown | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.mdown b/README.mdown index 901653828..44c13fb81 100644 --- a/README.mdown +++ b/README.mdown @@ -48,10 +48,9 @@ during installation). Then simply run this command from a Cygwin shell: This is much like the manual installation below, but there are additional steps required to install some extra tools that are not distributed with [msysgit](http://code.google.com/p/msysgit/). -After cloning the git-flow sources from Github, also fetch the submodules: +Clone the git-flow sources from Github: - $ git submodule init - $ git submodule update + $ git clone --recursive git://github.com/nvie/gitflow.git Copy git-flow's relevant files to your msysgit installation directory: @@ -73,11 +72,9 @@ finished installation, copy the following files using msysgit's _Git Bash_. We a After copying the files above, you can safely uninstall your Cygwin installation by deleting the C:\cygwin directory. ### Manual installation -If you prefer a manual installation, please use the following instructions. -After downloading the sources from Github, also fetch the submodules: +If you prefer a manual installation, please use the following instructions: - $ git submodule init - $ git submodule update + $ git clone --recursive git://github.com/nvie/gitflow.git Then, you can install `git-flow`, using: From f78b6604adc771e963fb463d8eb5b8be6aa87bb7 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 14 Feb 2011 07:39:23 +0100 Subject: [PATCH 096/174] Move up the notification that default branch names are being used. --- git-flow-init | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/git-flow-init b/git-flow-init index e901696a4..57ab2441e 100644 --- a/git-flow-init +++ b/git-flow-init @@ -69,6 +69,10 @@ cmd_default() { local branch_count local answer + if flag defaults; then + warn "Using default branch names." + fi + # add a master branch if no such branch exists yet local master_branch if gitflow_has_master_configured && ! flag force; then @@ -103,10 +107,6 @@ cmd_default() { done fi - if flag defaults; then - warn "Using default branch names." - fi - printf "Branch name for production releases: [$default_suggestion] " if noflag defaults; then read answer From 8044ddf328cdd689524a94bae53e6eff449b0e42 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 14 Feb 2011 07:42:35 +0100 Subject: [PATCH 097/174] Bump the version number. --- git-flow-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-version b/git-flow-version index cc8fd274d..51fd67136 100644 --- a/git-flow-version +++ b/git-flow-version @@ -36,7 +36,7 @@ # policies, either expressed or implied, of Vincent Driessen. # -GITFLOW_VERSION=0.4 +GITFLOW_VERSION=0.4.1 usage() { echo "usage: git flow version" From 4b5b9320777f7004c29331c35de1e7e46029e134 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 14 Feb 2011 07:44:18 +0100 Subject: [PATCH 098/174] Update the changelog. --- Changes.mdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Changes.mdown b/Changes.mdown index c4f4c8b12..72c04bc7f 100644 --- a/Changes.mdown +++ b/Changes.mdown @@ -1,10 +1,10 @@ 0.4.1: ----- -Release date: *Not released yet* +Release date: **2011/02/04** * New option `-d` added to `git flow init`, to initialize with defaults without - asking for input. Ideal for creating git-flow enabled repos in custom - scripts. + asking for input interactively. Ideal for creating git-flow enabled repos in + custom scripts. * The parsing issues related to git-flow feature's flags are now dealt with on all known platforms. (Fixed #54, #62, #86, #97) From 023ed6983e7bc14664c9095d1e099dd974ba25b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Sun, 20 Mar 2011 20:22:51 +0100 Subject: [PATCH 099/174] Add an installer for the msysgit environment This installer: - detects the Git installation path - checks prereqs (git, getopt.exe) - delete old gitflow install - install gitflow files "Access denied" errors are detected and the user is given advice in that case ( use full administrator rights). --- contrib/msysgit-install.cmd | 76 +++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 contrib/msysgit-install.cmd diff --git a/contrib/msysgit-install.cmd b/contrib/msysgit-install.cmd new file mode 100644 index 000000000..12858397d --- /dev/null +++ b/contrib/msysgit-install.cmd @@ -0,0 +1,76 @@ +@echo off +setlocal +if not "%~1"=="" set GIT_HOME=%~f1 +if "%GIT_HOME%"=="" call :FindGitHome "git.cmd" + +if exist "%GIT_HOME%" goto :GitHomeOK + +echo MsysGit installation directory not found.>&2 +echo Try to give the directory name on the command line:>&2 +echo %0 "%ProgramFiles%\Git" +endlocal +exit /B 1 + +:GitHomeOK +set ERR=0 + +echo Installing gitflow into "%GIT_HOME%"... + +call :ChkGetopt getopt.exe || set ERR=1 +if %ERR%==1 goto :End +echo getopt.exe... Found + +if not exist "%GIT_HOME%\bin\git-flow" goto :Install +echo GitFlow is already installed.>&2 +choice /C YN /M "Do you want to replace it" +if errorlevel 255 goto :Abort +if errorlevel 2 goto :Abort +if not errorlevel 1 goto :Abort + +echo Deleting old files... +for /F %%i in ("%GIT_HOME%\git-flow*" "%GIT_HOME%\gitflow-*") do if exist "%%~fi" del /F /Q "%%~fi" + +:Install +echo Copying files... +::goto :EOF +xcopy "%~dp0\..\git-flow" "%GIT_HOME%\bin" /Y /R /F +if errorlevel 4 if not errorlevel 5 goto :AccessDenied +if errorlevel 1 set ERR=1 +xcopy "%~dp0\..\git-flow*" "%GIT_HOME%\bin" /Y /R /F || set ERR=1 +xcopy "%~dp0\..\gitflow-*" "%GIT_HOME%\bin" /Y /R /F || set ERR=1 +xcopy "%~dp0\..\shFlags\src\shflags" "%GIT_HOME%\bin\gitflow-shFlags" /Y /R /F || set ERR=1 + +if %ERR%==1 choice /T 30 /C Y /D Y /M "Some unexpected errors happened. Sorry, you'll have to fix them by yourself." + +:End +endlocal & exit /B %ERR% +goto :EOF + +:AccessDenied +set ERR=1 +echo. +echo You should run this script with "Full Administrator" rights:>&2 +echo - Right-click with Shift on the script from the Explorer>&2 +echo - Select "Run as administrator">&2 +choice /T 30 /C YN /D Y /N >nul +goto :End + +:Abort +echo Installation canceled.>&2 +set ERR=1 +goto :End + +:ChkGetopt +:: %1 is getopt.exe +if exist "%GIT_HOME%\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. +exit /B 1 + +:FindGitHome +setlocal +set GIT_CMD_DIR=%~dp$PATH:1 +if "%GIT_CMD_DIR%"=="" endlocal & goto :EOF +endlocal & set GIT_HOME=%GIT_CMD_DIR:~0,-5% +goto :EOF From b52f79e3c1352ac11c50421222af4a20b2a695f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Sun, 20 Mar 2011 20:34:39 +0100 Subject: [PATCH 100/174] Update README for msysgit to use the new installer --- README.mdown | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/README.mdown b/README.mdown index 44c13fb81..16ac66285 100644 --- a/README.mdown +++ b/README.mdown @@ -37,6 +37,10 @@ installer, which can be run using the following command: $ wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh ### Windows + +For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good +starting place for installing git. + #### Using Cygwin For Windows users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/) first to install tools like `git`, `util-linux` and `wget` (with those three being packages that can be selected @@ -44,32 +48,19 @@ during installation). Then simply run this command from a Cygwin shell: $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh -#### Using msysgit -This is much like the manual installation below, but there are additional steps required to install some extra tools that -are not distributed with [msysgit](http://code.google.com/p/msysgit/). +#### Using [msysgit](http://code.google.com/p/msysgit/) +Download and install `getopt.exe` from the [util-linux package](http://gnuwin32.sourceforge.net/packages/util-linux-ng.htm) into `C:\Program Files\Git\bin`. (Only `getopt.exe`, the others util-linux files are not used). -Clone the git-flow sources from Github: +Clone the git-flow sources from GitHub: $ git clone --recursive git://github.com/nvie/gitflow.git + $ cd gitflow -Copy git-flow's relevant files to your msysgit installation directory: - - $ mkdir /usr/local/bin - $ cp git-flow* gitflow* /usr/local/bin/ - $ cp shFlags/src/shflags /usr/local/bin/gitflow-shFlags +Run the `msysgit-install` script from a command-line prompt (you may have to +run it with "Full Administrator" rights if you installed msysgit with its +installer): -Next up we need to borrow a couple of binaries from [Cygwin](http://www.cygwin.com/). If you don't have Cygwin installed, please -install it including the `util-linux` package. Apart from `util-linux`'s dependencies, no other packages are required. When you -finished installation, copy the following files using msysgit's _Git Bash_. We assume the Cygwin's default installation path in C:\cygwin. - - $ cd /c/cygwin/ - $ cp bin/getopt.exe /usr/local/bin/ - $ cp bin/cyggcc_s-1.dll /usr/local/bin/ - $ cp bin/cygiconv-2.dll /usr/local/bin/ - $ cp bin/cygintl-8.dll /usr/local/bin/ - $ cp bin/cygwin1.dll /usr/local/bin/ - -After copying the files above, you can safely uninstall your Cygwin installation by deleting the C:\cygwin directory. + C:\gitflow> contrib\msysgit-install.cmd ### Manual installation If you prefer a manual installation, please use the following instructions: @@ -104,9 +95,6 @@ For those who use the [Bash](http://www.gnu.org/software/bash/) or by [bobthecow](http://github.com/bobthecow). It offers tab-completion for all git-flow subcommands and branch names. -For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good -starting place for installing git. - FAQ --- From 8f280e0b55911d84bd2a8550aef3b9e02d53787d Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 28 Mar 2011 18:48:39 +0200 Subject: [PATCH 101/174] Fixed require_tag_absent to not break when the list of tags contains an ambiguous entry, e.g. looking for "1.0.1" in "0.1.0 0.1.1 0.1.2 1.0". --- gitflow-common | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gitflow-common b/gitflow-common index 75eb210ee..27e7a0631 100644 --- a/gitflow-common +++ b/gitflow-common @@ -288,9 +288,11 @@ require_branch_absent() { } require_tag_absent() { - if has $1 $(git_all_tags); then - die "Tag '$1' already exists. Pick another name." - fi + for tag in $(git_all_tags); do + if [ "$1" = "$tag" ]; then + die "Tag '$1' already exists. Pick another name." + fi + done } require_branches_equal() { From f6fcc4eed9c720ba9f0fab89e5f677be36efa7e2 Mon Sep 17 00:00:00 2001 From: Konstantin Tjuterev Date: Thu, 14 Apr 2011 19:20:19 +0300 Subject: [PATCH 102/174] - Removed quoting in has $SOME_BRANCH $(get_remote_branches), as the check was always false - Added fetching develop branch from origin when fetch flag is on in feature finish --- git-flow-feature | 7 ++++--- git-flow-hotfix | 6 +++--- git-flow-release | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index 226730a9b..ebbb03574 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -281,16 +281,17 @@ cmd_finish() { require_clean_working_tree # update local repo with remote changes first, if asked - if has "$ORIGIN/$BRANCH" "$(git_remote_branches)"; then + if has "$ORIGIN/$BRANCH" $(git_remote_branches); then if flag fetch; then git fetch -q "$ORIGIN" "$BRANCH" + git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" fi fi - if has "$ORIGIN/$BRANCH" "$(git_remote_branches)"; then + if has "$ORIGIN/$BRANCH" $(git_remote_branches); then require_branches_equal "$BRANCH" "$ORIGIN/$BRANCH" fi - if has "$ORIGIN/$DEVELOP_BRANCH" "$(git_remote_branches)"; then + if has "$ORIGIN/$DEVELOP_BRANCH" $(git_remote_branches); then require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" fi diff --git a/git-flow-hotfix b/git-flow-hotfix index 5660131bf..261811317 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -167,7 +167,7 @@ cmd_start() { if flag fetch; then git fetch -q "$ORIGIN" "$MASTER_BRANCH" fi - if has "$ORIGIN/$MASTER_BRANCH" "$(git_remote_branches)"; then + if has "$ORIGIN/$MASTER_BRANCH" $(git_remote_branches); then require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH" fi @@ -213,10 +213,10 @@ cmd_finish() { git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" || \ die "Could not fetch $DEVELOP_BRANCH from $ORIGIN." fi - if has "$ORIGIN/$MASTER_BRANCH" "$(git_remote_branches)"; then + if has "$ORIGIN/$MASTER_BRANCH" $(git_remote_branches); then require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH" fi - if has "$ORIGIN/$DEVELOP_BRANCH" "$(git_remote_branches)"; then + if has "$ORIGIN/$DEVELOP_BRANCH" $(git_remote_branches); then require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" fi diff --git a/git-flow-release b/git-flow-release index 05815bcf0..f81dd9f56 100644 --- a/git-flow-release +++ b/git-flow-release @@ -164,7 +164,7 @@ cmd_start() { if flag fetch; then git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" fi - if has "$ORIGIN/$DEVELOP_BRANCH" "$(git_remote_branches)"; then + if has "$ORIGIN/$DEVELOP_BRANCH" $(git_remote_branches); then require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" fi @@ -211,10 +211,10 @@ cmd_finish() { git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" || \ die "Could not fetch $DEVELOP_BRANCH from $ORIGIN." fi - if has "$ORIGIN/$MASTER_BRANCH" "$(git_remote_branches)"; then + if has "$ORIGIN/$MASTER_BRANCH" $(git_remote_branches); then require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH" fi - if has "$ORIGIN/$DEVELOP_BRANCH" "$(git_remote_branches)"; then + if has "$ORIGIN/$DEVELOP_BRANCH" $(git_remote_branches); then require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH" fi From 207436088c807b8d18ac5664e4f848aac1f539b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20N=C3=A4we?= Date: Fri, 15 Apr 2011 01:42:35 -0700 Subject: [PATCH 103/174] release: start subcommand takes an optional base as well Signed-off-by: Stefan Naewe --- git-flow-release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-release b/git-flow-release index 05815bcf0..4572d810b 100644 --- a/git-flow-release +++ b/git-flow-release @@ -44,7 +44,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 start [-F] []" echo " git flow release finish [-Fsumpk] " echo " git flow release publish " echo " git flow release track " From 2f05c3c8bd68b6101575dcadeeead0a6a532a4db Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sun, 17 Apr 2011 08:13:10 +0200 Subject: [PATCH 104/174] Add Konstantin Tjuterev to the list of contributors. --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 060f09ffe..0c406babb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,5 +11,6 @@ Authors are (ordered by first commit date): - Felipe Talavera - Guillaume-Jean Herbiet - Joseph A. Levin +- Konstantin Tjuterev Portions derived from other open source works are clearly marked. From e024fa451d38d0c78d599adafe332252e8a1c9c3 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sun, 17 Apr 2011 08:33:36 +0200 Subject: [PATCH 105/174] Add Jannis Leidel to the list of contributors. --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 0c406babb..449c69e71 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,6 +11,7 @@ Authors are (ordered by first commit date): - Felipe Talavera - Guillaume-Jean Herbiet - Joseph A. Levin +- Jannis Leidel - Konstantin Tjuterev Portions derived from other open source works are clearly marked. From a7a89cdb13e0022c67fe2cd688708826828a60d6 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sun, 17 Apr 2011 08:41:36 +0200 Subject: [PATCH 106/174] Fix always-empty value for $DOT_GIT_DIR variable. This fixes #53. --- gitflow-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitflow-common b/gitflow-common index 27e7a0631..252f5d0ea 100644 --- a/gitflow-common +++ b/gitflow-common @@ -181,7 +181,7 @@ gitflow_is_initialized() { # loading settings that can be overridden using git config gitflow_load_settings() { - export DOT_GIT_DIR=$(git rev-parse --git-dir >/dev/null 2>&1) + export DOT_GIT_DIR=$(git rev-parse --git-dir 2>/dev/null) export MASTER_BRANCH=$(git config --get gitflow.branch.master) export DEVELOP_BRANCH=$(git config --get gitflow.branch.develop) export ORIGIN=$(git config --get gitflow.origin || echo origin) From fff16edd881fee12547114d37e64d86582a9e392 Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Sat, 23 Apr 2011 13:09:57 -0400 Subject: [PATCH 107/174] Set GITFLOW_DIR correctly if git-flow is a symbolic link This allows a user to create a symbolic link to git-flow in their personal bin directory (e.g. ~/bin) without having to add the source tree to their $PATH or do a system install. --- git-flow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow b/git-flow index fa87e71f4..f30db3210 100755 --- a/git-flow +++ b/git-flow @@ -42,7 +42,7 @@ if [ "$DEBUG" = "yes" ]; then set -x fi -export GITFLOW_DIR=$(dirname "$0") +export GITFLOW_DIR=$(dirname $(readlink "$0")) usage() { echo "usage: git flow " From ca475abb09fc761e06720b15d05f33710a17409c Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Tue, 26 Apr 2011 00:15:01 +0100 Subject: [PATCH 108/174] Add debian/ubuntu packaging. --- .gitignore | 4 ++++ Makefile | 8 +++++++- debian/changelog | 5 +++++ debian/compat | 1 + debian/control | 14 ++++++++++++++ debian/copyright | 40 ++++++++++++++++++++++++++++++++++++++++ debian/docs | 1 + debian/rules | 16 ++++++++++++++++ 8 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100755 debian/rules diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..8d038485f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +debian/files +debian/*.substvars +debian/*.debhelper.log +debian/*/* diff --git a/Makefile b/Makefile index 6f82544fe..764bd23b0 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,13 @@ # those of the authors and should not be interpreted as representing official # policies, either expressed or implied, of Vincent Driessen. # -prefix=/usr/local + +# Determine if we're inside a debian build .. +ifdef DEB_BUILD_ARCH + prefix=$(DESTDIR)/usr/ +else + prefix=/usr/local +endif # files that need mode 755 EXEC_FILES=git-flow diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 000000000..f8895965e --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +gitflow (0.4.1) unstable; urgency=low + + * Initial Debian Packaging + + -- Kiall Mac Innes Mon, 25 Apr 2011 23:51:42 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 000000000..7f8f011eb --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/control b/debian/control new file mode 100644 index 000000000..b80cc4734 --- /dev/null +++ b/debian/control @@ -0,0 +1,14 @@ +Source: gitflow +Section: unknown +Priority: extra +Maintainer: Kiall Mac Innes +Build-Depends: debhelper (>= 7.0.50~), git +Standards-Version: 3.9.1 +Homepage: http://nvie.com/posts/a-successful-git-branching-model/ +Vcs-Git: https://github.com/nvie/gitflow.git +Vcs-Browser: https://github.com/nvie/gitflow + +Package: gitflow +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Git extensions to provide high-level repository operations for Vincent Driessen's branching model diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 000000000..a08359acb --- /dev/null +++ b/debian/copyright @@ -0,0 +1,40 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: gitflow +Source: + +Files: * +Copyright: + +License: BSD-3-Clause + +Files: debian/* +Copyright: 2011 Kiall +License: BSD-3-Clause + +License: BSD-3-Clause + 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. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY 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. + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/debian/docs b/debian/docs new file mode 100644 index 000000000..ceda507c1 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README.mdown diff --git a/debian/rules b/debian/rules new file mode 100755 index 000000000..79092d6be --- /dev/null +++ b/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +override_dh_testdir: + dh_testdir + git submodule init && git submodule update +%: + dh $@ From 6fc1323fff4e477ca68de14dc589fd1385681681 Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Tue, 26 Apr 2011 00:32:22 +0100 Subject: [PATCH 109/174] Fixing some minor mistakes in debian/control metadata - followup to ca475abb09fc761e06720b15d05f33710a17409c --- debian/control | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/control b/debian/control index b80cc4734..d47b2b03d 100644 --- a/debian/control +++ b/debian/control @@ -1,6 +1,6 @@ Source: gitflow -Section: unknown -Priority: extra +Section: vcs +Priority: optional Maintainer: Kiall Mac Innes Build-Depends: debhelper (>= 7.0.50~), git Standards-Version: 3.9.1 @@ -9,6 +9,6 @@ Vcs-Git: https://github.com/nvie/gitflow.git Vcs-Browser: https://github.com/nvie/gitflow Package: gitflow -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends}, git Description: Git extensions to provide high-level repository operations for Vincent Driessen's branching model From 7e583b50a393b988f9dc55bc5a6562fd51e9fbb8 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 26 Apr 2011 14:13:45 +0200 Subject: [PATCH 110/174] Moved the debian stuff to the contrib directory. --- {debian => contrib/debian}/changelog | 0 {debian => contrib/debian}/compat | 0 {debian => contrib/debian}/control | 0 {debian => contrib/debian}/copyright | 0 {debian => contrib/debian}/docs | 0 {debian => contrib/debian}/rules | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename {debian => contrib/debian}/changelog (100%) rename {debian => contrib/debian}/compat (100%) rename {debian => contrib/debian}/control (100%) rename {debian => contrib/debian}/copyright (100%) rename {debian => contrib/debian}/docs (100%) rename {debian => contrib/debian}/rules (100%) diff --git a/debian/changelog b/contrib/debian/changelog similarity index 100% rename from debian/changelog rename to contrib/debian/changelog diff --git a/debian/compat b/contrib/debian/compat similarity index 100% rename from debian/compat rename to contrib/debian/compat diff --git a/debian/control b/contrib/debian/control similarity index 100% rename from debian/control rename to contrib/debian/control diff --git a/debian/copyright b/contrib/debian/copyright similarity index 100% rename from debian/copyright rename to contrib/debian/copyright diff --git a/debian/docs b/contrib/debian/docs similarity index 100% rename from debian/docs rename to contrib/debian/docs diff --git a/debian/rules b/contrib/debian/rules similarity index 100% rename from debian/rules rename to contrib/debian/rules From d7629954765d813be4ec02920adceaec0ea4fe7a Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 26 Apr 2011 14:14:30 +0200 Subject: [PATCH 111/174] Add Kiall Mac Innes to the list of contributors. Thanks Kiall for the Debian package files! --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 449c69e71..a613b4a99 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,5 +13,6 @@ Authors are (ordered by first commit date): - Joseph A. Levin - Jannis Leidel - Konstantin Tjuterev +- Kiall Mac Innes Portions derived from other open source works are clearly marked. From f9ace1f6f504c2e96609b16e498e1ba55fd0fac9 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 26 Apr 2011 14:59:09 +0200 Subject: [PATCH 112/174] Add Jon Bernard to the list of contributors. --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index a613b4a99..69e9b1355 100644 --- a/AUTHORS +++ b/AUTHORS @@ -14,5 +14,6 @@ Authors are (ordered by first commit date): - Jannis Leidel - Konstantin Tjuterev - Kiall Mac Innes +- Jon Bernard Portions derived from other open source works are clearly marked. From 3626bfb2edf028ce8384d98063784b9837df309b Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Wed, 27 Apr 2011 10:21:56 +0200 Subject: [PATCH 113/174] Revert "Set GITFLOW_DIR correctly if git-flow is a symbolic link" This reverts commit fff16edd881fee12547114d37e64d86582a9e392. --- git-flow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow b/git-flow index f30db3210..fa87e71f4 100755 --- a/git-flow +++ b/git-flow @@ -42,7 +42,7 @@ if [ "$DEBUG" = "yes" ]; then set -x fi -export GITFLOW_DIR=$(dirname $(readlink "$0")) +export GITFLOW_DIR=$(dirname "$0") usage() { echo "usage: git flow " From b7fc8868f92c64773ed71696fd30bb03ead43fbb Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 10 May 2011 13:36:12 +0200 Subject: [PATCH 114/174] =?UTF-8?q?Add=20Olivier=20Mengu=C3=A9=20to=20the?= =?UTF-8?q?=20list=20of=20contributors.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks for the MSysGit installer! --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 69e9b1355..d4e7490e4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -15,5 +15,6 @@ Authors are (ordered by first commit date): - Konstantin Tjuterev - Kiall Mac Innes - Jon Bernard +- Olivier Mengué Portions derived from other open source works are clearly marked. From c4b4b3c286c834d6c306b7fe54dc365b27635bb4 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 16 May 2011 10:44:13 +0200 Subject: [PATCH 115/174] Make room for new minor release (and update the changelog). --- Changes.mdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Changes.mdown b/Changes.mdown index 72c04bc7f..80139a0b6 100644 --- a/Changes.mdown +++ b/Changes.mdown @@ -1,3 +1,9 @@ +0.4.2: +----- +Release date: **not yet** + +* Various minor bug fixes related to internal argument passing + 0.4.1: ----- Release date: **2011/02/04** From cf5b2a5562767ac80ce1e9e103c5e460dd0dabce Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 16 May 2011 10:37:16 +0200 Subject: [PATCH 116/174] Implement git flow feature finish without a branch name to finish the current branch, if any. This fixes #127. --- git-flow-feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-feature b/git-flow-feature index ebbb03574..2133330d4 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 parse_args "$@" - expand_nameprefix_arg + expand_nameprefix_arg_or_current # sanity checks require_branch "$BRANCH" From 59e6aefa1088b21d239e3a4c8f25946bc466f11a Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 16 May 2011 11:04:42 +0200 Subject: [PATCH 117/174] Update usage docs and changelog. --- Changes.mdown | 3 +++ git-flow-feature | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changes.mdown b/Changes.mdown index 80139a0b6..76fad8689 100644 --- a/Changes.mdown +++ b/Changes.mdown @@ -2,6 +2,9 @@ ----- Release date: **not yet** +* `git flow feature finish` can now be called without a feature branch + name(prefix) argument and will finish the current branch, if on any. + * Various minor bug fixes related to internal argument passing 0.4.1: diff --git a/git-flow-feature b/git-flow-feature index 2133330d4..9da4b0bfa 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 [-rFk] " + echo " git flow feature finish [-rFk] []" echo " git flow feature publish " echo " git flow feature track " echo " git flow feature diff []" From 8b73fed62f749d5d817132c43d5d2a9a4103b753 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 16 May 2011 11:09:18 +0200 Subject: [PATCH 118/174] Update the changelog. --- Changes.mdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changes.mdown b/Changes.mdown index 76fad8689..53858b6b1 100644 --- a/Changes.mdown +++ b/Changes.mdown @@ -7,6 +7,8 @@ Release date: **not yet** * Various minor bug fixes related to internal argument passing +* Add package installers for the Debian and Windows platforms. + 0.4.1: ----- Release date: **2011/02/04** From 14bcc58e6843260393afff7214f2cd26cd0418e6 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 23 May 2011 13:02:21 +0200 Subject: [PATCH 119/174] Update the version number to distinguish HEAD from the released 0.4.1 version. --- git-flow-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-version b/git-flow-version index 51fd67136..8c314996c 100644 --- a/git-flow-version +++ b/git-flow-version @@ -36,7 +36,7 @@ # policies, either expressed or implied, of Vincent Driessen. # -GITFLOW_VERSION=0.4.1 +GITFLOW_VERSION=0.4.2-pre usage() { echo "usage: git flow version" From 26293bb3a90f4173b460eb396335987872637c9f Mon Sep 17 00:00:00 2001 From: Tacit Sawk Date: Tue, 14 Jun 2011 10:51:43 +1000 Subject: [PATCH 120/174] This script depends on Bash-only features, and so should not be executed with sh. --- README.mdown | 4 ++-- contrib/gitflow-installer.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.mdown b/README.mdown index 16ac66285..9b2b96910 100644 --- a/README.mdown +++ b/README.mdown @@ -34,7 +34,7 @@ If you're on a Mac and use [MacPorts](http://macports.org/), it's simple: Another easy way to install git-flow is using Rick Osborne's excellent git-flow installer, which can be run using the following command: - $ wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh + $ wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo bash ### Windows @@ -46,7 +46,7 @@ For Windows users who wish to use the automated install, it is suggested that yo first to install tools like `git`, `util-linux` and `wget` (with those three being packages that can be selected during installation). Then simply run this command from a Cygwin shell: - $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh + $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | bash #### Using [msysgit](http://code.google.com/p/msysgit/) Download and install `getopt.exe` from the [util-linux package](http://gnuwin32.sourceforge.net/packages/util-linux-ng.htm) into `C:\Program Files\Git\bin`. (Only `getopt.exe`, the others util-linux files are not used). diff --git a/contrib/gitflow-installer.sh b/contrib/gitflow-installer.sh index 33dbe583c..bb803f4c1 100644 --- a/contrib/gitflow-installer.sh +++ b/contrib/gitflow-installer.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # git-flow make-less installer for *nix systems, by Rick Osborne # Based on the git-flow core Makefile: From 06e854ab1257c87f52632d367cc85345cddb863f Mon Sep 17 00:00:00 2001 From: "Gruen Christian-Rolf (Kiki)" Date: Wed, 6 Jul 2011 18:07:01 +0300 Subject: [PATCH 121/174] Fix parsing for Bourne shell (FreeBSD) --- git-flow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow b/git-flow index fa87e71f4..97b1b34bb 100755 --- a/git-flow +++ b/git-flow @@ -94,7 +94,7 @@ main() { # in that case, we interpret this arg as a flag for the default # command SUBACTION="default" - if [ "$1" != "" ] && ! echo "$1" | grep -q "^-"; then + if [ "$1" != "" ] && { ! echo "$1" | grep -q "^-"; } then SUBACTION="$1"; shift fi if ! type "cmd_$SUBACTION" >/dev/null 2>&1; then From e73a1d95d176b695ca39cb02bd4873248a3ce8fb Mon Sep 17 00:00:00 2001 From: Mark Borcherding Date: Fri, 8 Jul 2011 11:29:10 -0500 Subject: [PATCH 122/174] Adding windows install step for libintl3.dll I found I also needed to install this file. It was mentioned in issue #109. Adding this step to the instruction might help others avoid this same problem. --- README.mdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index 9b2b96910..b3e1df31b 100644 --- a/README.mdown +++ b/README.mdown @@ -49,7 +49,7 @@ during installation). Then simply run this command from a Cygwin shell: $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | bash #### Using [msysgit](http://code.google.com/p/msysgit/) -Download and install `getopt.exe` from the [util-linux package](http://gnuwin32.sourceforge.net/packages/util-linux-ng.htm) into `C:\Program Files\Git\bin`. (Only `getopt.exe`, the others util-linux files are not used). +Download and install `getopt.exe` from the [util-linux package](http://gnuwin32.sourceforge.net/packages/util-linux-ng.htm) into `C:\Program Files\Git\bin`. (Only `getopt.exe`, the others util-linux files are not used). Also install `libintl3.dll` from the Dependencies package, into the same directory. Clone the git-flow sources from GitHub: From 0c3206201ad720a11131188399a22c93b0a44974 Mon Sep 17 00:00:00 2001 From: James Moran Date: Tue, 26 Jul 2011 10:39:35 -0400 Subject: [PATCH 123/174] fixed malformed if statement --- 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 bb803f4c1..0e92ffcef 100644 --- a/contrib/gitflow-installer.sh +++ b/contrib/gitflow-installer.sh @@ -50,7 +50,7 @@ case "$1" in ;; *) echo "Installing git-flow to $INSTALL_PREFIX" - if [[ -d "$REPO_NAME" && -d "$REPO_NAME/.git" ]] ; then + if [ -d "$REPO_NAME" -a -d "$REPO_NAME/.git" ] ; then echo "Using existing repo: $REPO_NAME" else echo "Cloning repo from GitHub to $REPO_NAME" From 1b454cc0cfca72e8d67882fa46f56d8d6d611603 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 25 Aug 2011 09:24:55 +0200 Subject: [PATCH 124/174] Replace contrib/debian/ with a note on how to install on Debian. Since gitflow is packaged for Debian and is available for testing and sid already, remove the contrib/ directory in favour of using the official Debian package. Also mention how to install gitflow on Debian in the README.mdown. Furthermore, Debian-specific things were removed from Changes.mdown and the Makefile. Signed-off-by: Gergely Nagy --- Changes.mdown | 2 +- Makefile | 7 +------ README.mdown | 10 ++++++++++ contrib/debian/changelog | 5 ----- contrib/debian/compat | 1 - contrib/debian/control | 14 -------------- contrib/debian/copyright | 40 ---------------------------------------- contrib/debian/docs | 1 - contrib/debian/rules | 16 ---------------- 9 files changed, 12 insertions(+), 84 deletions(-) delete mode 100644 contrib/debian/changelog delete mode 100644 contrib/debian/compat delete mode 100644 contrib/debian/control delete mode 100644 contrib/debian/copyright delete mode 100644 contrib/debian/docs delete mode 100755 contrib/debian/rules diff --git a/Changes.mdown b/Changes.mdown index 53858b6b1..f38f90b00 100644 --- a/Changes.mdown +++ b/Changes.mdown @@ -7,7 +7,7 @@ Release date: **not yet** * Various minor bug fixes related to internal argument passing -* Add package installers for the Debian and Windows platforms. +* Add package installers for the Windows platform. 0.4.1: ----- diff --git a/Makefile b/Makefile index 764bd23b0..fbbfd2c00 100644 --- a/Makefile +++ b/Makefile @@ -27,12 +27,7 @@ # policies, either expressed or implied, of Vincent Driessen. # -# Determine if we're inside a debian build .. -ifdef DEB_BUILD_ARCH - prefix=$(DESTDIR)/usr/ -else - prefix=/usr/local -endif +prefix=/usr/local # files that need mode 755 EXEC_FILES=git-flow diff --git a/README.mdown b/README.mdown index b3e1df31b..aa9a6a25f 100644 --- a/README.mdown +++ b/README.mdown @@ -36,6 +36,16 @@ installer, which can be run using the following command: $ wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo bash +#### Debian + +Users of Debian testing and unstable can use the apt-get tool to +install gitflow from the Debian repository: + + $ apt-get install git-flow + +For Debian stable, one can either use the git flow installer, or the +Debian package from unstable (it works just fine on stable too). + ### Windows For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good diff --git a/contrib/debian/changelog b/contrib/debian/changelog deleted file mode 100644 index f8895965e..000000000 --- a/contrib/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -gitflow (0.4.1) unstable; urgency=low - - * Initial Debian Packaging - - -- Kiall Mac Innes Mon, 25 Apr 2011 23:51:42 +0100 diff --git a/contrib/debian/compat b/contrib/debian/compat deleted file mode 100644 index 7f8f011eb..000000000 --- a/contrib/debian/compat +++ /dev/null @@ -1 +0,0 @@ -7 diff --git a/contrib/debian/control b/contrib/debian/control deleted file mode 100644 index d47b2b03d..000000000 --- a/contrib/debian/control +++ /dev/null @@ -1,14 +0,0 @@ -Source: gitflow -Section: vcs -Priority: optional -Maintainer: Kiall Mac Innes -Build-Depends: debhelper (>= 7.0.50~), git -Standards-Version: 3.9.1 -Homepage: http://nvie.com/posts/a-successful-git-branching-model/ -Vcs-Git: https://github.com/nvie/gitflow.git -Vcs-Browser: https://github.com/nvie/gitflow - -Package: gitflow -Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, git -Description: Git extensions to provide high-level repository operations for Vincent Driessen's branching model diff --git a/contrib/debian/copyright b/contrib/debian/copyright deleted file mode 100644 index a08359acb..000000000 --- a/contrib/debian/copyright +++ /dev/null @@ -1,40 +0,0 @@ -Format: http://dep.debian.net/deps/dep5 -Upstream-Name: gitflow -Source: - -Files: * -Copyright: - -License: BSD-3-Clause - -Files: debian/* -Copyright: 2011 Kiall -License: BSD-3-Clause - -License: BSD-3-Clause - 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. - 3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - . - THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY 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. - -# Please also look if there are files or directories which have a -# different copyright/license attached and list them here. diff --git a/contrib/debian/docs b/contrib/debian/docs deleted file mode 100644 index ceda507c1..000000000 --- a/contrib/debian/docs +++ /dev/null @@ -1 +0,0 @@ -README.mdown diff --git a/contrib/debian/rules b/contrib/debian/rules deleted file mode 100755 index 79092d6be..000000000 --- a/contrib/debian/rules +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -override_dh_testdir: - dh_testdir - git submodule init && git submodule update -%: - dh $@ From 05c4dbc8a8a8a1a78de12ee0b6ea1d3710fb05bf Mon Sep 17 00:00:00 2001 From: Randy Merrill Date: Thu, 13 Oct 2011 20:28:10 -0700 Subject: [PATCH 125/174] Adding the `eval` to force variable expansion. Closes #50 --- git-flow-release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-release b/git-flow-release index 08f595b2f..bb39d5276 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'" - git tag $opts "$tagname" || \ + eval git tag $opts "$tagname" || \ die "Tagging failed. Please run finish again to retry." fi fi From d0df88da6968c39e5c0422a5634060f559081d26 Mon Sep 17 00:00:00 2001 From: Randy Merrill Date: Thu, 13 Oct 2011 21:09:26 -0700 Subject: [PATCH 126/174] Adding the variable expansion to the hotfix. --- git-flow-hotfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow-hotfix b/git-flow-hotfix index 261811317..5c079078c 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -241,7 +241,7 @@ cmd_finish() { flag sign && opts="$opts -s" [ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'" [ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'" - git tag $opts "$VERSION_PREFIX$VERSION" || \ + eval git tag $opts "$VERSION_PREFIX$VERSION" || \ die "Tagging failed. Please run finish again to retry." fi fi From 9c5c806cf97cc44db39d4536358ad1288294023c Mon Sep 17 00:00:00 2001 From: Chad Walker Date: Tue, 25 Oct 2011 15:42:32 -0700 Subject: [PATCH 127/174] added a -D flag to the git flow finish command to try extra hard to delete the local branch after finishing the feature --- git-flow-feature | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index 9da4b0bfa..48fb74d43 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 [-rFk] []" + echo " git flow feature finish [-rFkD] []" echo " git flow feature publish " echo " git flow feature track " echo " git flow feature diff []" @@ -231,6 +231,7 @@ cmd_finish() { DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F DEFINE_boolean rebase false "rebase instead of merge" r DEFINE_boolean keep false "keep branch after performing finish" k + DEFINE_boolean hard_delete false "try extra hard to delete the branch after performing finish" D parse_args "$@" expand_nameprefix_arg_or_current @@ -346,7 +347,11 @@ helper_finish_cleanup() { if noflag keep; then - git branch -d "$BRANCH" + if flag hard_delete; then + git branch -D "$BRANCH" + else + git branch -d "$BRANCH" + fi fi echo From 0b324def488f2e73e0db6109e440974f3aab265f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Schr=C3=B6der?= Date: Sat, 12 Nov 2011 17:36:36 +0100 Subject: [PATCH 128/174] add publishing to hotfix --- git-flow-hotfix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/git-flow-hotfix b/git-flow-hotfix index 261811317..0a7727261 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -46,6 +46,7 @@ usage() { echo "usage: git flow hotfix [list] [-v]" echo " git flow hotfix start [-F] []" echo " git flow hotfix finish [-Fsumpk] " + echo " git flow hotfix publish " } cmd_default() { @@ -188,6 +189,33 @@ cmd_start() { echo } +cmd_publish() { + parse_args "$@" + require_version_arg + + # sanity checks + require_clean_working_tree + require_branch "$BRANCH" + git fetch -q "$ORIGIN" + require_branch_absent "$ORIGIN/$BRANCH" + + # create remote branch + git push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH" + git fetch -q "$ORIGIN" + + # configure remote tracking + git config "branch.$BRANCH.remote" "$ORIGIN" + git config "branch.$BRANCH.merge" "refs/heads/$BRANCH" + git checkout "$BRANCH" + + echo + echo "Summary of actions:" + echo "- A new remote branch '$BRANCH' was created" + echo "- The local branch '$BRANCH' was configured to track the remote branch" + 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 4895c15e440b85ab8b53c4ff9cd4e715211f778d Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Wed, 23 Nov 2011 20:36:16 +0100 Subject: [PATCH 129/174] Fix wording. --- git-flow-feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index 48fb74d43..726b4aed5 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -231,7 +231,7 @@ cmd_finish() { DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F DEFINE_boolean rebase false "rebase instead of merge" r DEFINE_boolean keep false "keep branch after performing finish" k - DEFINE_boolean hard_delete false "try extra hard to delete the branch after performing finish" D + DEFINE_boolean force_delete false "force delete feature branch after finish" D parse_args "$@" expand_nameprefix_arg_or_current @@ -347,7 +347,7 @@ helper_finish_cleanup() { if noflag keep; then - if flag hard_delete; then + if flag force_delete; then git branch -D "$BRANCH" else git branch -d "$BRANCH" From 766159d3039bd4f693c15bbb57c7d748e88b6c2c Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 24 Nov 2011 13:02:00 +0100 Subject: [PATCH 130/174] Add a cool new video tutorial on git-flow by Build a Module. --- README.mdown | 1 + 1 file changed, 1 insertion(+) diff --git a/README.mdown b/README.mdown index b3e1df31b..f8d48b316 100644 --- a/README.mdown +++ b/README.mdown @@ -14,6 +14,7 @@ Kreeftmeijer's blog post: Or have a look at one of these screen casts: +* [How to use a scalable Git branching model called git-flow](http://buildamodule.com/video/change-management-and-version-control-deploying-releases-features-and-fixes-with-git-how-to-use-a-scalable-git-branching-model-called-gitflow) (by Build a Module) * [A short introduction to git-flow](http://vimeo.com/16018419) (by Mark Derricutt) * [On the path with git-flow](http://codesherpas.com/screencasts/on_the_path_gitflow.mov) (by Dave Bock) From 62c339eba9441dc519f83daa2ce96c243ae89730 Mon Sep 17 00:00:00 2001 From: Emre Berge Ergenekon Date: Sun, 27 Nov 2011 22:07:57 -0800 Subject: [PATCH 131/174] develop_branch uses origin/develop_branch as start-point if one exists. By default a local develop branch is created of from master regardless if a origin/develop exits. This problem is discussed in issues #137 and #23. --- git-flow-init | 6 +++++- gitflow-common | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/git-flow-init b/git-flow-init index 57ab2441e..d19b65134 100644 --- a/git-flow-init +++ b/git-flow-init @@ -200,7 +200,11 @@ cmd_default() { # default production branch and develop was "created". We should create # the develop branch now in that case (we base it on master, of course) if ! git_local_branch_exists "$develop_branch"; then - git branch --no-track "$develop_branch" "$master_branch" + if git_remote_branch_exists "origin/$develop_branch"; then + git branch "$develop_branch" "origin/$develop_branch" >/dev/null 2>&1 + else + git branch --no-track "$develop_branch" "$master_branch" + fi created_gitflow_branch=1 fi diff --git a/gitflow-common b/gitflow-common index 252f5d0ea..fb515de83 100644 --- a/gitflow-common +++ b/gitflow-common @@ -97,6 +97,10 @@ git_local_branch_exists() { has $1 $(git_local_branches) } +git_remote_branch_exists() { + has $1 $(git_remote_branches) +} + git_branch_exists() { has $1 $(git_all_branches) } From 0d00b698f2567737137fcac464d146a78ee7af0c Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 28 Nov 2011 09:43:57 +0100 Subject: [PATCH 132/174] Add Changelog note and added Emre to list of contributors. --- AUTHORS | 1 + Changes.mdown | 3 +++ 2 files changed, 4 insertions(+) diff --git a/AUTHORS b/AUTHORS index d4e7490e4..3541d3bda 100644 --- a/AUTHORS +++ b/AUTHORS @@ -16,5 +16,6 @@ Authors are (ordered by first commit date): - Kiall Mac Innes - Jon Bernard - Olivier Mengué +- Emre Berge Ergenekon Portions derived from other open source works are clearly marked. diff --git a/Changes.mdown b/Changes.mdown index 53858b6b1..71c49450d 100644 --- a/Changes.mdown +++ b/Changes.mdown @@ -2,6 +2,9 @@ ----- Release date: **not yet** +* `git flow init` now detects situations where origin already has gitflow + branches set up, and behaves accordingly (thanks Emre Berge Ergenekon) + * `git flow feature finish` can now be called without a feature branch name(prefix) argument and will finish the current branch, if on any. From baf163e07d579bec3dd0e21d00297832e8848b8b Mon Sep 17 00:00:00 2001 From: "Eric J. Holmes" Date: Mon, 28 Nov 2011 23:28:47 -0800 Subject: [PATCH 133/174] Check if a remote master branch exists before die, track it if no local master branch exists --- git-flow-init | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/git-flow-init b/git-flow-init index d19b65134..4afa1c25e 100644 --- a/git-flow-init +++ b/git-flow-init @@ -117,8 +117,14 @@ cmd_default() { # check existence in case of an already existing repo if [ "$should_check_existence" = "YES" ]; then - git_local_branch_exists "$master_branch" || \ + # if no local branch exists and a remote branch of the same + # 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 + 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 From 938ea5f07485118efbf5da60239af73f4f9308a7 Mon Sep 17 00:00:00 2001 From: Eric Holmes Date: Tue, 29 Nov 2011 00:14:30 -0800 Subject: [PATCH 134/174] Add information for contributing. --- README.mdown | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.mdown b/README.mdown index f8d48b316..4dfa33513 100644 --- a/README.mdown +++ b/README.mdown @@ -116,6 +116,16 @@ 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. +* `git clone git@github.com:/gitflow.git` +* `git branch master origin/master` +* `git flow init -d` +* `git flow feature start ` +* Do work and commit your changes. (**hint**: ``export PATH=`pwd`:$PATH`` from within the gitflow directory helps) +* `git flow feature publish ` +* Open a pull request to your feature branch. License terms ------------- From ba0cc8a70f5ab58089b751d1140809f2e28099e9 Mon Sep 17 00:00:00 2001 From: Eric Holmes Date: Tue, 29 Nov 2011 00:23:15 -0800 Subject: [PATCH 135/174] Add --recursive. --- README.mdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index 4dfa33513..3d277ff46 100644 --- a/README.mdown +++ b/README.mdown @@ -119,7 +119,7 @@ Any questions, tips, or general discussion can be posted to our Google group: Contributing ------------ * Fork the repository. -* `git clone git@github.com:/gitflow.git` +* `git clone --recursive git@github.com:/gitflow.git` * `git branch master origin/master` * `git flow init -d` * `git flow feature start ` From 921ddf56e293584309753d2246d045bb1c91671c Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 29 Nov 2011 11:31:18 +0100 Subject: [PATCH 136/174] Add Eric Holmes to list of contributors. --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 3541d3bda..1c297540b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,5 +17,6 @@ Authors are (ordered by first commit date): - Jon Bernard - Olivier Mengué - Emre Berge Ergenekon +- Eric Holmes Portions derived from other open source works are clearly marked. From 49305ec93d8c1bdf897df8a8e9ccee92f0d3d23d Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Wed, 30 Nov 2011 22:14:40 +0100 Subject: [PATCH 137/174] Rewrote Eric's text a bit. --- README.mdown | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/README.mdown b/README.mdown index 3d277ff46..eb619be28 100644 --- a/README.mdown +++ b/README.mdown @@ -118,14 +118,21 @@ Any questions, tips, or general discussion can be posted to our Google group: Contributing ------------ -* Fork the repository. -* `git clone --recursive git@github.com:/gitflow.git` -* `git branch master origin/master` -* `git flow init -d` -* `git flow feature start ` -* Do work and commit your changes. (**hint**: ``export PATH=`pwd`:$PATH`` from within the gitflow directory helps) -* `git flow feature publish ` -* Open a pull request to your feature branch. +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 ------------- From 4b9545e5822d3dee65a673e81b80328df7bb151e Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Wed, 30 Nov 2011 22:52:20 +0100 Subject: [PATCH 138/174] Add a proposal for our Windows users. Will this help you guys out? --- git-flow | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git-flow b/git-flow index 97b1b34bb..004aa2eee 100755 --- a/git-flow +++ b/git-flow @@ -42,7 +42,9 @@ if [ "$DEBUG" = "yes" ]; then set -x fi -export GITFLOW_DIR=$(dirname "$0") +# The sed expression here replaces all backslashes by forward slashes. +# This helps our Windows users, while not bothering our Unix users. +export GITFLOW_DIR=$(dirname $(echo "$0" | sed -e 's,\\,/,g')) usage() { echo "usage: git flow " From 5e8cc9fceb509848dee2cd62e98aadc29ffa146b Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 1 Dec 2011 08:52:33 +0100 Subject: [PATCH 139/174] Oops, forgot about spaces in the dirname. Quite likely for Windows users to hit this problem. --- git-flow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-flow b/git-flow index 004aa2eee..a03ba1fd3 100755 --- a/git-flow +++ b/git-flow @@ -44,7 +44,7 @@ fi # The sed expression here replaces all backslashes by forward slashes. # This helps our Windows users, while not bothering our Unix users. -export GITFLOW_DIR=$(dirname $(echo "$0" | sed -e 's,\\,/,g')) +export GITFLOW_DIR=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") usage() { echo "usage: git flow " From 083a588d4fba8ea4a5a0f6b529cb47c9f0be47e0 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 1 Dec 2011 08:56:59 +0100 Subject: [PATCH 140/174] Better support for the Windows platform, where backslashes are dominant. --- Changes.mdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changes.mdown b/Changes.mdown index 71c49450d..4e3936971 100644 --- a/Changes.mdown +++ b/Changes.mdown @@ -10,6 +10,8 @@ Release date: **not yet** * Various minor bug fixes related to internal argument passing +* Better support for Windows users. + * Add package installers for the Debian and Windows platforms. 0.4.1: From e856e0a528daaf212f1b74696f6ef730beed856f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 6 Dec 2011 08:46:01 +0100 Subject: [PATCH 141/174] fixed the installer in msysgit environment to work with windows XP as the command 'choice' is not available on Windows XP we have to work around this issue by usage of 'set /p' --- contrib/msysgit-install.cmd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/msysgit-install.cmd b/contrib/msysgit-install.cmd index 12858397d..5f005bfa7 100644 --- a/contrib/msysgit-install.cmd +++ b/contrib/msysgit-install.cmd @@ -22,11 +22,11 @@ echo getopt.exe... Found if not exist "%GIT_HOME%\bin\git-flow" goto :Install echo GitFlow is already installed.>&2 -choice /C YN /M "Do you want to replace it" -if errorlevel 255 goto :Abort -if errorlevel 2 goto :Abort -if not errorlevel 1 goto :Abort +set /p mychoice="Do you want to replace it [y/n]" +if "%mychoice%"=="y" goto :DeleteOldFiles +goto :Abort +:DeleteOldFiles echo Deleting old files... for /F %%i in ("%GIT_HOME%\git-flow*" "%GIT_HOME%\gitflow-*") do if exist "%%~fi" del /F /Q "%%~fi" From c02c12dd760be6b405bcbcb45e0f71450d9a7d9e Mon Sep 17 00:00:00 2001 From: Alexander Zeitler Date: Tue, 6 Dec 2011 21:38:04 +0100 Subject: [PATCH 142/174] Updated Cygwin section with possibly missing package. --- README.mdown | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.mdown b/README.mdown index eb619be28..5bab435ae 100644 --- a/README.mdown +++ b/README.mdown @@ -49,6 +49,13 @@ during installation). Then simply run this command from a Cygwin shell: $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | bash +If you get the error "flags: FATAL unable to determine getopt version" error after + + $ git flow init + +you need to install the util-linux package using the Cygwin setup. + + #### Using [msysgit](http://code.google.com/p/msysgit/) Download and install `getopt.exe` from the [util-linux package](http://gnuwin32.sourceforge.net/packages/util-linux-ng.htm) into `C:\Program Files\Git\bin`. (Only `getopt.exe`, the others util-linux files are not used). Also install `libintl3.dll` from the Dependencies package, into the same directory. From 07dacd5212c98c2e12f583a2acfb365eeb784f8b Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 6 Dec 2011 22:12:54 +0100 Subject: [PATCH 143/174] Moved all installation instructions to the Wiki. There were becoming so large they were muddling the README. --- README.mdown | 73 +--------------------------------------------------- 1 file changed, 1 insertion(+), 72 deletions(-) diff --git a/README.mdown b/README.mdown index 5bab435ae..70d944d99 100644 --- a/README.mdown +++ b/README.mdown @@ -21,78 +21,7 @@ Or have a look at one of these screen casts: Installing git-flow ------------------- - -### Mac OS -If you're on a Mac and use [homebrew](http://github.com/mxcl/homebrew), it's simple: - - $ brew install git-flow - -If you're on a Mac and use [MacPorts](http://macports.org/), it's simple: - - $ port install git-flow - -### Linux, etc. -Another easy way to install git-flow is using Rick Osborne's excellent git-flow -installer, which can be run using the following command: - - $ wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo bash - -### Windows - -For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good -starting place for installing git. - -#### Using Cygwin -For Windows users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/) -first to install tools like `git`, `util-linux` and `wget` (with those three being packages that can be selected -during installation). Then simply run this command from a Cygwin shell: - - $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | bash - -If you get the error "flags: FATAL unable to determine getopt version" error after - - $ git flow init - -you need to install the util-linux package using the Cygwin setup. - - -#### Using [msysgit](http://code.google.com/p/msysgit/) -Download and install `getopt.exe` from the [util-linux package](http://gnuwin32.sourceforge.net/packages/util-linux-ng.htm) into `C:\Program Files\Git\bin`. (Only `getopt.exe`, the others util-linux files are not used). Also install `libintl3.dll` from the Dependencies package, into the same directory. - -Clone the git-flow sources from GitHub: - - $ git clone --recursive git://github.com/nvie/gitflow.git - $ cd gitflow - -Run the `msysgit-install` script from a command-line prompt (you may have to -run it with "Full Administrator" rights if you installed msysgit with its -installer): - - C:\gitflow> contrib\msysgit-install.cmd - -### Manual installation -If you prefer a manual installation, please use the following instructions: - - $ git clone --recursive git://github.com/nvie/gitflow.git - -Then, you can install `git-flow`, using: - - $ sudo make install - -By default, git-flow will be installed in /usr/local. To change the prefix -where git-flow will be installed, simply specify it explicitly, using: - - $ sudo make prefix=/opt/local install - -Or simply point your `PATH` environment variable to your git-flow checkout -directory. - -*Installation note:* -git-flow depends on the availability of the command line utility `getopt`, -which may not be available in your Unix/Linux environment. Please use your -favorite package manager to install `getopt`. For Cygwin, install the -`util-linux` package to get `getopt`. If you use `apt-get` as your install -manager, the package name is `opt`. +See the Wiki for up-to-date [Installation Instructions](https://github.com/nvie/gitflow/wiki/Installation). Integration with your shell From 5a586336158de625ed9bc9541465b5643f9805d5 Mon Sep 17 00:00:00 2001 From: Lorin Hochstein Date: Tue, 20 Dec 2011 10:17:54 -0500 Subject: [PATCH 144/174] Documented init -d flag and publish/pull Documented the -d flag for init command Added docs for feature push and feature pull --- README.mdown | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index 70d944d99..dc4e1046f 100644 --- a/README.mdown +++ b/README.mdown @@ -83,13 +83,15 @@ in a Github fork, of course. To initialize a new repo with the basic branch structure, use: - git flow init + git flow init [-d] This will then interactively prompt you with some questions on which branches you would like to use as development and production branches, and how you would like your prefixes be named. You may simply press Return on any of those questions to accept the (sane) default suggestions. +The ``-d`` flag will accept all defaults. + ### Creating feature/release/hotfix/support branches @@ -101,6 +103,11 @@ those questions to accept the (sane) default suggestions. For feature branches, the `` arg must be a commit on `develop`. +* To push/pull a feature branch to the remote repository, use: + + git flow feature publish + git flow feature pull + * To list/start/finish release branches, use: git flow release From 905cfb1e38e39e12eb9070f94914bcb8d9506e00 Mon Sep 17 00:00:00 2001 From: Lorin Hochstein Date: Tue, 20 Dec 2011 10:21:46 -0500 Subject: [PATCH 145/174] whitespace --- README.mdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index dc4e1046f..45b896543 100644 --- a/README.mdown +++ b/README.mdown @@ -106,7 +106,7 @@ The ``-d`` flag will accept all defaults. * To push/pull a feature branch to the remote repository, use: git flow feature publish - git flow feature pull + git flow feature pull * To list/start/finish release branches, use: From 6158d5163fc032632d942dd7520090e5d82e498d Mon Sep 17 00:00:00 2001 From: Vedang Manerikar Date: Mon, 30 Jan 2012 18:38:46 +0530 Subject: [PATCH 146/174] 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 147/174] 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 afbf92c6208184f78b4209cd75679d6e25db70c9 Mon Sep 17 00:00:00 2001 From: Randy Merrill Date: Wed, 8 Feb 2012 09:33:04 -0800 Subject: [PATCH 148/174] Updating the escape characters to fix an issue with having a + in the branch name. Since git allows for it the escape should not escape it since it then won't match the branch names correctly. --- gitflow-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitflow-common b/gitflow-common index fb515de83..4834cf102 100644 --- a/gitflow-common +++ b/gitflow-common @@ -45,7 +45,7 @@ warn() { echo "$@" >&2; } die() { warn "$@"; exit 1; } escape() { - echo "$1" | sed 's/\([\.\+\$\*]\)/\\\1/g' + echo "$1" | sed 's/\([\.\$\*]\)/\\\1/g' } # set logic From 56bff9a830faca63a9d916a43034562b3b34f734 Mon Sep 17 00:00:00 2001 From: Vedang Manerikar Date: Mon, 30 Jan 2012 18:38:46 +0530 Subject: [PATCH 149/174] Added a -r flag to git-flow-feature-pull to support pull with rebase Signed-off-by: Vincent Driessen --- 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 7384052ee61b4aa25bad65e20615b9a7502e5998 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 13 Feb 2012 20:43:12 +0100 Subject: [PATCH 150/174] Fix indenting. --- git-flow-feature | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/git-flow-feature b/git-flow-feature index d653ec11f..e97d67825 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -475,7 +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 + DEFINE_boolean rebase false "pull with rebase" r parse_remote_name "$@" if [ -z "$REMOTE" ]; then @@ -501,14 +501,14 @@ 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 - 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 + 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 + it pull -q "$REMOTE" "$BRANCH" || die "Failed to pull from remote '$REMOTE'." + fi echo "Pulled $REMOTE's changes into $BRANCH." else From 53cfc35147096c5d5a43f8570b59a4b5b0aa7cf5 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 13 Feb 2012 20:48:14 +0100 Subject: [PATCH 151/174] Add Vedang to AUTHORS. --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 1c297540b..f7d1e6638 100644 --- a/AUTHORS +++ b/AUTHORS @@ -18,5 +18,6 @@ Authors are (ordered by first commit date): - Olivier Mengué - Emre Berge Ergenekon - Eric Holmes +- Vedang Manerikar Portions derived from other open source works are clearly marked. From 679f05f4fb52f870b2186eb6f74f7246868f4613 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 13 Feb 2012 20:53:21 +0100 Subject: [PATCH 152/174] Remove the "still maintained" banner. This is done in anticipation of their discontinuing service. --- README.mdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index 45b896543..c7238e6f0 100644 --- a/README.mdown +++ b/README.mdown @@ -1,5 +1,6 @@ -git-flow ![Project status](http://stillmaintained.com/nvie/gitflow.png) +git-flow ======== + A collection of Git extensions to provide high-level repository operations for Vincent Driessen's [branching model](http://nvie.com/git-model "original blog post"). From f60828188567304a920197bae17d3246c8359ed2 Mon Sep 17 00:00:00 2001 From: Ben Loveridge Date: Fri, 6 Jan 2012 11:04:46 -0700 Subject: [PATCH 153/174] set EXPR_COMPAT=1 if running inside freebsd so shFlags works correctly Signed-off-by: Vincent Driessen --- git-flow | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git-flow b/git-flow index a03ba1fd3..93e9f0f73 100755 --- a/git-flow +++ b/git-flow @@ -37,6 +37,9 @@ # policies, either expressed or implied, of Vincent Driessen. # +# set this to workaround expr problems in shFlags on freebsd +if uname -s | egrep -iq 'bsd'; then export EXPR_COMPAT=1; fi + # enable debug mode if [ "$DEBUG" = "yes" ]; then set -x From cc5e9a58bc84100df9b9e2f217ef8bb688ccd996 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Mon, 13 Feb 2012 21:20:22 +0100 Subject: [PATCH 154/174] Update the Changelog. --- Changes.mdown | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Changes.mdown b/Changes.mdown index 4e3936971..9f9aa1888 100644 --- a/Changes.mdown +++ b/Changes.mdown @@ -3,14 +3,19 @@ Release date: **not yet** * `git flow init` now detects situations where origin already has gitflow - branches set up, and behaves accordingly (thanks Emre Berge Ergenekon) + branches set up, and behaves accordingly (thanks Emre Berge Ergenekon). * `git flow feature finish` can now be called without a feature branch name(prefix) argument and will finish the current branch, if on any. -* Various minor bug fixes related to internal argument passing +* `git flow feature pull` now has a `-r` flag, to support `pull --rebase` + semantics (thanks Vedang Manerikar). -* Better support for Windows users. +* Various minor bug fixes related to internal argument passing. + +* Improved some documentation. + +* Better support for Windows and BSD users. * Add package installers for the Debian and Windows platforms. From 37f7d14b2f566390c824be6168ec730d11bb531e Mon Sep 17 00:00:00 2001 From: Vedang Manerikar Date: Mon, 12 Mar 2012 17:03:11 +0530 Subject: [PATCH 155/174] 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 156/174] 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 157/174] 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 158/174] 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 159/174] 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 160/174] 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 161/174] 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 162/174] 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 163/174] 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 164/174] 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 165/174] 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 166/174] 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 167/174] 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 168/174] 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 169/174] 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 170/174] 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 171/174] 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 172/174] 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 173/174] 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 174/174] 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