Merge branch 'release/0.0.4'

This commit is contained in:
Motonori Iwata 2011-09-07 17:40:06 +09:00
commit 931d46fb69
3 changed files with 19 additions and 18 deletions

View file

@ -52,7 +52,7 @@ Or simply point your `PATH` environment variable to your git-now checkout
directory.
Special Thanks
See also
---------------
* [An original git-now idea](http://d.hatena.ne.jp/sinsoku/20101208/1291770514) (by [Toshiyuki Kawanishi](https://github.com/toshi-kawanishi))

View file

@ -1,6 +1,8 @@
usage() {
echo "usage: git now rebase [<base-branch>]"
echo " git now rebase --push|-p [--remote|-r <remote>] [<base-branch>]"
echo " git now rebase --push [<base-branch>]"
echo " git now rebase --push --upstream <remote> [<base-branch>]"
echo " git now rebase --push --remove <remote> [<base-branch>]"
}
@ -34,7 +36,14 @@ cmd_default() {
fi
if flag push; then
_cmd_push $WORKING_BRANCH $REMOTE
if [ -n "$UPSTREAM_REMOTE" ]; then
git push --set-upstream $UPSTREAM_REMOTE $WORKING_BRANCH
elif [ -n "$REMOVE_REMOTE" ]; then
git push $REMOVE_REMOTE :$WORKING_BRANCH
git push
else
git push
fi
fi
}
@ -45,23 +54,15 @@ cmd_help() {
parse_args() {
# parse options
DEFINE_boolean 'push' false 'push to remote repository finally' 'p'
DEFINE_string 'remote' '' 'remote branch name to --set-upstream' 'r'
DEFINE_boolean 'push' false 'push to remote repository finally' ''
DEFINE_string 'remove' '' 'remote name to remove the remote branch before push' ''
DEFINE_string 'upstream' '' 'remote name for --set-upstream' ''
FLAGS "$@" || exit $?
eval set -- "${FLAGS_ARGV}"
# read arguments into global variables
BASE_BRANCH=$1
REMOTE=$FLAGS_remote
}
_cmd_push() {
local branch=$1
local remote=$2
if [ -n "$remote" ]; then
git push --set-upstream ${remote} ${branch}
else
git push
fi
UPSTREAM_REMOTE=$FLAGS_upstream
REMOVE_REMOTE=$FLAGS_remove
}

View file

@ -1,8 +1,8 @@
require 'formula'
class GitNow < Formula
url 'https://github.com/iwata/git-now.git', :tag => 'v0.0.3'
version '0.0.3'
url 'https://github.com/iwata/git-now.git', :tag => 'v0.0.4'
version '0.0.4'
head 'https://github.com/iwata/git-now.git', :branch => 'develop'
homepage 'https://github.com/iwata/git-now'