Commit f66eba89 authored by Randy Merrill's avatar Randy Merrill

Merge branch 'develop' into feature/Issue50

parents d0df88da 07dacd52
...@@ -16,5 +16,7 @@ Authors are (ordered by first commit date): ...@@ -16,5 +16,7 @@ Authors are (ordered by first commit date):
- Kiall Mac Innes - Kiall Mac Innes
- Jon Bernard - Jon Bernard
- Olivier Mengué - Olivier Mengué
- Emre Berge Ergenekon
- Eric Holmes
Portions derived from other open source works are clearly marked. Portions derived from other open source works are clearly marked.
...@@ -2,11 +2,16 @@ ...@@ -2,11 +2,16 @@
----- -----
Release date: **not yet** 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 * `git flow feature finish` can now be called without a feature branch
name(prefix) argument and will finish the current branch, if on any. name(prefix) argument and will finish the current branch, if on any.
* Various minor bug fixes related to internal argument passing * Various minor bug fixes related to internal argument passing
* Better support for Windows users.
* Add package installers for the Debian and Windows platforms. * Add package installers for the Debian and Windows platforms.
0.4.1: 0.4.1:
......
...@@ -14,77 +14,14 @@ Kreeftmeijer's blog post: ...@@ -14,77 +14,14 @@ Kreeftmeijer's blog post:
Or have a look at one of these screen casts: 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) * [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) * [On the path with git-flow](http://codesherpas.com/screencasts/on_the_path_gitflow.mov) (by Dave Bock)
Installing git-flow Installing git-flow
------------------- -------------------
See the Wiki for up-to-date [Installation Instructions](https://github.com/nvie/gitflow/wiki/Installation).
### 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
#### 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`.
Integration with your shell Integration with your shell
...@@ -115,6 +52,23 @@ contributors, please see the [AUTHORS](AUTHORS) file. ...@@ -115,6 +52,23 @@ contributors, please see the [AUTHORS](AUTHORS) file.
Any questions, tips, or general discussion can be posted to our Google group: 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](http://groups.google.com/group/gitflow-users)
Contributing
------------
Fork the repository. Then, run:
git clone --recursive git@github.com:<username>/gitflow.git
cd gitflow
git branch master origin/master
git flow init -d
git flow feature start <your feature>
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 <your feature>
When done, open a pull request to your feature branch.
License terms License terms
------------- -------------
......
...@@ -22,11 +22,11 @@ echo getopt.exe... Found ...@@ -22,11 +22,11 @@ echo getopt.exe... Found
if not exist "%GIT_HOME%\bin\git-flow" goto :Install if not exist "%GIT_HOME%\bin\git-flow" goto :Install
echo GitFlow is already installed.>&2 echo GitFlow is already installed.>&2
choice /C YN /M "Do you want to replace it" set /p mychoice="Do you want to replace it [y/n]"
if errorlevel 255 goto :Abort if "%mychoice%"=="y" goto :DeleteOldFiles
if errorlevel 2 goto :Abort goto :Abort
if not errorlevel 1 goto :Abort
:DeleteOldFiles
echo Deleting old files... echo Deleting old files...
for /F %%i in ("%GIT_HOME%\git-flow*" "%GIT_HOME%\gitflow-*") do if exist "%%~fi" del /F /Q "%%~fi" for /F %%i in ("%GIT_HOME%\git-flow*" "%GIT_HOME%\gitflow-*") do if exist "%%~fi" del /F /Q "%%~fi"
......
...@@ -42,7 +42,9 @@ if [ "$DEBUG" = "yes" ]; then ...@@ -42,7 +42,9 @@ if [ "$DEBUG" = "yes" ]; then
set -x set -x
fi 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() { usage() {
echo "usage: git flow <subcommand>" echo "usage: git flow <subcommand>"
......
...@@ -44,7 +44,7 @@ PREFIX=$(git config --get gitflow.prefix.feature) ...@@ -44,7 +44,7 @@ PREFIX=$(git config --get gitflow.prefix.feature)
usage() { usage() {
echo "usage: git flow feature [list] [-v]" echo "usage: git flow feature [list] [-v]"
echo " git flow feature start [-F] <name> [<base>]" echo " git flow feature start [-F] <name> [<base>]"
echo " git flow feature finish [-rFk] [<name|nameprefix>]" echo " git flow feature finish [-rFkD] [<name|nameprefix>]"
echo " git flow feature publish <name>" echo " git flow feature publish <name>"
echo " git flow feature track <name>" echo " git flow feature track <name>"
echo " git flow feature diff [<name|nameprefix>]" echo " git flow feature diff [<name|nameprefix>]"
...@@ -231,6 +231,7 @@ cmd_finish() { ...@@ -231,6 +231,7 @@ cmd_finish() {
DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F
DEFINE_boolean rebase false "rebase instead of merge" r DEFINE_boolean rebase false "rebase instead of merge" r
DEFINE_boolean keep false "keep branch after performing finish" k DEFINE_boolean keep false "keep branch after performing finish" k
DEFINE_boolean force_delete false "force delete feature branch after finish" D
parse_args "$@" parse_args "$@"
expand_nameprefix_arg_or_current expand_nameprefix_arg_or_current
...@@ -346,7 +347,11 @@ helper_finish_cleanup() { ...@@ -346,7 +347,11 @@ helper_finish_cleanup() {
if noflag keep; then if noflag keep; then
git branch -d "$BRANCH" if flag force_delete; then
git branch -D "$BRANCH"
else
git branch -d "$BRANCH"
fi
fi fi
echo echo
......
...@@ -46,6 +46,7 @@ usage() { ...@@ -46,6 +46,7 @@ usage() {
echo "usage: git flow hotfix [list] [-v]" echo "usage: git flow hotfix [list] [-v]"
echo " git flow hotfix start [-F] <version> [<base>]" echo " git flow hotfix start [-F] <version> [<base>]"
echo " git flow hotfix finish [-Fsumpk] <version>" echo " git flow hotfix finish [-Fsumpk] <version>"
echo " git flow hotfix publish <version>"
} }
cmd_default() { cmd_default() {
...@@ -188,6 +189,33 @@ cmd_start() { ...@@ -188,6 +189,33 @@ cmd_start() {
echo 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() { cmd_finish() {
DEFINE_boolean fetch false "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_boolean sign false "sign the release tag cryptographically" s
......
...@@ -117,8 +117,14 @@ cmd_default() { ...@@ -117,8 +117,14 @@ cmd_default() {
# check existence in case of an already existing repo # check existence in case of an already existing repo
if [ "$should_check_existence" = "YES" ]; then 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." die "Local branch '$master_branch' does not exist."
fi
fi fi
# store the name of the master branch # store the name of the master branch
...@@ -200,7 +206,11 @@ cmd_default() { ...@@ -200,7 +206,11 @@ cmd_default() {
# default production branch and develop was "created". We should create # default production branch and develop was "created". We should create
# the develop branch now in that case (we base it on master, of course) # the develop branch now in that case (we base it on master, of course)
if ! git_local_branch_exists "$develop_branch"; then 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 created_gitflow_branch=1
fi fi
......
...@@ -97,6 +97,10 @@ git_local_branch_exists() { ...@@ -97,6 +97,10 @@ git_local_branch_exists() {
has $1 $(git_local_branches) has $1 $(git_local_branches)
} }
git_remote_branch_exists() {
has $1 $(git_remote_branches)
}
git_branch_exists() { git_branch_exists() {
has $1 $(git_all_branches) has $1 $(git_all_branches)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment