|
4 | 4 | #
|
5 | 5 | # Fetch one or more remote refs and merge it/them into the current HEAD.
|
6 | 6 |
|
7 |
| -USAGE='[-n | --no-stat] [--[no-]commit] [--[no-]squash] [--[no-]ff|--ff-only] [--[no-]rebase|--rebase=preserve] [-s strategy]... [<fetch-options>] <repo> <head>...' |
8 |
| -LONG_USAGE='Fetch one or more remote refs and integrate it/them with the current HEAD.' |
9 | 7 | SUBDIRECTORY_OK=Yes
|
10 |
| -OPTIONS_SPEC= |
| 8 | +OPTIONS_KEEPDASHDASH= |
| 9 | +OPTIONS_STUCKLONG=Yes |
| 10 | +OPTIONS_SPEC="\ |
| 11 | +git pull [options] [<repository> [<refspec>...]] |
| 12 | +
|
| 13 | +Fetch one or more remote refs and integrate it/them with the current HEAD. |
| 14 | +-- |
| 15 | +v,verbose be more verbose |
| 16 | +q,quiet be more quiet |
| 17 | +progress force progress reporting |
| 18 | +
|
| 19 | + Options related to merging |
| 20 | +r,rebase?false|true|preserve incorporate changes by rebasing rather than merging |
| 21 | +n! do not show a diffstat at the end of the merge |
| 22 | +stat show a diffstat at the end of the merge |
| 23 | +summary (synonym to --stat) |
| 24 | +log?n add (at most <n>) entries from shortlog to merge commit message |
| 25 | +squash create a single commit instead of doing a merge |
| 26 | +commit perform a commit if the merge succeeds (default) |
| 27 | +e,edit edit message before committing |
| 28 | +ff allow fast-forward |
| 29 | +ff-only! abort if fast-forward is not possible |
| 30 | +verify-signatures verify that the named commit has a valid GPG signature |
| 31 | +s,strategy=strategy merge strategy to use |
| 32 | +X,strategy-option=option option for selected merge strategy |
| 33 | +S,gpg-sign?key-id GPG sign commit |
| 34 | +
|
| 35 | + Options related to fetching |
| 36 | +all fetch from all remotes |
| 37 | +a,append append to .git/FETCH_HEAD instead of overwriting |
| 38 | +upload-pack=path path to upload pack on remote end |
| 39 | +f,force force overwrite of local branch |
| 40 | +t,tags fetch all tags and associated objects |
| 41 | +p,prune prune remote-tracking branches no longer on remote |
| 42 | +recurse-submodules?on-demand control recursive fetching of submodules |
| 43 | +dry-run dry run |
| 44 | +k,keep keep downloaded pack |
| 45 | +depth=depth deepen history of shallow clone |
| 46 | +unshallow convert to a complete repository |
| 47 | +update-shallow accept refs that update .git/shallow |
| 48 | +refmap=refmap specify fetch refmap |
| 49 | +" |
| 50 | +test $# -gt 0 && args="$*" |
11 | 51 | . git-sh-setup
|
12 | 52 | . git-sh-i18n
|
13 |
| -set_reflog_action "pull${1+ $*}" |
| 53 | +set_reflog_action "pull${args+ $args}" |
14 | 54 | require_work_tree_exists
|
15 | 55 | cd_to_toplevel
|
16 | 56 |
|
|
87 | 127 | diffstat=--stat ;;
|
88 | 128 | --log|--log=*|--no-log)
|
89 | 129 | log_arg="$1" ;;
|
90 |
| - --no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit) |
| 130 | + --no-commit) |
91 | 131 | no_commit=--no-commit ;;
|
92 |
| - --c|--co|--com|--comm|--commi|--commit) |
| 132 | + --commit) |
93 | 133 | no_commit=--commit ;;
|
94 | 134 | -e|--edit)
|
95 | 135 | edit=--edit ;;
|
96 | 136 | --no-edit)
|
97 | 137 | edit=--no-edit ;;
|
98 |
| - --sq|--squ|--squa|--squas|--squash) |
| 138 | + --squash) |
99 | 139 | squash=--squash ;;
|
100 |
| - --no-sq|--no-squ|--no-squa|--no-squas|--no-squash) |
| 140 | + --no-squash) |
101 | 141 | squash=--no-squash ;;
|
102 | 142 | --ff)
|
103 | 143 | no_ff=--ff ;;
|
104 | 144 | --no-ff)
|
105 | 145 | no_ff=--no-ff ;;
|
106 | 146 | --ff-only)
|
107 | 147 | ff_only=--ff-only ;;
|
108 |
| - -s=*|--s=*|--st=*|--str=*|--stra=*|--strat=*|--strate=*|\ |
109 |
| - --strateg=*|--strategy=*|\ |
110 |
| - -s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy) |
111 |
| - case "$#,$1" in |
112 |
| - *,*=*) |
113 |
| - strategy=$(expr "z$1" : 'z-[^=]*=\(.*\)') ;; |
114 |
| - 1,*) |
115 |
| - usage ;; |
116 |
| - *) |
117 |
| - strategy="$2" |
118 |
| - shift ;; |
119 |
| - esac |
120 |
| - strategy_args="${strategy_args}-s $strategy " |
| 148 | + -s*|--strategy=*) |
| 149 | + strategy_args="$strategy_args $1" |
121 | 150 | ;;
|
122 |
| - -X*) |
123 |
| - case "$#,$1" in |
124 |
| - 1,-X) |
125 |
| - usage ;; |
126 |
| - *,-X) |
127 |
| - xx="-X $(git rev-parse --sq-quote "$2")" |
128 |
| - shift ;; |
129 |
| - *,*) |
130 |
| - xx=$(git rev-parse --sq-quote "$1") ;; |
131 |
| - esac |
132 |
| - merge_args="$merge_args$xx " |
| 151 | + -X*|--strategy-option=*) |
| 152 | + merge_args="$merge_args $(git rev-parse --sq-quote "$1")" |
133 | 153 | ;;
|
134 |
| - -r=*|--r=*|--re=*|--reb=*|--reba=*|--rebas=*|--rebase=*) |
| 154 | + -r*|--rebase=*) |
135 | 155 | rebase="${1#*=}"
|
136 | 156 | ;;
|
137 |
| - -r|--r|--re|--reb|--reba|--rebas|--rebase) |
| 157 | + --rebase) |
138 | 158 | rebase=true
|
139 | 159 | ;;
|
140 |
| - --no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase) |
| 160 | + --no-rebase) |
141 | 161 | rebase=false
|
142 | 162 | ;;
|
143 | 163 | --recurse-submodules)
|
|
164 | 184 | -S*)
|
165 | 185 | gpg_sign_args=$(git rev-parse --sq-quote "$1")
|
166 | 186 | ;;
|
167 |
| - --d|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run) |
| 187 | + --dry-run) |
168 | 188 | dry_run=--dry-run
|
169 | 189 | ;;
|
170 | 190 | --all|--no-all)
|
|
196 | 216 | shift
|
197 | 217 | break
|
198 | 218 | ;;
|
199 |
| - -*) |
200 |
| - usage |
201 |
| - ;; |
202 | 219 | *)
|
203 |
| - break |
| 220 | + usage |
204 | 221 | ;;
|
205 | 222 | esac
|
206 | 223 | shift
|
|
0 commit comments