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

Re: git probably bug

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 26, 2015, 21:36 UTC
Message-ID
<xmqqegpcl5is.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1424979584.784776482@f205.i.mail.ru>
Виталий Бормотов  <bormvit@mail.ru> writes:
Show 6 quoted lines
> When checking out into some different
> state, if there is no permissions to unlink files (if some files in
> the current state doesn't exist in the new) warnings are outputing,
> but then git says that checking out is successful, shows that we are
> in the new state and the non-unlinked files are marked as
> untracked.

This is done by reasonably old part of the codebase, and I think it is exactly working as designed. Unlinking of an existing path in the filesystem is done for one of the two reasons:

 - The old tree has the path, the new tree does not.
 - The old tree has the path, the new tree has it but with a
   different content.

In both cases, we first attempt to unlink (and warn if we cannot) and then attempt to create the path with the new contents in the latter case (and die if we cannot).

The checkout itself succeeds, because having untracked cruft in your working tree is not an error, but warnings are given to let you know that you may want to remove them after fixing the screwy permission problem yourself.

Previous: Виталий Бормотов
Message 2 of 2 in “git probably bug”
  1. Виталий БормотовFeb 26, 2015
  2. Junio C HamanoFeb 26, 2015

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.