git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/1] legacy-rebase: fix "regression"
@ 2018-11-20 20:01 Johannes Schindelin via GitGitGadget
  2018-11-20 20:02 ` [PATCH 1/1] legacy-rebase: backport -C<n> and --whitespace=<option> checks Johannes Schindelin via GitGitGadget
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2018-11-20 20:01 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

This is a backport, really, to accommodate a new regression test that was
introduced when the built-in rebase learned to validate the -C<n> and 
--whitespace=<option> arguments early.

Johannes Schindelin (1):
  legacy-rebase: backport -C<n> and --whitespace=<option> checks

 git-legacy-rebase.sh | 8 ++++++++
 1 file changed, 8 insertions(+)


base-commit: bb75be6cb916297f271c846f2f9caa3daaaec718
Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-86%2Fdscho%2Fscripted-rebase-Cn-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-86/dscho/scripted-rebase-Cn-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/86
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] legacy-rebase: backport -C<n> and --whitespace=<option> checks
  2018-11-20 20:01 [PATCH 0/1] legacy-rebase: fix "regression" Johannes Schindelin via GitGitGadget
@ 2018-11-20 20:02 ` Johannes Schindelin via GitGitGadget
  2018-11-20 23:45   ` Carlo Arenas
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2018-11-20 20:02 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Since 04519d720114 (rebase: validate -C<n> and --whitespace=<mode>
parameters early, 2018-11-14), the built-in rebase validates the -C and
--whitespace arguments early. As this commit also introduced a
regression test for this, and as a later commit introduced the
GIT_TEST_REBASE_USE_BUILTIN mode to run tests, we now have a
"regression" in the scripted version of `git rebase` on our hands.

Backport the validation to fix this.

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 git-legacy-rebase.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/git-legacy-rebase.sh b/git-legacy-rebase.sh
index 75a08b2683..ced0635326 100755
--- a/git-legacy-rebase.sh
+++ b/git-legacy-rebase.sh
@@ -337,6 +337,11 @@ do
 		fix|strip)
 			force_rebase=t
 			;;
+		warn|nowarn|error|error-all)
+			;; # okay, known whitespace option
+		*)
+			die "Invalid whitespace option: '${1%*=}'"
+			;;
 		esac
 		;;
 	--ignore-whitespace)
@@ -352,6 +357,9 @@ do
 		git_am_opt="$git_am_opt $1"
 		force_rebase=t
 		;;
+	-C*[!0-9]*)
+		die "switch \`C' expects a numerical value"
+		;;
 	-C*)
 		git_am_opt="$git_am_opt $1"
 		;;
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] legacy-rebase: backport -C<n> and --whitespace=<option> checks
  2018-11-20 20:02 ` [PATCH 1/1] legacy-rebase: backport -C<n> and --whitespace=<option> checks Johannes Schindelin via GitGitGadget
@ 2018-11-20 23:45   ` Carlo Arenas
  2018-11-21  4:40     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Carlo Arenas @ 2018-11-20 23:45 UTC (permalink / raw)
  To: gitgitgadget; +Cc: git, gitster, johannes.schindelin

Tested-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>

the C version prepends: "fatal: " unlike the shell version for both
error messages

Carlo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] legacy-rebase: backport -C<n> and --whitespace=<option> checks
  2018-11-20 23:45   ` Carlo Arenas
@ 2018-11-21  4:40     ` Junio C Hamano
  2018-11-21 14:06       ` Johannes Schindelin
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2018-11-21  4:40 UTC (permalink / raw)
  To: Carlo Arenas; +Cc: gitgitgadget, git, johannes.schindelin

Carlo Arenas <carenas@gmail.com> writes:

> Tested-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
>
> the C version prepends: "fatal: " unlike the shell version for both
> error messages

In addition, "Invalid whitespace option" says 'bad', not
'--whitespace=bad', in the builtin version.

I think the following would address both issues.


 git-legacy-rebase.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-legacy-rebase.sh b/git-legacy-rebase.sh
index ced0635326..b97ffdc9dd 100755
--- a/git-legacy-rebase.sh
+++ b/git-legacy-rebase.sh
@@ -340,7 +340,7 @@ do
 		warn|nowarn|error|error-all)
 			;; # okay, known whitespace option
 		*)
-			die "Invalid whitespace option: '${1%*=}'"
+			die "fatal: Invalid whitespace option: '${1#*=}'"
 			;;
 		esac
 		;;
@@ -358,7 +358,7 @@ do
 		force_rebase=t
 		;;
 	-C*[!0-9]*)
-		die "switch \`C' expects a numerical value"
+		die "fatal: switch \`C' expects a numerical value"
 		;;
 	-C*)
 		git_am_opt="$git_am_opt $1"



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] legacy-rebase: backport -C<n> and --whitespace=<option> checks
  2018-11-21  4:40     ` Junio C Hamano
@ 2018-11-21 14:06       ` Johannes Schindelin
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Schindelin @ 2018-11-21 14:06 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Carlo Arenas, gitgitgadget, git

[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]

Hi Junio,

On Wed, 21 Nov 2018, Junio C Hamano wrote:

> Carlo Arenas <carenas@gmail.com> writes:
> 
> > Tested-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> >
> > the C version prepends: "fatal: " unlike the shell version for both
> > error messages
> 
> In addition, "Invalid whitespace option" says 'bad', not
> '--whitespace=bad', in the builtin version.
> 
> I think the following would address both issues.

Yes! Thank you. Can you squash it in?

Thanks,
Dscho

> 
> 
>  git-legacy-rebase.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/git-legacy-rebase.sh b/git-legacy-rebase.sh
> index ced0635326..b97ffdc9dd 100755
> --- a/git-legacy-rebase.sh
> +++ b/git-legacy-rebase.sh
> @@ -340,7 +340,7 @@ do
>  		warn|nowarn|error|error-all)
>  			;; # okay, known whitespace option
>  		*)
> -			die "Invalid whitespace option: '${1%*=}'"
> +			die "fatal: Invalid whitespace option: '${1#*=}'"
>  			;;
>  		esac
>  		;;
> @@ -358,7 +358,7 @@ do
>  		force_rebase=t
>  		;;
>  	-C*[!0-9]*)
> -		die "switch \`C' expects a numerical value"
> +		die "fatal: switch \`C' expects a numerical value"
>  		;;
>  	-C*)
>  		git_am_opt="$git_am_opt $1"
> 
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-11-21 14:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-20 20:01 [PATCH 0/1] legacy-rebase: fix "regression" Johannes Schindelin via GitGitGadget
2018-11-20 20:02 ` [PATCH 1/1] legacy-rebase: backport -C<n> and --whitespace=<option> checks Johannes Schindelin via GitGitGadget
2018-11-20 23:45   ` Carlo Arenas
2018-11-21  4:40     ` Junio C Hamano
2018-11-21 14:06       ` Johannes Schindelin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).