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

Re: [PATCH 3/3] Make rebase--interactive use OPTIONS_SPEC

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 20, 2008, 13:15 UTC
Message-ID
<alpine.DEB.1.00.0806201407230.6439@racer>
In-Reply-To
<1213929935-15093-4-git-send-email-s-beyer@gmx.net>
Hi,
I like the patch.  Just a couple comments:
On Fri, 20 Jun 2008, Stephan Beyer wrote:
Show 14 quoted lines
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index e8ac2ae..aeb9628 100755
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -10,10 +10,25 @@
>  # The original idea comes from Eric W. Biederman, in
>  # http://article.gmane.org/gmane.comp.version-control.git/22407
>  
> -USAGE='(--continue | --abort | --skip | [--preserve-merges] [--first-parent]
> -	[--preserve-tags] [--verbose] [--onto <branch>] <upstream> [<branch>])'
> +OPTIONS_KEEPDASHDASH=
> +OPTIONS_SPEC='
> +git-rebase -i [options] <upstream> [<branch>]
> +git-rebase (--continue | --abort | --skip)
Here, "-i" is not an error, but not required either, so it should be
+git-rebase [-i] (--continue | --abort | --skip)
> +--
> +continue           Continue rebasing process
> +abort              Abort rebasing process and restore original branch
> +skip               Skip current patch and continue rebasing process

I wonder if these options (which really should be subcommands) should not go below the options, for chronological reasons: you are likely to need the other options before --continue and friends.

> +p,preserve-merges  Try to recreate merges instead of ignoring
s/$/ them/
> +t,preserve-tags    Update tags to the new commit object
> +m,merge            Used anyways (no-op)
> +i,interactive      Used anyways (no-op)
s/anyways/always/
Hmm?
Show 20 quoted lines
> +onto=              Rebase onto given branch instead of upstream
> +v,verbose          Display a diffstat of what changed upstream
> + When preserving merges:
> +f,first-parent     Show only commits following the first parent of each commit
> +s,strategy=        Use the given merge strategy
> +'
>  
> -OPTIONS_SPEC=
>  . git-sh-setup
>  require_work_tree
>  
> @@ -595,32 +611,36 @@ do
>
> [...]
>
> +	--onto)
> +		shift
> +		ONTO=$(git rev-parse --verify "$1") ||
> +			die "Does not point to a valid commit: $1"
> +		;;

You probably need to introduce checks against "git rebase --continue --onto blabla", then.

Show 7 quoted lines
>  	''|-h)
>  		usage
>  		;;
> -	*)
> +	--)
> +		shift
> +		test $# -eq 1 -o $# -eq 2 || usage
I consider this a bugfix.  Thanks.
Show 8 quoted lines
> @@ -720,6 +731,7 @@ EOF
>  			die_abort "Nothing to do"
>  
>  		output git checkout $ONTO && do_rest
> +		exit 0
>  		;;
>  	esac
>  	shift

This exit is not really necessary, is it? Besides, a simple "exit" would be more correct: it reuses the exit status of the most recently executed command, which is what we want here.

Thanks, Dscho

Previous: Stephan BeyerNext: Stephan Beyer
Message 6 of 21 in “some small changes for rebase-i”
  1. Stephan BeyerJun 20, 2008
  2. 1/3 t3404: slight improvementsStephan Beyer, Jun 20, 2008
  3. 2/3 rebase-i: slight internal improvementsStephan Beyer, Jun 20, 2008
  4. 3/3 Make rebase--interactive use OPTIONS_SPECStephan Beyer, Jun 20, 2008
  5. Stephan BeyerJun 20, 2008
  6. Johannes SchindelinJun 20, 2008
  7. 1/2 t3404: extra checks and s/! git/test_must_fail git/Stephan Beyer, Jun 20, 2008
  8. 2/2 Make rebase--interactive use OPTIONS_SPECStephan Beyer, Jun 20, 2008
  9. Brandon CaseyJun 20, 2008
  10. Stephan BeyerJun 20, 2008
  11. しらいしななこJun 20, 2008
  12. Stephan BeyerJun 21, 2008
  13. Junio C HamanoJun 21, 2008
  14. 1/2 t3404: stricter tests for git-rebase--interactiveStephan Beyer, Jun 21, 2008
  15. 2/2 Make rebase--interactive use OPTIONS_SPECStephan Beyer, Jun 21, 2008
  16. Johannes SixtJun 20, 2008
  17. Stephan BeyerJun 20, 2008
  18. Johannes SixtJun 20, 2008
  19. Johannes SchindelinJun 20, 2008
  20. Stephan BeyerJun 20, 2008
  21. Johannes SchindelinJun 20, 2008

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.