Skip to content

Commit b6e9e73

Browse files
boklmgitster
authored andcommitted
rebase: parse options in stuck-long mode
There is no functional change. The reason for this change is to be able to add a new option taking an optional argument. Signed-off-by: Nicolas Vigier <[email protected]> Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e4a4e7f commit b6e9e73

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed

git-rebase.sh

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
SUBDIRECTORY_OK=Yes
77
OPTIONS_KEEPDASHDASH=
8-
OPTIONS_STUCKLONG=
8+
OPTIONS_STUCKLONG=t
99
OPTIONS_SPEC="\
1010
git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
1111
git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
@@ -237,21 +237,19 @@ do
237237
test $total_argc -eq 2 || usage
238238
action=${1##--}
239239
;;
240-
--onto)
241-
onto="$2"
242-
shift
240+
--onto=*)
241+
onto="${1#--onto=}"
243242
;;
244-
-x)
245-
cmd="${cmd}exec $2${LF}"
246-
shift
243+
--exec=*)
244+
cmd="${cmd}exec ${1#--exec=}${LF}"
247245
;;
248-
-i)
246+
--interactive)
249247
interactive_rebase=explicit
250248
;;
251-
-k)
249+
--keep-empty)
252250
keep_empty=yes
253251
;;
254-
-p)
252+
--preserve-merges)
255253
preserve_merges=t
256254
test -z "$interactive_rebase" && interactive_rebase=implied
257255
;;
@@ -267,21 +265,19 @@ do
267265
--no-fork-point)
268266
fork_point=
269267
;;
270-
-m)
268+
--merge)
271269
do_merge=t
272270
;;
273-
-X)
274-
shift
275-
strategy_opts="$strategy_opts $(git rev-parse --sq-quote "--$1")"
271+
--strategy-option=*)
272+
strategy_opts="$strategy_opts $(git rev-parse --sq-quote "--${1#--strategy-option=}")"
276273
do_merge=t
277274
test -z "$strategy" && strategy=recursive
278275
;;
279-
-s)
280-
shift
281-
strategy="$1"
276+
--strategy=*)
277+
strategy="${1#--strategy=}"
282278
do_merge=t
283279
;;
284-
-n)
280+
--no-stat)
285281
diffstat=
286282
;;
287283
--stat)
@@ -290,21 +286,20 @@ do
290286
--autostash)
291287
autostash=true
292288
;;
293-
-v)
289+
--verbose)
294290
verbose=t
295291
diffstat=t
296292
GIT_QUIET=
297293
;;
298-
-q)
294+
--quiet)
299295
GIT_QUIET=t
300296
git_am_opt="$git_am_opt -q"
301297
verbose=
302298
diffstat=
303299
;;
304-
--whitespace)
305-
shift
306-
git_am_opt="$git_am_opt --whitespace=$1"
307-
case "$1" in
300+
--whitespace=*)
301+
git_am_opt="$git_am_opt --whitespace=${1#--whitespace=}"
302+
case "${1#--whitespace=}" in
308303
fix|strip)
309304
force_rebase=t
310305
;;
@@ -317,14 +312,13 @@ do
317312
git_am_opt="$git_am_opt $1"
318313
force_rebase=t
319314
;;
320-
-C)
321-
shift
322-
git_am_opt="$git_am_opt -C$1"
315+
-C*)
316+
git_am_opt="$git_am_opt $1"
323317
;;
324318
--root)
325319
rebase_root=t
326320
;;
327-
-f|--no-ff)
321+
--force-rebase|--no-ff)
328322
force_rebase=t
329323
;;
330324
--rerere-autoupdate|--no-rerere-autoupdate)

0 commit comments

Comments
 (0)