Re: [PATCH 8/8] dir: avoid removing the current working directory
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 24, 2021, 19:46 UTC
- Message-ID
- <xmqqk0gx1gmz.fsf@gitster.g>
- In-Reply-To
- <bf9b547d-f421-49f7-9dc5-cc1f81187127@iee.email>
Philip Oakley <philipoakley@iee.email> writes:
Show 16 quoted lines
> On 24/11/2021 11:14, Ævar Arnfjörð Bjarmason wrote: >> I'm not concerned that you didn't research this change well enough, I >> just find it a bit iffy to introduce semantics in git around FS >> operations that don't conform with that of POSIX & the underlying OS. My >> *nix system happily accepts an "rm -rf" or an "rmdir" of the directory >> I'm in, I'd expect git to do the same. > Isn't this the same, conceptually, as trying to remove the root > directory, but from a Git perspective? > > i.e. Something along the lines of > https://superuser.com/questions/542978/is-it-possible-to-remove-the-root-directory > (their answer is 'no' without a special option, default since 2006) > > If I read the arguments correctly, Elijah is saying that Git shouldn't > delete it's own root (cwd) directory, and that it is already implicit > within the current Git code.
I do not think it is about protecting "root"; the series wants
cd t/ && git rm -r ../t
to leave an empty directory at 't/', because "git rm" was started in that directory.