git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 7/8] rebase: parse options in stuck-long mode

From
Nicolas Vigier <boklm@mars-attacks.org>
Date
Nov 3, 2013, 15:54 UTC
Message-ID
<1383494064-5653-8-git-send-email-boklm@mars-attacks.org>
In-Reply-To
<1383494064-5653-1-git-send-email-boklm@mars-attacks.org>

There is no functionnal 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>
---
 git-rebase.sh | 50 ++++++++++++++++++++++----------------------------
 1 file changed, 22 insertions(+), 28 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index 2f2f8ded5c3f..a6c294b2289b 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -5,7 +5,7 @@
 
 SUBDIRECTORY_OK=Yes
 OPTIONS_KEEPDASHDASH=
-OPTIONS_STUCKLONG=
+OPTIONS_STUCKLONG=t
 OPTIONS_SPEC="\
 git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
 git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
@@ -235,21 +235,19 @@ do
 		test $total_argc -eq 2 || usage
 		action=${1##--}
 		;;
-	--onto)
-		onto="$2"
-		shift
+	--onto=*)
+		onto="${1#--onto=}"
 		;;
-	-x)
-		cmd="${cmd}exec $2${LF}"
-		shift
+	--exec=*)
+		cmd="${cmd}exec ${1#--exec=}${LF}"
 		;;
-	-i)
+	--interactive)
 		interactive_rebase=explicit
 		;;
-	-k)
+	--keep-empty)
 		keep_empty=yes
 		;;
-	-p)
+	--preserve-merges)
 		preserve_merges=t
 		test -z "$interactive_rebase" && interactive_rebase=implied
 		;;
@@ -259,21 +257,19 @@ do
 	--no-autosquash)
 		autosquash=
 		;;
-	-m)
+	--merge)
 		do_merge=t
 		;;
-	-X)
-		shift
-		strategy_opts="$strategy_opts $(git rev-parse --sq-quote "--$1")"
+	--strategy-option=*)
+		strategy_opts="$strategy_opts $(git rev-parse --sq-quote "--${1#--strategy-option=}")"
 		do_merge=t
 		test -z "$strategy" && strategy=recursive
 		;;
-	-s)
-		shift
-		strategy="$1"
+	--strategy=*)
+		strategy="${1#--strategy=}"
 		do_merge=t
 		;;
-	-n)
+	--no-stat)
 		diffstat=
 		;;
 	--stat)
@@ -282,21 +278,20 @@ do
 	--autostash)
 		autostash=true
 		;;
-	-v)
+	--verbose)
 		verbose=t
 		diffstat=t
 		GIT_QUIET=
 		;;
-	-q)
+	--quiet)
 		GIT_QUIET=t
 		git_am_opt="$git_am_opt -q"
 		verbose=
 		diffstat=
 		;;
-	--whitespace)
-		shift
-		git_am_opt="$git_am_opt --whitespace=$1"
-		case "$1" in
+	--whitespace=*)
+		git_am_opt="$git_am_opt --whitespace=${1#--whitespace=}"
+		case "${1#--whitespace=}" in
 		fix|strip)
 			force_rebase=t
 			;;
@@ -309,14 +304,13 @@ do
 		git_am_opt="$git_am_opt $1"
 		force_rebase=t
 		;;
-	-C)
-		shift
-		git_am_opt="$git_am_opt -C$1"
+	-C*)
+		git_am_opt="$git_am_opt $1"
 		;;
 	--root)
 		rebase_root=t
 		;;
-	-f|--no-ff)
+	--force-rebase|--no-ff)
 		force_rebase=t
 		;;
 	--rerere-autoupdate|--no-rerere-autoupdate)
-- 
1.8.4.2
Previous: Nicolas VigierNext: Nicolas Vigier
Message 13 of 15 in “Adding --gpg-sign to cherry-pick, revert, am, rebase”
  1. Nicolas VigierNov 3, 2013
  2. 1/8 cherry-pick, revert: add the --gpg-sign optionNicolas Vigier, Nov 3, 2013
  3. brian m. carlsonNov 3, 2013
  4. Nicolas VigierNov 3, 2013
  5. cherry-pick, revert: add the --gpg-sign optionNicolas Vigier, Nov 3, 2013
  6. brian m. carlsonNov 3, 2013
  7. 2/8 git-sh-setup.sh: add variable to use the stuck-long modeNicolas Vigier, Nov 3, 2013
  8. 3/8 am: parse options in stuck-long modeNicolas Vigier, Nov 3, 2013
  9. 4/8 am: add the --gpg-sign optionNicolas Vigier, Nov 3, 2013
  10. am: add the --gpg-sign optionNicolas Vigier, Nov 3, 2013
  11. 5/8 rebase: remove useless arguments checkNicolas Vigier, Nov 3, 2013
  12. 6/8 rebase: don't try to match -M optionNicolas Vigier, Nov 3, 2013
  13. 7/8 rebase: parse options in stuck-long modeNicolas Vigier, Nov 3, 2013
  14. 8/8 rebase: add the --gpg-sign optionNicolas Vigier, Nov 3, 2013
  15. brian m. carlsonDec 8, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.