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

Re: [PATCH] fsck: warn about ".git" in trees

From
Jeff King <peff@peff.net>
Date
Nov 30, 2012, 19:55 UTC
Message-ID
<20121130195509.GA8591@sigill.intra.peff.net>
In-Reply-To
<50B90E11.8090501@web.de>
On Fri, Nov 30, 2012 at 08:50:41PM +0100, Torsten Bögershausen wrote:
Show 11 quoted lines
> >Having a ".git" entry inside a tree can cause confusing
> >results on checkout. At the top-level, you could not
> >checkout such a tree, as it would complain about overwriting
> >the real ".git" directory. In a subdirectory, you might
> >check it out, but performing operations in the subdirectory
> >would confusingly consider the in-tree ".git" directory as
> >the repository.
> [snip]
> >+	int has_dotgit = 0;
> 
> Name like "." or ".." are handled as directories by the OS.

Right. In theory git could run on a system that does not treat them specially, but in practice they are going to be problematic on most systems.

> ".git" could be a file or a directory, at least in theory, and from
> the OS point of view, but we want to have this as a reserved name.
Exactly.
> Looking at bad directory names, which gives trouble when checking out:
> 
> Should we check for "/" or "../blabla" as well?

We do already (the error is "contains full pathnames"). We also cover empty pathnames and some other cases.

-Peff
Previous: Torsten BögershausenNext: Andreas Ericsson
Message 3 of 4 in “fsck: warn about ".git" in trees”
  1. fsck: warn about ".git" in treesJeff King, Nov 28, 2012
  2. Torsten BögershausenNov 30, 2012
  3. Jeff KingNov 30, 2012
  4. Andreas EricssonDec 4, 2012

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.