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

Re: [PATCH] setup.c: don't try to access '//HEAD' during repo discovery

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 3, 2017, 12:36 UTC
Message-ID
<alpine.DEB.2.21.1.1711031334000.6482@virtualbox>
In-Reply-To
<20171103010645.25499-1-szeder.dev@gmail.com>
Hi Gábor,
On Fri, 3 Nov 2017, SZEDER Gábor wrote:
Show 11 quoted lines
> Commit ce9b8aab5 (setup_git_directory_1(): avoid changing global state,
> 2017-03-13) changed how the git directory is discovered, and as a side
> effect when the discovery reaches the root directory Git tries to
> access paths like '//HEAD' and '//objects'.  This interacts badly with
> Cygwin, which interprets it as a UNC file share, and so demand-loads a
> bunch of extra DLLs and attempts to resolve/contact the server named
> HEAD.  This obviously doesn't work too well, especially over a slow
> network link.
> 
> Special case the root directory in is_git_directory() to prevent
> accessing paths with leading double slashes.

I would rather not special-case the (Unix) root directory. The underlying problem, as Peff pointed out, is that an extra slash is appended if the directory. And as `is_git_directory()` is not marked as static, we must assume that there are other callers that may pass in directory paths ending in a slash already.

Ciao, Dscho

Previous: SZEDER Gábor
Message 6 of 6 in “git tries to stat //HEAD when searching for a repo, leading to huge delays on Cygwin”
  1. Andrew BaumannNov 2, 2017
  2. Jeff KingNov 3, 2017
  3. Johannes SchindelinNov 3, 2017
  4. Jeff KingNov 3, 2017
  5. setup.c: don't try to access '//HEAD' during repo discoverySZEDER Gábor, Nov 3, 2017
  6. Johannes SchindelinNov 3, 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.