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

Re: [BUG] "git clean -df ." silently doesn't delete folders with stale .nfs* files

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 10, 2024, 21:37 UTC
Message-ID
<xmqqikygzdgk.fsf@gitster.g>
In-Reply-To
<4ed426e4-beb6-45ed-b493-1e19c7c0511b@rawbw.com>
Yuri <yuri@rawbw.com> writes:
Show 12 quoted lines
> On 6/10/24 12:58, Junio C Hamano wrote:
>> So "was supposed to remove" above is not quite correct. Where did
>> such a piece of misinformation come from?
>
>
> "git clean -df ." removes all files that
>
> (1) aren't added to the repo
>
> (2) aren't added as exceptions
>
> (3) aren't repo files themselves.

But .nfs* files are not something you as an application are not supposed to touch, so a directory that still contains one cannot be removed, either.

It's a limitation (I wouldn't call it a "bug") of NFS. You can kill the process (or wait until they exit) holding the file open and then run "clean -df" again, perhaps.

A few Google searches tell us more, e.g.
 - https://nfs.sourceforge.net/#faq_d2
 - https://kb.netapp.com/on-prem/ontap/da/NAS/NAS-KBs/What_are_nfsXXXX_files_and_how_do_I_delete_them

They tell us what these files, which are the result of "silly rename", are, why they exist, and that they will appear again even if we remove them. So we don't remove them, which means the directory that contains them will not become empty, which in turn means we do not remove them.

Previous: YuriNext: Yuri
Message 4 of 17 in “[BUG] "git clean -df ." silently doesn't delete folders with stale .nfs* files”
  1. YuriJun 10, 2024
  2. Junio C HamanoJun 10, 2024
  3. YuriJun 10, 2024
  4. Junio C HamanoJun 10, 2024
  5. YuriJun 10, 2024
  6. rsbecker@nexbridge.comJun 10, 2024
  7. Junio C HamanoJun 11, 2024
  8. 'Yuri'Jun 11, 2024
  9. rsbecker@nexbridge.comJun 11, 2024
  10. 'Yuri'Jun 11, 2024
  11. Chris TorekJun 11, 2024
  12. Jeff KingJun 11, 2024
  13. 'Yuri'Jun 11, 2024
  14. Gabor GombasJun 13, 2024
  15. 'Yuri'Jun 13, 2024
  16. rsbecker@nexbridge.comJun 11, 2024
  17. 'Yuri'Jun 11, 2024

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.