{"thread":{"id":"49869","subject":"[PATCH 0/1] legacy-rebase: fix \"regression\"","startedAt":"2018-11-20T20:02:02Z","lastAt":"2018-11-21T14:06:40Z","messageCount":5,"participants":["Johannes Schindelin via GitGitGadget","Carlo Arenas","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"363776","messageId":"pull.86.git.gitgitgadget@gmail.com","threadId":"49869","inReplyTo":null,"subject":"[PATCH 0/1] legacy-rebase: fix \"regression\"","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-11-20T20:01:59Z","receivedAt":"2018-11-20T20:02:02Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"This is a backport, really, to accommodate a new regression test that was\nintroduced when the built-in rebase learned to validate the -C<n> and \n--whitespace=<option> arguments early.\n\nJohannes Schindelin (1):\n  legacy-rebase: backport -C<n> and --whitespace=<option> checks\n\n git-legacy-rebase.sh | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\n\nbase-commit: bb75be6cb916297f271c846f2f9caa3daaaec718\nPublished-As: https://github.com/gitgitgadget/git/releases/tags/pr-86%2Fdscho%2Fscripted-rebase-Cn-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-86/dscho/scripted-rebase-Cn-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/86\n-- \ngitgitgadget\n"},{"id":"363777","messageId":"84e65a4efb3d58ca777cd59c52fe86d63060ea9e.1542744118.git.gitgitgadget@gmail.com","threadId":"49869","inReplyTo":"pull.86.git.gitgitgadget@gmail.com","subject":"[PATCH 1/1] legacy-rebase: backport -C<n> and --whitespace=<option> checks","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-11-20T20:02:01Z","receivedAt":"2018-11-20T20:02:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSince 04519d720114 (rebase: validate -C<n> and --whitespace=<mode>\nparameters early, 2018-11-14), the built-in rebase validates the -C and\n--whitespace arguments early. As this commit also introduced a\nregression test for this, and as a later commit introduced the\nGIT_TEST_REBASE_USE_BUILTIN mode to run tests, we now have a\n\"regression\" in the scripted version of `git rebase` on our hands.\n\nBackport the validation to fix this.\n\nReported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git-legacy-rebase.sh | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/git-legacy-rebase.sh b/git-legacy-rebase.sh\nindex 75a08b2683..ced0635326 100755\n--- a/git-legacy-rebase.sh\n+++ b/git-legacy-rebase.sh\n@@ -337,6 +337,11 @@ do\n \t\tfix|strip)\n \t\t\tforce_rebase=t\n \t\t\t;;\n+\t\twarn|nowarn|error|error-all)\n+\t\t\t;; # okay, known whitespace option\n+\t\t*)\n+\t\t\tdie \"Invalid whitespace option: '${1%*=}'\"\n+\t\t\t;;\n \t\tesac\n \t\t;;\n \t--ignore-whitespace)\n@@ -352,6 +357,9 @@ do\n \t\tgit_am_opt=\"$git_am_opt $1\"\n \t\tforce_rebase=t\n \t\t;;\n+\t-C*[!0-9]*)\n+\t\tdie \"switch \\`C' expects a numerical value\"\n+\t\t;;\n \t-C*)\n \t\tgit_am_opt=\"$git_am_opt $1\"\n \t\t;;\n-- \ngitgitgadget\n"},{"id":"363787","messageId":"CAPUEspgxNm9oEA-fuT7kBegEp5F2za5Nm6CSvFkMB+Kz_pNbrw@mail.gmail.com","threadId":"49869","inReplyTo":"84e65a4efb3d58ca777cd59c52fe86d63060ea9e.1542744118.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] legacy-rebase: backport -C<n> and --whitespace=<option> checks","fromName":"Carlo Arenas","fromEmail":"carenas@gmail.com","sentAt":"2018-11-20T23:45:52Z","receivedAt":"2018-11-20T23:46:10Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"Tested-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n\nthe C version prepends: \"fatal: \" unlike the shell version for both\nerror messages\n\nCarlo\n"},{"id":"363804","messageId":"xmqqin0r82mu.fsf@gitster-ct.c.googlers.com","threadId":"49869","inReplyTo":"CAPUEspgxNm9oEA-fuT7kBegEp5F2za5Nm6CSvFkMB+Kz_pNbrw@mail.gmail.com","subject":"Re: [PATCH 1/1] legacy-rebase: backport -C<n> and --whitespace=<option> checks","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-11-21T04:40:09Z","receivedAt":"2018-11-21T04:40:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carlo Arenas <carenas@gmail.com> writes:\n\n> Tested-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n>\n> the C version prepends: \"fatal: \" unlike the shell version for both\n> error messages\n\nIn addition, \"Invalid whitespace option\" says 'bad', not\n'--whitespace=bad', in the builtin version.\n\nI think the following would address both issues.\n\n\n git-legacy-rebase.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-legacy-rebase.sh b/git-legacy-rebase.sh\nindex ced0635326..b97ffdc9dd 100755\n--- a/git-legacy-rebase.sh\n+++ b/git-legacy-rebase.sh\n@@ -340,7 +340,7 @@ do\n \t\twarn|nowarn|error|error-all)\n \t\t\t;; # okay, known whitespace option\n \t\t*)\n-\t\t\tdie \"Invalid whitespace option: '${1%*=}'\"\n+\t\t\tdie \"fatal: Invalid whitespace option: '${1#*=}'\"\n \t\t\t;;\n \t\tesac\n \t\t;;\n@@ -358,7 +358,7 @@ do\n \t\tforce_rebase=t\n \t\t;;\n \t-C*[!0-9]*)\n-\t\tdie \"switch \\`C' expects a numerical value\"\n+\t\tdie \"fatal: switch \\`C' expects a numerical value\"\n \t\t;;\n \t-C*)\n \t\tgit_am_opt=\"$git_am_opt $1\"\n\n\n"},{"id":"363828","messageId":"nycvar.QRO.7.76.6.1811211506120.41@tvgsbejvaqbjf.bet","threadId":"49869","inReplyTo":"xmqqin0r82mu.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 1/1] legacy-rebase: backport -C<n> and --whitespace=<option> checks","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-11-21T14:06:34Z","receivedAt":"2018-11-21T14:06:40Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Wed, 21 Nov 2018, Junio C Hamano wrote:\n\n> Carlo Arenas <carenas@gmail.com> writes:\n> \n> > Tested-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n> >\n> > the C version prepends: \"fatal: \" unlike the shell version for both\n> > error messages\n> \n> In addition, \"Invalid whitespace option\" says 'bad', not\n> '--whitespace=bad', in the builtin version.\n> \n> I think the following would address both issues.\n\nYes! Thank you. Can you squash it in?\n\nThanks,\nDscho\n\n> \n> \n>  git-legacy-rebase.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/git-legacy-rebase.sh b/git-legacy-rebase.sh\n> index ced0635326..b97ffdc9dd 100755\n> --- a/git-legacy-rebase.sh\n> +++ b/git-legacy-rebase.sh\n> @@ -340,7 +340,7 @@ do\n>  \t\twarn|nowarn|error|error-all)\n>  \t\t\t;; # okay, known whitespace option\n>  \t\t*)\n> -\t\t\tdie \"Invalid whitespace option: '${1%*=}'\"\n> +\t\t\tdie \"fatal: Invalid whitespace option: '${1#*=}'\"\n>  \t\t\t;;\n>  \t\tesac\n>  \t\t;;\n> @@ -358,7 +358,7 @@ do\n>  \t\tforce_rebase=t\n>  \t\t;;\n>  \t-C*[!0-9]*)\n> -\t\tdie \"switch \\`C' expects a numerical value\"\n> +\t\tdie \"fatal: switch \\`C' expects a numerical value\"\n>  \t\t;;\n>  \t-C*)\n>  \t\tgit_am_opt=\"$git_am_opt $1\"\n> \n> \n> "}]}