From: Paul Tan <pyokagan@gmail.com>
To: git@vger.kernel.org
Cc: Stefan Beller <sbeller@google.com>,
Johannes Schindelin <johannes.schindelin@gmx.de>,
Paul Tan <pyokagan@gmail.com>
Subject: [PATCH 2/2] work in progress
Date: Mon, 18 May 2015 21:30:46 +0800 [thread overview]
Message-ID: <1431955855-16228-2-git-send-email-pyokagan@gmail.com> (raw)
In-Reply-To: <1431955855-16228-1-git-send-email-pyokagan@gmail.com>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
---
git-pull.sh | 102 +++++++++++++++++++++++++++++++++---------------------------
1 file changed, 57 insertions(+), 45 deletions(-)
diff --git a/git-pull.sh b/git-pull.sh
index 28d49ab..18f5210 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -4,13 +4,53 @@
#
# Fetch one or more remote refs and merge it/them into the current HEAD.
-USAGE='[-n | --no-stat] [--[no-]commit] [--[no-]squash] [--[no-]ff|--ff-only] [--[no-]rebase|--rebase=preserve] [-s strategy]... [<fetch-options>] <repo> <head>...'
-LONG_USAGE='Fetch one or more remote refs and integrate it/them with the current HEAD.'
SUBDIRECTORY_OK=Yes
-OPTIONS_SPEC=
+OPTIONS_KEEPDASHDASH=Yes
+OPTIONS_STUCKLONG=Yes
+OPTIONS_SPEC="\
+git pull [options] [<repo> [<refspec>...]]
+
+Fetch one or more remote refs and integrate it/them with the current HEAD.
+--
+v,verbose be more verbose
+q,quiet be more quiet
+progress force progress reporting
+
+ Options related to merging
+r,rebase?false|true|preserve incorporate changes by rebasing rather than merging
+n! do not show a diffstat at the end of the merge
+stat show a diffstat at the end of the merge
+summary (synonym to --stat)
+log?n add (at most <n>) entries from shortlog to merge commit message
+squash create a single commit instead of doing a merge
+commit perform a commit if the merge succeeds (default)
+e,edit edit message before committing
+ff allow fast-forward
+ff-only! abort if fast-forward is not possible
+verify-signatures verify that the named commit has a valid GPG signature
+s,strategy=strategy merge strategy to use
+X,strategy-option=option option for selected merge strategy
+S,gpg-sign?key-id GPG sign commit
+
+ Options related to fetching
+all fetch from all remotes
+a,append append to .git/FETCH_HEAD instead of overwriting
+upload-pack=path path to upload pack on remote end
+f,force force overwrite of local branch
+t,tags fetch all tags and associated objects
+p,prune prune remote-tracking branches no longer on remote
+recurse-submodules?on-demand control recursive fetching of submodules
+dry-run dry run
+k,keep keep downloaded pack
+depth=depth deepen history of shallow clone
+unshallow convert to a complete repository
+update-shallow accept refs that update .git/shallow
+refmap=refmap specify fetch refmap
+"
+args="$*"
. git-sh-setup
. git-sh-i18n
-set_reflog_action "pull${1+ $*}"
+set_reflog_action "pull${args:+ $args}"
require_work_tree_exists
cd_to_toplevel
@@ -83,17 +123,15 @@ do
diffstat=--stat ;;
--log|--no-log)
log_arg=$1 ;;
- --no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
- no_commit=--no-commit ;;
- --c|--co|--com|--comm|--commi|--commit)
- no_commit=--commit ;;
+ --commit|--no-commit)
+ no_commit="$1" ;;
-e|--edit)
edit=--edit ;;
--no-edit)
edit=--no-edit ;;
- --sq|--squ|--squa|--squas|--squash)
+ --squash)
squash=--squash ;;
- --no-sq|--no-squ|--no-squa|--no-squas|--no-squash)
+ --no-squash)
squash=--no-squash ;;
--ff)
no_ff=--ff ;;
@@ -101,39 +139,19 @@ do
no_ff=--no-ff ;;
--ff-only)
ff_only=--ff-only ;;
- -s=*|--s=*|--st=*|--str=*|--stra=*|--strat=*|--strate=*|\
- --strateg=*|--strategy=*|\
- -s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)
- case "$#,$1" in
- *,*=*)
- strategy=$(expr "z$1" : 'z-[^=]*=\(.*\)') ;;
- 1,*)
- usage ;;
- *)
- strategy="$2"
- shift ;;
- esac
- strategy_args="${strategy_args}-s $strategy "
+ --strategy=*)
+ strategy_args="$strategy_args $1"
;;
- -X*)
- case "$#,$1" in
- 1,-X)
- usage ;;
- *,-X)
- xx="-X $(git rev-parse --sq-quote "$2")"
- shift ;;
- *,*)
- xx=$(git rev-parse --sq-quote "$1") ;;
- esac
- merge_args="$merge_args$xx "
+ --strategy-option=*)
+ merge_args="$merge_args $1"
;;
- -r=*|--r=*|--re=*|--reb=*|--reba=*|--rebas=*|--rebase=*)
+ --rebase=*)
rebase="${1#*=}"
;;
- -r|--r|--re|--reb|--reba|--rebas|--rebase)
+ -r|--rebase)
rebase=true
;;
- --no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase)
+ --no-rebase)
rebase=false
;;
--recurse-submodules)
@@ -157,10 +175,7 @@ do
--gpg-sign=*)
gpg_sign_args=$(git rev-parse --sq-quote "-S${1#--gpg-sign=}")
;;
- -S*)
- gpg_sign_args=$(git rev-parse --sq-quote "$1")
- ;;
- --d|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run)
+ --dry-run)
dry_run=--dry-run
;;
--all|--no-all)
@@ -192,11 +207,8 @@ do
shift
break
;;
- -*)
- usage
- ;;
*)
- break
+ usage
;;
esac
shift
--
2.1.4
next prev parent reply other threads:[~2015-05-18 13:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-18 13:30 [PATCH 1/2] pull: handle git-fetch's options as well Paul Tan
2015-05-18 13:30 ` Paul Tan [this message]
2015-05-18 14:05 ` Paul Tan
2015-05-18 14:37 ` Johannes Schindelin
2015-05-21 8:29 ` Paul Tan
2015-05-21 8:29 ` Paul Tan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1431955855-16228-2-git-send-email-pyokagan@gmail.com \
--to=pyokagan@gmail.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
--cc=sbeller@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).