git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Back quote typo in error messages (?)
@ 2017-02-15 21:06 Fabrizio Cucci
  2017-02-15 21:21 ` Jeff King
  0 siblings, 1 reply; 8+ messages in thread
From: Fabrizio Cucci @ 2017-02-15 21:06 UTC (permalink / raw)
  To: git

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

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

* Re: Back quote typo in error messages (?)
  2017-02-15 21:06 Back quote typo in error messages (?) Fabrizio Cucci
@ 2017-02-15 21:21 ` Jeff King
  2017-02-15 21:31   ` Junio C Hamano
  2017-02-15 21:51   ` Fabrizio Cucci
  0 siblings, 2 replies; 8+ messages in thread
From: Jeff King @ 2017-02-15 21:21 UTC (permalink / raw)
  To: Fabrizio Cucci; +Cc: git

On Wed, Feb 15, 2017 at 09:06:46PM +0000, Fabrizio Cucci wrote:

> 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

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

* Re: Back quote typo in error messages (?)
  2017-02-15 21:21 ` Jeff King
@ 2017-02-15 21:31   ` Junio C Hamano
  2017-02-15 21:51   ` Fabrizio Cucci
  1 sibling, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2017-02-15 21:31 UTC (permalink / raw)
  To: Jeff King; +Cc: Fabrizio Cucci, git

Jeff King <peff@peff.net> writes:

> 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.


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

* Re: Back quote typo in error messages (?)
  2017-02-15 21:21 ` Jeff King
  2017-02-15 21:31   ` Junio C Hamano
@ 2017-02-15 21:51   ` Fabrizio Cucci
  2017-02-15 21:56     ` Jeff King
  1 sibling, 1 reply; 8+ messages in thread
From: Fabrizio Cucci @ 2017-02-15 21:51 UTC (permalink / raw)
  To: Jeff King; +Cc: git

On 15 February 2017 at 21:21, Jeff King <peff@peff.net> wrote:

> 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! :)

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

* Re: Back quote typo in error messages (?)
  2017-02-15 21:51   ` Fabrizio Cucci
@ 2017-02-15 21:56     ` Jeff King
  2017-02-16 18:41       ` Fabrizio Cucci
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff King @ 2017-02-15 21:56 UTC (permalink / raw)
  To: Fabrizio Cucci; +Cc: git

On Wed, Feb 15, 2017 at 09:51:30PM +0000, Fabrizio Cucci wrote:

> > 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

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

* Re: Back quote typo in error messages (?)
  2017-02-15 21:56     ` Jeff King
@ 2017-02-16 18:41       ` Fabrizio Cucci
  2017-02-16 19:02         ` Jeff King
  0 siblings, 1 reply; 8+ messages in thread
From: Fabrizio Cucci @ 2017-02-16 18:41 UTC (permalink / raw)
  To: Jeff King; +Cc: git

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/)

> 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!

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

* Re: Back quote typo in error messages (?)
  2017-02-16 18:41       ` Fabrizio Cucci
@ 2017-02-16 19:02         ` Jeff King
  2017-02-16 20:58           ` Fabrizio Cucci
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff King @ 2017-02-16 19:02 UTC (permalink / raw)
  To: Fabrizio Cucci; +Cc: git

On Thu, Feb 16, 2017 at 06:41:26PM +0000, Fabrizio Cucci wrote:

> 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

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

* Re: Back quote typo in error messages (?)
  2017-02-16 19:02         ` Jeff King
@ 2017-02-16 20:58           ` Fabrizio Cucci
  0 siblings, 0 replies; 8+ messages in thread
From: Fabrizio Cucci @ 2017-02-16 20:58 UTC (permalink / raw)
  To: Jeff King; +Cc: git

On 16 February 2017 at 19:02, Jeff King <peff@peff.net> wrote:
> 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.

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

end of thread, other threads:[~2017-02-16 20:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-15 21:06 Back quote typo in error messages (?) Fabrizio Cucci
2017-02-15 21:21 ` Jeff King
2017-02-15 21:31   ` Junio C Hamano
2017-02-15 21:51   ` Fabrizio Cucci
2017-02-15 21:56     ` Jeff King
2017-02-16 18:41       ` Fabrizio Cucci
2017-02-16 19:02         ` Jeff King
2017-02-16 20:58           ` Fabrizio Cucci

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).