diff mbox series

Typo `dashes ?` -> `dashes?`

Message ID 01020166741c381f-bd183f7f-725d-4b4f-9f5f-804560b2b00b-000000@eu-west-1.amazonses.com (mailing list archive)
State New, archived
Headers show
Series Typo `dashes ?` -> `dashes?` | expand

Commit Message

Jacques Bodin-Hullin Oct. 14, 2018, 7:44 p.m. UTC
---
 parse-options.c          | 4 ++--
 t/t0040-parse-options.sh | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)


--
https://github.com/git/git/pull/540

Comments

Jeff King Oct. 15, 2018, 5:20 p.m. UTC | #1
On Sun, Oct 14, 2018 at 07:44:58PM +0000, Jacques Bodin-Hullin wrote:

> diff --git a/parse-options.c b/parse-options.c
> index 3b874a83a0c89..88512212392ae 100644
> --- a/parse-options.c
> +++ b/parse-options.c
> @@ -352,7 +352,7 @@ static void check_typos(const char *arg, const struct option *options)
>  		return;
>  
>  	if (starts_with(arg, "no-")) {
> -		error ("did you mean `--%s` (with two dashes ?)", arg);
> +		error ("did you mean `--%s` (with two dashes?)", arg);

I agree the extra space in the original is stylistically weird, and your
suggestion is an improvement. However, I think this is really a question
"did you mean..." with a parenthetical phrase. Most style guides would
recommend putting the punctuation outside, like:

  error: did you mean `--foo` (with two dashes)?

Speaking of style, the extra space between "error" and "(" does not
match our usual coding style. It might be worth removing while we're
touching these lines.

-Peff
Jeff King Oct. 17, 2018, 8:23 a.m. UTC | #2
On Mon, Oct 15, 2018 at 09:31:54PM +0200, Jacques Bodin-Hullin wrote:

> I've just updated the PR with the `error(` change.
> 
> Also I did the change for the question mark at the end, because you are
> right, when we read it, it sounds better.
> 
> Do I need to put back the patch in this thread? It's here:
> https://patch-diff.githubusercontent.com/raw/git/git/pull/540.patch

The commit looks good, though you may want to expand the commit message
a little (it's not really a typo, but more of a style fix).

The next step would normally be to send the patch to the list (ideally
in this thread), with "[PATCH v2]" in the subject.

It looks like you're using SubmitGit. I don't remember offhand how it
works for sending re-rolls like this, but I think it's possible. If you
run into trouble, you might try instead using GitGitGadget, which is a
similar PR->mail gateway that is a little more featureful:

  https://github.com/gitgitgadget/gitgitgadget

-Peff
diff mbox series

Patch

diff --git a/parse-options.c b/parse-options.c
index 3b874a83a0c89..88512212392ae 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -352,7 +352,7 @@  static void check_typos(const char *arg, const struct option *options)
 		return;
 
 	if (starts_with(arg, "no-")) {
-		error ("did you mean `--%s` (with two dashes ?)", arg);
+		error ("did you mean `--%s` (with two dashes?)", arg);
 		exit(129);
 	}
 
@@ -360,7 +360,7 @@  static void check_typos(const char *arg, const struct option *options)
 		if (!options->long_name)
 			continue;
 		if (starts_with(options->long_name, arg)) {
-			error ("did you mean `--%s` (with two dashes ?)", arg);
+			error ("did you mean `--%s` (with two dashes?)", arg);
 			exit(129);
 		}
 	}
diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh
index 5b0560fa20e34..16fd333bd3895 100755
--- a/t/t0040-parse-options.sh
+++ b/t/t0040-parse-options.sh
@@ -222,7 +222,7 @@  test_expect_success 'non ambiguous option (after two options it abbreviates)' '
 '
 
 cat >typo.err <<\EOF
-error: did you mean `--boolean` (with two dashes ?)
+error: did you mean `--boolean` (with two dashes?)
 EOF
 
 test_expect_success 'detect possible typos' '
@@ -232,7 +232,7 @@  test_expect_success 'detect possible typos' '
 '
 
 cat >typo.err <<\EOF
-error: did you mean `--ambiguous` (with two dashes ?)
+error: did you mean `--ambiguous` (with two dashes?)
 EOF
 
 test_expect_success 'detect possible typos' '