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

Re: [PATCH] Minor grammar fix in the 'Not a git repository' message

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 16, 2009, 23:33 UTC
Message-ID
<7vd4diez2z.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<8787c5894e7831bbd1ace3b2fd6649f1362d4b78.1234825069u.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 8 quoted lines
> It might cause less head-scratching to say 'nor any of the parent
> directories' than 'or ...' after saying that this is not a git
> repository.
> ...
> +			die("Not a git repository (nor any of the parent directories): %s", DEFAULT_GIT_DIR_ENVIRONMENT);
>  		}
>  		if (chdir(".."))
>  			die("Cannot change to %s/..: %s", cwd, strerror(errno));

The grammar may be more correct, but I wonder if the parenthesised part is adding any value to the message or instead it is making the message more confusing.

You will get this message when you are in /a/b/c/d and no .git subdirectory was found in /a/b/c/d, nor in /a/b/c, nor in /a/b,...

But the message sounds as if the command expected ".git" to be either (1) a git repository (which is false, because ".git" would mean /a/b/c/d/.git and there is no git repository there), or (2) a parent directory (of something unspecified, but a natural interpretation is "where you are"), i.e. "I wanted you to be somewhere inside .git". That obviously is not what you wanted to say.

    "No git repository ".git" found here nor in any of the parent directories"
might be an improvement, though.
Previous: Wincent ColaiutaNext: Nicolas Sebrecht
Message 3 of 8 in “Minor grammar fix in the 'Not a git repository' message”
  1. Minor grammar fix in the 'Not a git repository' messageJohannes Schindelin, Feb 16, 2009
  2. Wincent ColaiutaFeb 16, 2009
  3. Junio C HamanoFeb 16, 2009
  4. Re: Minor grammar fix in the 'Not a git repository' messageNicolas Sebrecht, Feb 17, 2009
  5. Junio C HamanoFeb 17, 2009
  6. Boyd Stephen Smith Jr.Feb 17, 2009
  7. Jakub NarebskiFeb 17, 2009
  8. Lars NoschinskiFeb 17, 2009

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.