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

[PATCH 5/8] rebase: remove useless arguments check

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

Remove a check on the number of arguments for --onto and -x options. It is not possible for $# to be <= 2 at this point :

 - if --onto or -x has an argument, git rev-parse --parseopt will
   provide something like this :
     set -- --onto 'x' --
   when parsing the "--onto" option, $# will be 3 or more if there are
   other options.
 - if --onto or -x doesn't have an argument, git rev-parse --parseopt
   will exit with an error and display usage information.
Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org>
---
 git-rebase.sh | 2 --
 1 file changed, 2 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index 6ebef7e8b86e..6b9279a69028 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -236,12 +236,10 @@ do
 		action=${1##--}
 		;;
 	--onto)
-		test 2 -le "$#" || usage
 		onto="$2"
 		shift
 		;;
 	-x)
-		test 2 -le "$#" || usage
 		cmd="${cmd}exec $2${LF}"
 		shift
 		;;
-- 
1.8.4.2
Previous: Nicolas VigierNext: Nicolas Vigier
Message 11 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.