From b1033aa3d3d50e5c2df61cad04b6e79c0c542793 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 23 Mar 2010 21:10:13 +0100 Subject: [PATCH 01/36] 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 ffc9e96..1408a9a 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 02/36] 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 1408a9a..46e95af 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 03/36] 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 46e95af..e34cb14 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 04/36] 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 84adc05..d1e17c6 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 05/36] 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 d8d4bb7..a29cd01 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 06/36] 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 0000000..e24e26b --- /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 aabdb4d..be21d20 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 07/36] 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 0000000..2416f80 --- /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 08/36] Whitespace issue. --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index e24e26b..cedd182 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 09/36] 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 bb1117e..6f82544 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 d1e17c6..a94bbeb 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 a29cd01..7cba61b 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 5866178..65dbaa3 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 e34cb14..5750fd1 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 2a46a7a..882a7be 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 9403c12..1357d1f 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 347e6f4..2fc8eda 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 aa33700..615b367 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 10/36] 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 be21d20..064e372 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 11/36] 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 7cba61b..a1c2ff8 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 12/36] 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 a1c2ff8..56dd38d 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 13/36] 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 615b367..f0748ac 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 14/36] 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 56dd38d..98154ef 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 15/36] 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 98154ef..e5d0ed6 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 65dbaa3..e3ea035 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 882a7be..37f44f0 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 1357d1f..ab98fd3 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 16/36] 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 e5d0ed6..618d7f1 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 e3ea035..b505b76 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 37f44f0..19a9da2 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 ab98fd3..0e58451 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 17/36] Added Randy Merrill to the AUTHORS. --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 2416f80..a5295ce 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 18/36] 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 a5295ce..c764de4 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 19/36] 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 618d7f1..d37857b 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 20/36] 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 d37857b..45a821b 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 21/36] 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 45a821b..051e5d3 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 22/36] 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 a94bbeb..e95d4ad 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 051e5d3..ab3fa01 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 b505b76..fe8c804 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 5750fd1..461ee8c 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 19a9da2..bff9561 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 0e58451..1ec1b4e 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 2fc8eda..349517e 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 f0748ac..29ef388 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 23/36] 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 ab3fa01..3ed06d0 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 24/36] 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 c764de4..b54d16b 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 064e372..1576648 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 0000000..33dbe58 --- /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 25/36] 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 349517e..93a0df2 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 26/36] Added link to Google group. --- README.mdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.mdown b/README.mdown index 1576648..b41e9ed 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 27/36] Fix markdown issue. --- README.mdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.mdown b/README.mdown index b41e9ed..83eacd2 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 28/36] 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 3ed06d0..91a7749 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 29/36] 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 91a7749..2fdba25 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 30/36] Add Mark to AUTHORS. --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index b54d16b..9de970d 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 31/36] 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 83eacd2..c01f9b8 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 32/36] 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 c01f9b8..35bd90a 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 33/36] 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 fe8c804..390e537 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 bff9561..b998673 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 1ec1b4e..ba92cb9 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 34/36] 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 0000000..7a5f311 --- /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 35/36] 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 7a5f311..c7b92c8 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 36/36] 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 93a0df2..7371595 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"