threads / discuss / 45149

Back quote typo in error messages (?)

Subject: Back quote typo in error messages (?)

## tl;dr

8 messages between Feb 15, 2017 and Feb 16, 2017.

replies: 7people: 3as markdown or json

Fabrizio Cucci· Feb 15, 2017, 21:06 UTC · lore
Hello everyone,

it's been a couple of days that I keep noticing something (very minor) that my OCD for symmetric things can't really stand.

If you run the following command:
$ git branch --i-dont-exists
you should get:
error: unknown option `i-dont-exists'

Shouldn't the wrong flag be surrounded by two single quotes instead of a back quote and a single quote?

For the sake of completeness, I'm on Mac running Git 2.10.1.

Thanks, Fabrizio

Jeff King· Feb 15, 2017, 21:21 UTC · re: Fabrizio Cucci · lore

Re: Back quote typo in error messages (?)

On Wed, Feb 15, 2017 at 09:06:46PM +0000, Fabrizio Cucci wrote:
Show 13 quoted lines
> it's been a couple of days that I keep noticing something (very minor)
> that my OCD for symmetric things can't really stand.
> 
> If you run the following command:
> 
> $ git branch --i-dont-exists
> 
> you should get:
> 
> error: unknown option `i-dont-exists'
> 
> Shouldn't the wrong flag be surrounded by two single quotes instead of
> a back quote and a single quote?

Some people use the matched backtick/single-quote to emulate the non-symmetric start/end quotes used in traditional typography (and in fact, ``foo'' in languages like asciidoc are typically rendered using smart-quotes).

So I think what you are seeing is not wrong in the sense of being unintended by the author of the message. But I do think that git mostly uses matched double or single quotes in its error messages, and the non-symmetric quotes are relatively rare. Running:

  git grep "\`.*'" -- '*.c' ':!compat'

shows that there are only a few `quoted' cases in the code base (there are 27 matches, but many of those are false positives, and some are in comments).

I don't know how much we care about standardizing that punctuation. If we do, I suspect there is also inconsistency between single-quotes and double-quotes ('foo' versus "foo", which I think is an American versus European thing; we seem to mostly use 'foo', though).

-Peff
Junio C Hamano· Feb 15, 2017, 21:31 UTC · re: Jeff King · lore

Re: Back quote typo in error messages (?)

Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> So I think what you are seeing is not wrong in the sense of being
> unintended by the author of the message. But I do think that git mostly
> uses matched double or single quotes in its error messages, and the
> non-symmetric quotes are relatively rare. Running:
>
>   git grep "\`.*'" -- '*.c' ':!compat'
>
> shows that there are only a few `quoted' cases in the code base (there
> are 27 matches, but many of those are false positives, and some are in
> comments).
I did a simpler 
    $ git grep "\`%s'"

and saw "`git %s' is aliased to `%s'" from builtin/help.c and "unknown option `%s'" from parse-options.c (and revision.c)

What Fabrizio saw is the one in parse-options.c, so even though the number of strings in the code is small, they appear everywhere.

I agree that we should standardise them, and we should do so early in a cycle, because these appear also in .po files. It is too late for this cycle, obviously.

Fabrizio Cucci· Feb 15, 2017, 21:51 UTC · re: Jeff King · lore

Re: Back quote typo in error messages (?)

On 15 February 2017 at 21:21, Jeff King <peff@peff.net> wrote:
Show 8 quoted lines
> On Wed, Feb 15, 2017 at 09:06:46PM +0000, Fabrizio Cucci wrote:
>> Shouldn't the wrong flag be surrounded by two single quotes instead of
>> a back quote and a single quote?
>
> Some people use the matched backtick/single-quote to emulate the
> non-symmetric start/end quotes used in traditional typography (and in
> fact, ``foo'' in languages like asciidoc are typically rendered using
> smart-quotes).

I definitely didn't know about the use of them in traditional typography! But I couldn't find any example of non-symmetric quotes in AsciiDoc...

> So I think what you are seeing is not wrong in the sense of being
> unintended by the author of the message.

I had the opposite impression from the quick search in the GitHub repo, this is why I wrote here looking for some confirmation.

> I don't know how much we care about standardizing that punctuation.

I mentioned it was very minor but, still, in my opinion a project like Git deserves consistent punctuation! :)

Jeff King· Feb 15, 2017, 21:56 UTC · re: Fabrizio Cucci · lore

Re: Back quote typo in error messages (?)

