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

Re: [PATCH] fsck: warn about '.' and '..' in trees

From
Jeff King <peff@peff.net>
Date
Nov 28, 2012, 04:34 UTC
Message-ID
<20121128043433.GB5362@sigill.intra.peff.net>
In-Reply-To
<20121128043215.GA5362@sigill.intra.peff.net>
On Tue, Nov 27, 2012 at 11:32:16PM -0500, Jeff King wrote:
Show 12 quoted lines
>   $ check dot .
>   error: Invalid path '.'
> 
>   $ check dotdot ..
>   error: Updating '..' would lose untracked files in it
> 
>   $ check dotgit .git
>   error: Updating '.git' would lose untracked files in it
> 
> Interesting that we detect the first one while reading into the cache,
> but apparently try much harder to checkout on the latter two. Not sure I
> want to try "git checkout -f". :)

Actually, I take it back. The "untracked files" check comes _first_, and if you do "-f", we end up in the verify_path check when trying to pull the tree into the index. So I think the way git handles it makes sense.

-Peff
Previous: Jeff King
Message 4 of 4 in “fsck: warn about '.' and '..' in trees”
  1. fsck: warn about '.' and '..' in treesJeff King, Nov 28, 2012
  2. Nguyen Thai Ngoc DuyNov 28, 2012
  3. Jeff KingNov 28, 2012
  4. Jeff KingNov 28, 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.