Re: [Feature Request] Option to make .git not read-only in cloned repos
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 26, 2019, 14:38 UTC
- Message-ID
- <xmqq5zmkkn4a.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <34935414-4e69-114b-7a32-f94514e3679d@iee.email>
Philip Oakley <philipoakley@iee.email> writes:
Show 5 quoted lines
> Surely (?), if we are considering our stored revisions to be > immutable, then removing the write bit is the right thing to do. > If I understand correctly (*) we don't separate the delete permission > from 'no-write' permissions, so the consequence will be that such > files are read-only.
And directories (e.g. .git/objects/) are not made read-only for obvious reasons. Read-only files inside a writeable directory can be deleted just like read-write ones can be (iow, the "delete permission" comes from the "write permission" of the containing directory) so "rm -r .git" should "work" just fine (depending on the definition of working, of course---it is discouraged to throw away your work).
Perhaps Windows filesystem or file manager application behave differently and tries to protect users from removing read-only files in read-write folders by mistake, or something? If that is what the thread is complaining about, I agree that's a bit unfortunate. Perhaps Windows port can implement "this is an immultable file---do not write into it" slightly differently in adjust_shared_perm()?