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

Re: [PATCH 0/1] Fix two documentation typos

From
Jeff King <peff@peff.net>
Date
Aug 3, 2019, 23:59 UTC
Message-ID
<20190803235914.GA5353@sigill.intra.peff.net>
In-Reply-To
<xmqqsgqii9u3.fsf@gitster-ct.c.googlers.com>
On Sat, Aug 03, 2019 at 07:48:20AM -0700, Junio C Hamano wrote:
Show 7 quoted lines
> > Then I noticed a "can not" and updated that and other occurrences in
> > Documentation to cannot. The glossary sentence with "can not" was
> > "Consequently, an object can not be changed." To me, that reads like "it is
> 
> Hmph, I am not a native speaker, but I have to say that this is the
> first time I heard that "I can not drive" to mean "I have a choice
> of not driving (even though I am capable of driving)".

I think in writing I would assume that "can not" is "unable to" (and a brief skim of online resources indicates they have equivalent meanings). But colloquially, I might say something like: "I can _not_ put mushrooms in the soup if you'd prefer" (where the underscores indicate an emphasis I'd give when speaking).

So I don't find it overly ambiguous, but I think there's no reason not to prefer "cannot".

That said, I think in many error messages, "unable to" is often better (and we already use it quite frequently). This one (that Mark mentioned but didn't change in this patch) is especially bad:

  $ git grep -in 'can not' '*.c' | head -1
  builtin/checkout.c:834: fprintf(stderr, _("Can not do reflog for '%s': %s\n"),

because of the vague "do". Maybe "unable to create reflog for '%s': %s'" would be better. Also, why isn't this an error()?

The other one he mentioned:
  $ git --no-pager grep -B2 -A3 'can not' builtin/mv.c
  builtin/mv.c-		else if (!strncmp(src, dst, length) &&
  builtin/mv.c-				(dst[length] == 0 || dst[length] == '/')) {
  builtin/mv.c:			bad = _("can not move directory into itself");
  builtin/mv.c-		} else if ((src_is_dir = S_ISDIR(st.st_mode))
  builtin/mv.c-				&& lstat(dst, &st) == 0)
  builtin/mv.c-			bad = _("cannot move directory over file");

is rather egregious as the message just below uses "cannot". And here "cannot" makes more sense to me than "unable to", as we did not try a thing that failed; it is literally something that one cannot do at all, because it does not make sense. So it is Git saying "you cannot do this", not "I was unable to do this". :)

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 5 in “Fix two documentation typos”
  1. 0/1 Fix two documentation typosMark Rushakoff via GitGitGadget, Aug 3, 2019
  2. 1/1 doc: typo: s/can not/cannot/ and s/is does/does/Mark Rushakoff via GitGitGadget, Aug 3, 2019
  3. Junio C HamanoAug 3, 2019
  4. Jeff KingAug 3, 2019
  5. Junio C HamanoAug 5, 2019

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.