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

Re: [PATCH 1/1] legacy-rebase: backport -C<n> and --whitespace=<option> checks

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 21, 2018, 04:40 UTC
Message-ID
<xmqqin0r82mu.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAPUEspgxNm9oEA-fuT7kBegEp5F2za5Nm6CSvFkMB+Kz_pNbrw@mail.gmail.com>
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"
Previous: Carlo ArenasNext: Johannes Schindelin
Message 4 of 5 in “legacy-rebase: fix "regression"”
  1. 0/1 legacy-rebase: fix "regression"Johannes Schindelin via GitGitGadget, Nov 20, 2018
  2. 1/1 legacy-rebase: backport -C<n> and --whitespace=<option> checksJohannes Schindelin via GitGitGadget, Nov 20, 2018
  3. Carlo ArenasNov 20, 2018
  4. Junio C HamanoNov 21, 2018
  5. Johannes SchindelinNov 21, 2018

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.