On Wed, Feb 15, 2017 at 09:51:30PM +0000, Fabrizio Cucci wrote:
Show 7 quoted lines
> > Some people use the matched backtick/single-quote to emulate the
> > non-symmetric start/end quotes used in traditional typography (and in
> > fact, ``foo'' in languages like asciidoc are typically rendered using
> > smart-quotes).
> 
> I definitely didn't know about the use of them in traditional typography!
> But I couldn't find any example of non-symmetric quotes in AsciiDoc...

Grep for "``" in Git's documentation directory, and you will see many examples (asciidoc only accepts the double-quote form, not singles).

You can also try:
  echo "this is \`\`quoted'' text" >foo.txt
  asciidoc foo.txt
and then open "foo.html" in your browser.
> > I don't know how much we care about standardizing that punctuation.
> 
> I mentioned it was very minor but, still, in my opinion a project like
> Git deserves consistent punctuation! :)

I think patches would be welcome, but as Junio said, it probably should wait for the next cycle.

-Peff
Fabrizio Cucci· Feb 16, 2017, 18:41 UTC · re: Jeff King · lore

Re: Back quote typo in error messages (?)

On 15 February 2017 at 21:56, Jeff King <peff@peff.net> wrote:
Show 9 quoted lines
> Grep for "``" in Git's documentation directory, and you will see many
> examples (asciidoc only accepts the double-quote form, not singles).
>
> You can also try:
>
>   echo "this is \`\`quoted'' text" >foo.txt
>   asciidoc foo.txt
>
> and then open "foo.html" in your browser.

We are probably going a bit OT here :) but AFAIK there is no such thing as non-symmetric start/end quotes in AsciiDoc.

Even enclosing something in curved quotes is done as follows:
'`single curved quotes`'
"`double curved quotes`"
(http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/)
> I think patches would be welcome, but as Junio said, it probably should
> wait for the next cycle.
It can definitely wait and I would be glad to contribute!
Jeff King· Feb 16, 2017, 19:02 UTC · re: Fabrizio Cucci · lore

Re: Back quote typo in error messages (?)

On Thu, Feb 16, 2017 at 06:41:26PM +0000, Fabrizio Cucci wrote:
Show 21 quoted lines
> On 15 February 2017 at 21:56, Jeff King <peff@peff.net> wrote:
> > Grep for "``" in Git's documentation directory, and you will see many
> > examples (asciidoc only accepts the double-quote form, not singles).
> >
> > You can also try:
> >
> >   echo "this is \`\`quoted'' text" >foo.txt
> >   asciidoc foo.txt
> >
> > and then open "foo.html" in your browser.
> 
> We are probably going a bit OT here :) but AFAIK there is no such
> thing as non-symmetric start/end quotes in AsciiDoc.
> 
> Even enclosing something in curved quotes is done as follows:
> 
> '`single curved quotes`'
> 
> "`double curved quotes`"
> 
> (http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/)
Try the "Quoted Text" section of the original asciidoc user manual:
  http://www.methods.co.nz/asciidoc/userguide.html#X51

Asciidoctor has introduced some new syntax (almost certainly because the original asymmetric formulations have a bunch of ambiguous corner cases). By default, it disables the asymmetric versions, but they work in "compat" mode (and the newer ones do not).

Git's documentation is all written for the original asciidoc. If you build it with asciidoctor, it must be done in compat mode. This is the default when asciidoctor sees a two-line (i.e., underlined) section title, which all of our manpages have.

More details at:
  http://asciidoctor.org/docs/migration/#migration-cheatsheet

Yes, we are off-topic,. but I think it is worth clarifying Git's asciidoc compatibility expectations. :)

-Peff
Fabrizio Cucci· Feb 16, 2017, 20:58 UTC · re: Jeff King · lore

Re: Back quote typo in error messages (?)

On 16 February 2017 at 19:02, Jeff King <peff@peff.net> wrote:
Show 8 quoted lines
> Try the "Quoted Text" section of the original asciidoc user manual:
>
>   http://www.methods.co.nz/asciidoc/userguide.html#X51
>
> Asciidoctor has introduced some new syntax (almost certainly because the
> original asymmetric formulations have a bunch of ambiguous corner
> cases). By default, it disables the asymmetric versions, but they work
> in "compat" mode (and the newer ones do not).
I can't say I had the pleasure of using Asciidoctor 0.1.4 or earlier! :)
> Git's documentation is all written for the original asciidoc. If you
> build it with asciidoctor, it must be done in compat mode. This is the
> default when asciidoctor sees a two-line (i.e., underlined) section
> title, which all of our manpages have.

And I definitely didn't know that, but now I'm glad we went OT! :) Thanks a lot for the clarifications.

← back to recent threads