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

RE: [EXTERNAL] Re: BUG: git clean -d cannot remove files from read-only directories

From
AMAdam Milazzo <adam.milazzo@microsoft.com>
Date
Feb 20, 2020, 20:05 UTC
Message-ID
<BL0PR2101MB1089E3CE7738BB70B65C17B680130@BL0PR2101MB1089.namprd21.prod.outlook.com>
In-Reply-To
<CABPp-BE8t+M5A8BpkYzs-WkoKDTCR_4jiT-vqwpLriuxhx46eQ@mail.gmail.com>
> Tying permission override to e.g -ffd would be a really bad idea. People would start adopting that for the permission override reason, then someone is going to accidentally nuke a git submodule with unpushed changes.
Fair enough. I'm not arguing that it must necessarily be any kind of overloading of -f. It could just as well be a separate option. (Personally I'd say overloading -f to make "-f -f" mean "also delete untracked git repositories" was the bad idea, since that is not the obvious and intuitive meaning of "--force", whereas "try harder to delete files you would normally delete" _is_ the intuitive meaning, but the history can't be changed.)
> Also, another way to look at this; currently 'git clean -fd' behaves the same on untracked directories as 'rm -rf' does and I think that's a good model for how to behave.  Why should they be different?
I would ask "why should they be the same?", because there's no obvious reason why behavior of "git clean", whose purpose is to put a repository back to a pristine state, should always behave the same way as "rm", whose purpose is to delete a specified set of files, and more to the point there is no reason why they should have no option to behave differently. I am not arguing for the default behavior of "git clean" to change, since that could be seen as a breaking change. Also, they are already different. "git clean" will remove a read-only file. "rm" will not (without confirmation), although "rm -f" will.
Previous: Elijah NewrenNext: Junio C Hamano
Message 3 of 8 in “Re: BUG: git clean -d cannot remove files from read-only directories”
  1. Adam MilazzoFeb 20, 2020
  2. Elijah NewrenFeb 20, 2020
  3. Adam MilazzoFeb 20, 2020
  4. Junio C HamanoFeb 20, 2020
  5. Adam MilazzoFeb 20, 2020
  6. Elijah NewrenFeb 21, 2020
  7. Elijah NewrenFeb 20, 2020
  8. Junio C HamanoFeb 21, 2020

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.