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

Re: Back quote typo in error messages (?)

From
Jeff King <peff@peff.net>
Date
Feb 15, 2017, 21:21 UTC
Message-ID
<20170215212157.qgscyglgzrd5cplf@sigill.intra.peff.net>
In-Reply-To
<CAOxYW4z=bABqhmHWCc9rizykMcGBjDvqLEuqpJ6DtPve5442Fw@mail.gmail.com>
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
Previous: Fabrizio CucciNext: Junio C Hamano
Message 2 of 8 in “Back quote typo in error messages (?)”
  1. Fabrizio CucciFeb 15, 2017
  2. Jeff KingFeb 15, 2017
  3. Junio C HamanoFeb 15, 2017
  4. Fabrizio CucciFeb 15, 2017
  5. Jeff KingFeb 15, 2017
  6. Fabrizio CucciFeb 16, 2017
  7. Jeff KingFeb 16, 2017
  8. Fabrizio CucciFeb 16, 2017

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.