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

Re: [PATCH v3] read_gitfile(): simplify NOT_A_REPO error message

From
Jeff King <peff@peff.net>
Date
Jun 16, 2026, 14:45 UTC
Message-ID
<20260616144554.GA2305974@coredump.intra.peff.net>
In-Reply-To
<xmqq7bnya7gh.fsf@gitster.g>
On Tue, Jun 16, 2026 at 07:25:02AM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> >     +@@ t/t7450-bad-git-dotfiles.sh: test_expect_success 'git dirs of sibling submodules must not be nested' '
> >     + test_expect_success 'submodule git dir nesting detection must work with parallel cloning' '
> >     + 	test_must_fail git clone --recurse-submodules --jobs=2 nested clone_parallel 2>err &&
> >     + 	cat err &&
> >     +-	grep -E "(already exists|is inside git dir|not a git repository)" err &&
> >     ++	grep -E "(already exists|is inside git dir|does not point to a valid repository)" err &&
> 
> A few things.
> 
>  * Will we be happy to see only one of these possibilities, or do we
>    expect to see these once for each kind?

I imagine it is only one. This all comes from 9cf8547320 (clone: prevent clashing git dirs when cloning submodule in parallel, 2024-01-28), and it is expecting the nested path to cause a failure. Which failure I guess depends on the racy ordering. If we create the inner one first, then we probably get "already exists", and if the outer one, then "is inside git dir". I don't know exactly what sequence yields the NOT_A_REPO message.

But none of that is changing in this patch, just what the user-visible text is for the NOT_A_REPO case.

I did briefly wonder if we might see "not a git repository" from a _different_ code path, and need to catch it along with the new message. But running successfully with --stress implies that we never see the old one anymore.

>  * a recently started in-flight topic tries to catch bare "grep" and
>    fails until you write test_grep X-<.

Yeah. This will create a merge conflict for you, but hopefully the resolution should be obvious. I don't think it makes sense to fix here, as it's orthogonal to the purpose of the patch.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 12 in “read_gitfile_gently(): return non-repo path on error”
  1. read_gitfile_gently(): return non-repo path on errorJeff King, Jun 2, 2026
  2. Junio C HamanoJun 2, 2026
  3. Jeff KingJun 2, 2026
  4. Patrick SteinhardtJun 2, 2026
  5. Jeff KingJun 4, 2026
  6. Patrick SteinhardtJun 4, 2026
  7. Junio C HamanoJun 10, 2026
  8. read_gitfile(): simplify NOT_A_REPO error messageJeff King, Jun 16, 2026
  9. read_gitfile(): simplify NOT_A_REPO error messageJeff King, Jun 16, 2026
  10. Junio C HamanoJun 16, 2026
  11. Jeff KingJun 16, 2026
  12. Junio C HamanoJun 16, 2026

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.