diff --git a/README.mdown b/README.mdown index acff8a2..f9b631b 100644 --- a/README.mdown +++ b/README.mdown @@ -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)) diff --git a/git-now-rebase b/git-now-rebase index 702539e..7b4e9ef 100644 --- a/git-now-rebase +++ b/git-now-rebase @@ -1,6 +1,8 @@ usage() { echo "usage: git now rebase []" - echo " git now rebase --push|-p [--remote|-r ] []" + echo " git now rebase --push []" + echo " git now rebase --push --upstream []" + echo " git now rebase --push --remove []" } @@ -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 } diff --git a/git-now.rb b/git-now.rb index 9842b0a..38d59c8 100644 --- a/git-now.rb +++ b/git-now.rb @@ -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'