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

Re: [PATCH] setup: avoid double slashes when looking for HEAD

From
Jeff King <peff@peff.net>
Date
Nov 3, 2017, 18:38 UTC
Message-ID
<20171103183836.zpsspuj2xbufuu7u@sigill.intra.peff.net>
In-Reply-To
<9322728aaa3010c0b71574eb5876548487d66885.1509713589.git.johannes.schindelin@gmx.de>
On Fri, Nov 03, 2017 at 01:58:02PM +0100, Johannes Schindelin wrote:
Show 18 quoted lines
> From: Jeff King <peff@peff.net>
> 
> Andrew Baumann reported that when called outside of any Git worktree,
> `git rev-parse --is-inside-work-tree` eventually tries to access
> `//HEAD`, i.e.  any `HEAD` file in the root directory, but with a double
> slash.
> 
> This double slash is not only unintentional, but is allowed by the POSIX
> standard to have a special meaning. And most notably on Windows, it
> does, where it refers to a UNC path of the form `//server/share/`.
> 
> As a consequence, afore-mentioned `rev-parse` call not only looks for
> the wrong thing, but it also causes serious delays, as Windows will try
> to access a server called `HEAD`.  Let's simply avoid the unintended
> double slash.
> 
> Signed-off-by: Jeff King <peff@peff.net>
> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>

Thanks, this explanation looks good to me (and the patch is flawless, of course ;) ).

-Peff
Previous: Johannes Schindelin
Message 2 of 2 in “setup: avoid double slashes when looking for HEAD”
  1. setup: avoid double slashes when looking for HEADJohannes Schindelin, Nov 3, 2017
  2. Jeff KingNov 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.