@@ -28,7 +28,39 @@ Example: git-rebase master~1 topic
28
28
'
29
29
30
30
SUBDIRECTORY_OK=Yes
31
- OPTIONS_SPEC=
31
+ OPTIONS_KEEPDASHDASH=
32
+ OPTIONS_SPEC=" \
33
+ git rebase [-i] [options] [--onto <newbase>] [<upstream>] [<branch>]
34
+ git rebase [-i] [options] --onto <newbase> --root [<branch>]
35
+ git-rebase [-i] --continue | --abort | --skip
36
+ --
37
+ Available options are
38
+ v,verbose! display a diffstat of what changed upstream
39
+ q,quiet! be quiet. implies --no-stat
40
+ onto=! rebase onto given branch instead of upstream
41
+ p,preserve-merges! try to recreate merges instead of ignoring them
42
+ s,strategy=! use the given merge strategy
43
+ no-ff! cherry-pick all commits, even if unchanged
44
+ m,merge! use merging strategies to rebase
45
+ i,interactive! let the user edit the list of commits to rebase
46
+ f,force-rebase! force rebase even if branch is up to date
47
+ X,strategy-option=! pass the argument through to the merge strategy
48
+ stat! display a diffstat of what changed upstream
49
+ n,no-stat! do not show diffstat of what changed upstream
50
+ verify allow pre-rebase hook to run
51
+ rerere-autoupdate allow rerere to update index with resolved conflicts
52
+ root! rebase all reachable commits up to the root(s)
53
+ autosquash move commits that begin with squash!/fixup! under -i
54
+ committer-date-is-author-date! passed to 'git am'
55
+ ignore-date! passed to 'git am'
56
+ whitespace=! passed to 'git apply'
57
+ ignore-whitespace! passed to 'git apply'
58
+ C=! passed to 'git apply'
59
+ Actions:
60
+ continue! continue rebasing process
61
+ abort! abort rebasing process and restore original branch
62
+ skip! skip current patch and continue rebasing process
63
+ "
32
64
. git-sh-setup
33
65
set_reflog_action rebase
34
66
require_work_tree
175
207
ok_to_skip_pre_rebase=
176
208
;;
177
209
--continue|--skip|--abort)
178
- test $total_argc -eq 1 || usage
210
+ test $total_argc -eq 2 || usage
179
211
action=${1## --}
180
212
;;
181
213
--onto)
182
214
test 2 -le " $# " || usage
183
215
onto=" $2 "
184
216
shift
185
217
;;
186
- -i|--interactive )
218
+ -i)
187
219
interactive_rebase=explicit
188
220
;;
189
- -p|--preserve-merges )
221
+ -p)
190
222
preserve_merges=t
191
223
test -z " $interactive_rebase " && interactive_rebase=implied
192
224
;;
196
228
--no-autosquash)
197
229
autosquash=
198
230
;;
199
- -M|-m|--m|--me|--mer|--merg|--merge )
231
+ -M|-m)
200
232
do_merge=t
201
233
;;
202
- -X* |--strategy-option* )
203
- case " $# ,$1 " in
204
- 1,-X|1,--strategy-option)
205
- usage ;;
206
- * ,-X|* ,--strategy-option)
207
- newopt=" $2 "
208
- shift ;;
209
- * ,--strategy-option=* )
210
- newopt=" $( expr " $1 " : ' --strategy-option=\(.*\)' ) " ;;
211
- * ,-X* )
212
- newopt=" $( expr " $1 " : ' -X\(.*\)' ) " ;;
213
- 1,* )
214
- usage ;;
215
- esac
216
- strategy_opts=" $strategy_opts $( git rev-parse --sq-quote " --$newopt " ) "
234
+ -X)
235
+ shift
236
+ strategy_opts=" $strategy_opts $( git rev-parse --sq-quote " --$1 " ) "
217
237
do_merge=t
218
238
test -z " $strategy " && strategy=recursive
219
239
;;
220
- -s=* |--s=* |--st=* |--str=* |--stra=* |--strat=* |--strate=* |\
221
- --strateg=* |--strategy=* |\
222
- -s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)
223
- case " $# ,$1 " in
224
- * ,* =* )
225
- strategy=` expr " z$1 " : ' z-[^=]*=\(.*\)' ` ;;
226
- 1,* )
227
- usage ;;
228
- * )
229
- strategy=" $2 "
230
- shift ;;
231
- esac
240
+ -s)
241
+ shift
242
+ strategy=" $1 "
232
243
do_merge=t
233
244
;;
234
- -n|--no-stat )
245
+ -n)
235
246
diffstat=
236
247
;;
237
248
--stat)
238
249
diffstat=t
239
250
;;
240
- -v|--verbose )
251
+ -v)
241
252
verbose=t
242
253
diffstat=t
243
254
GIT_QUIET=
244
255
;;
245
- -q|--quiet )
256
+ -q)
246
257
GIT_QUIET=t
247
258
git_am_opt=" $git_am_opt -q"
248
259
verbose=
249
260
diffstat=
250
261
;;
251
- --whitespace=* )
252
- git_am_opt=" $git_am_opt $1 "
262
+ --whitespace)
263
+ shift
264
+ git_am_opt=" $git_am_opt --whitespace=$1 "
253
265
case " $1 " in
254
- --whitespace= fix|--whitespace= strip)
266
+ fix|strip)
255
267
force_rebase=t
256
268
;;
257
269
esac
263
275
git_am_opt=" $git_am_opt $1 "
264
276
force_rebase=t
265
277
;;
266
- -C* )
267
- git_am_opt=" $git_am_opt $1 "
278
+ -C)
279
+ shift
280
+ git_am_opt=" $git_am_opt -C$1 "
268
281
;;
269
282
--root)
270
283
rebase_root=t
271
284
;;
272
- -f|--f|--fo|--for|--forc|--force|--force-r|--force-re|--force-reb|--force-reba|--force-rebas|--force-rebase|-- no-ff)
285
+ -f|--no-ff)
273
286
force_rebase=t
274
287
;;
275
288
--rerere-autoupdate|--no-rerere-autoupdate)
276
289
allow_rerere_autoupdate=" $1 "
277
290
;;
278
- -* )
279
- usage
280
- ;;
281
- * )
291
+ --)
292
+ shift
282
293
break
283
294
;;
284
295
esac
0 commit comments