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 <boklm@mars-attacks.org> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nicolas Vigier committed Feb 10, 2014 at 01:03 UTC b6e9e73e8af20c2301595d58087ad58a9df05725
1 file changed +22 -28
git-rebase.sh
+22 -28
@@ -5,7 +5,7 @@
5
6 SUBDIRECTORY_OK=Yes
7 OPTIONS_KEEPDASHDASH=
8 -OPTIONS_STUCKLONG=
8 +OPTIONS_STUCKLONG=t
9 OPTIONS_SPEC="\
10 git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
11 git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
@@ -237,21 +237,19 @@ do
237 test $total_argc -eq 2 || usage
238 action=${1##--}
239 ;;
240 - --onto)
241 - onto="$2"
242 - shift
240 + --onto=*)
241 + onto="${1#--onto=}"
242 ;;
244 - -x)
245 - cmd="${cmd}exec $2${LF}"
246 - shift
243 + --exec=*)
244 + cmd="${cmd}exec ${1#--exec=}${LF}"
245 ;;
248 - -i)
246 + --interactive)
247 interactive_rebase=explicit
248 ;;
251 - -k)
249 + --keep-empty)
250 keep_empty=yes
251 ;;
254 - -p)
252 + --preserve-merges)
253 preserve_merges=t
254 test -z "$interactive_rebase" && interactive_rebase=implied
255 ;;
@@ -267,21 +265,19 @@ do
265 --no-fork-point)
266 fork_point=
267 ;;
270 - -m)
268 + --merge)
269 do_merge=t
270 ;;
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=}")"
273 do_merge=t
274 test -z "$strategy" && strategy=recursive
275 ;;
279 - -s)
280 - shift
281 - strategy="$1"
276 + --strategy=*)
277 + strategy="${1#--strategy=}"
278 do_merge=t
279 ;;
284 - -n)
280 + --no-stat)
281 diffstat=
282 ;;
283 --stat)
@@ -290,21 +286,20 @@ do
286 --autostash)
287 autostash=true
288 ;;
293 - -v)
289 + --verbose)
290 verbose=t
291 diffstat=t
292 GIT_QUIET=
293 ;;
298 - -q)
294 + --quiet)
295 GIT_QUIET=t
296 git_am_opt="$git_am_opt -q"
297 verbose=
298 diffstat=
299 ;;
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
303 fix|strip)
304 force_rebase=t
305 ;;
@@ -317,14 +312,13 @@ do
312 git_am_opt="$git_am_opt $1"
313 force_rebase=t
314 ;;
320 - -C)
321 - shift
322 - git_am_opt="$git_am_opt -C$1"
315 + -C*)
316 + git_am_opt="$git_am_opt $1"
317 ;;
318 --root)
319 rebase_root=t
320 ;;
327 - -f|--no-ff)
321 + --force-rebase|--no-ff)
322 force_rebase=t
323 ;;
324 --rerere-autoupdate|--no-rerere-autoupdate)