{"thread":{"id":"51717","subject":"[Feature Request] Option to make .git not read-only in cloned repos","startedAt":"2019-08-23T20:44:13Z","lastAt":"2019-08-31T20:42:31Z","messageCount":18,"participants":["Albert Vaca Cintora","Kevin Daudt","Johannes Sixt","Philip Oakley","Randall S. Becker","Junio C Hamano","SZEDER Gábor","Michal Suchánek"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"381030","messageId":"CAAQViEsZW4PzHr5BrkDHU2kSd_e04n02McGPgrmXGZMpgaTePg@mail.gmail.com","threadId":"51717","inReplyTo":null,"subject":"[Feature Request] Option to make .git not read-only in cloned repos","fromName":"Albert Vaca Cintora","fromEmail":"albertvaka@gmail.com","sentAt":"2019-08-23T20:43:45Z","receivedAt":"2019-08-23T20:44:13Z","isPatch":false,"sender":{"key":"albertvaka@gmail.com","avatar":"https://gravatar.com/avatar/43c0c20a97d21b8e4c969b026c0d67a4131a7f5c2fd76b679205dbda879dcf53?d=mp&s=160"},"body":"Hi git folks,\n\nHonestly I'm not aware of the reason behind .git being read-only, but\nI'm sure there is one.\n\nHowever, I'm sure that a large percentage of developers out there will\nagree with me that having to use force (-f) to delete every cloned\nrepo is annoying, and even worse, it creates the bad habit of always\nforce-deleting everything.\n\nWould you find reasonable to add an option to keep .git writable on\ncloned repos?\n\nPS: I'm not subscribed to the list, so please CC me on replies.\n\nThanks!\nAlbert\n"},{"id":"381109","messageId":"20190825115929.GA21463@alpha","threadId":"51717","inReplyTo":"CAAQViEsZW4PzHr5BrkDHU2kSd_e04n02McGPgrmXGZMpgaTePg@mail.gmail.com","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Kevin Daudt","fromEmail":"me@ikke.info","sentAt":"2019-08-25T11:59:29Z","receivedAt":"2019-08-25T12:07:58Z","isPatch":false,"sender":{"key":"me@ikke.info","avatar":"https://avatars.githubusercontent.com/u/135698?v=4"},"body":"On Fri, Aug 23, 2019 at 10:43:45PM +0200, Albert Vaca Cintora wrote:\n> Hi git folks,\n> \n> Honestly I'm not aware of the reason behind .git being read-only, but\n> I'm sure there is one.\n> \n> However, I'm sure that a large percentage of developers out there will\n> agree with me that having to use force (-f) to delete every cloned\n> repo is annoying, and even worse, it creates the bad habit of always\n> force-deleting everything.\n> \n> Would you find reasonable to add an option to keep .git writable on\n> cloned repos?\n> \n> PS: I'm not subscribed to the list, so please CC me on replies.\n> \n> Thanks!\n> Albert\n\nTo clarify, you are probably referring to things like pack-files, which\nare created read-only. Most files / directories in .git are writable.\n\nIt think this is already quite old behavior and I could not find any\nreference as to why this is done.\n"},{"id":"381116","messageId":"CAAQViEtpKprahB7AJKQNWDj=3EOeyRwshstcM7ZtQ88Ve934Ug@mail.gmail.com","threadId":"51717","inReplyTo":"20190825115929.GA21463@alpha","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Albert Vaca Cintora","fromEmail":"albertvaka@gmail.com","sentAt":"2019-08-25T14:39:27Z","receivedAt":"2019-08-25T14:39:56Z","isPatch":false,"sender":{"key":"albertvaka@gmail.com","avatar":"https://gravatar.com/avatar/43c0c20a97d21b8e4c969b026c0d67a4131a7f5c2fd76b679205dbda879dcf53?d=mp&s=160"},"body":"On Sun, Aug 25, 2019 at 1:59 PM Kevin Daudt <me@ikke.info> wrote:\n>\n> On Fri, Aug 23, 2019 at 10:43:45PM +0200, Albert Vaca Cintora wrote:\n> > Hi git folks,\n> >\n> > Honestly I'm not aware of the reason behind .git being read-only, but\n> > I'm sure there is one.\n> >\n> > However, I'm sure that a large percentage of developers out there will\n> > agree with me that having to use force (-f) to delete every cloned\n> > repo is annoying, and even worse, it creates the bad habit of always\n> > force-deleting everything.\n> >\n> > Would you find reasonable to add an option to keep .git writable on\n> > cloned repos?\n> >\n> > PS: I'm not subscribed to the list, so please CC me on replies.\n> >\n> > Thanks!\n> > Albert\n>\n> To clarify, you are probably referring to things like pack-files, which\n> are created read-only. Most files / directories in .git are writable.\n>\n> It think this is already quite old behavior and I could not find any\n> reference as to why this is done.\n\nIndeed, not all files in .git are read-only. I'm talking about those which are.\n\nOn Sun, Aug 25, 2019 at 1:59 PM Kevin Daudt <me@ikke.info> wrote:\n>\n> On Fri, Aug 23, 2019 at 10:43:45PM +0200, Albert Vaca Cintora wrote:\n> > Hi git folks,\n> >\n> > Honestly I'm not aware of the reason behind .git being read-only, but\n> > I'm sure there is one.\n> >\n> > However, I'm sure that a large percentage of developers out there will\n> > agree with me that having to use force (-f) to delete every cloned\n> > repo is annoying, and even worse, it creates the bad habit of always\n> > force-deleting everything.\n> >\n> > Would you find reasonable to add an option to keep .git writable on\n> > cloned repos?\n> >\n> > PS: I'm not subscribed to the list, so please CC me on replies.\n> >\n> > Thanks!\n> > Albert\n>\n> To clarify, you are probably referring to things like pack-files, which\n> are created read-only. Most files / directories in .git are writable.\n>\n> It think this is already quite old behavior and I could not find any\n> reference as to why this is done.\n"},{"id":"381118","messageId":"d31b871a-5c2d-99e7-5616-6f43759bb948@kdbg.org","threadId":"51717","inReplyTo":"CAAQViEsZW4PzHr5BrkDHU2kSd_e04n02McGPgrmXGZMpgaTePg@mail.gmail.com","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2019-08-25T17:54:35Z","receivedAt":"2019-08-25T17:54:40Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 23.08.19 um 22:43 schrieb Albert Vaca Cintora:\n> However, I'm sure that a large percentage of developers out there will\n> agree with me that having to use force (-f) to delete every cloned\n> repo is annoying, and even worse, it creates the bad habit of always\n> force-deleting everything.\n\nIMO, the bad habit is to delete cloned repositories all the time. If\nyour workflow necessitates this, then you are doing something wrong.\nMaybe you have an X-Y-problem?\n\n-- Hannes\n"},{"id":"381125","messageId":"CAAQViEv1_YXPxLRN=eT7yQhro55K4audnouzAjjbHhJsU7pgQA@mail.gmail.com","threadId":"51717","inReplyTo":"d31b871a-5c2d-99e7-5616-6f43759bb948@kdbg.org","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Albert Vaca Cintora","fromEmail":"albertvaka@gmail.com","sentAt":"2019-08-25T19:58:41Z","receivedAt":"2019-08-25T19:59:09Z","isPatch":false,"sender":{"key":"albertvaka@gmail.com","avatar":"https://gravatar.com/avatar/43c0c20a97d21b8e4c969b026c0d67a4131a7f5c2fd76b679205dbda879dcf53?d=mp&s=160"},"body":"On Sun, Aug 25, 2019 at 7:54 PM Johannes Sixt <j6t@kdbg.org> wrote:\n>\n> Am 23.08.19 um 22:43 schrieb Albert Vaca Cintora:\n> > However, I'm sure that a large percentage of developers out there will\n> > agree with me that having to use force (-f) to delete every cloned\n> > repo is annoying, and even worse, it creates the bad habit of always\n> > force-deleting everything.\n>\n> IMO, the bad habit is to delete cloned repositories all the time. If\n> your workflow necessitates this, then you are doing something wrong.\n> Maybe you have an X-Y-problem?\n>\n> -- Hannes\n\nThere are plenty of valid workflows where one would delete a repo.\n\nWhat you suggest is like saying I shouldn't delete pictures from my\ncamera, because in that case I shouldn't have taken them in the first\nplace.\n\nSometimes I clone a repo just to grep for an error string and then I\ndon't need it anymore, or I clone several repos until I find the one\nthat contains what I want and delete the rest. Sometimes I want to\nwrite a patch for some software I don't develop regularly so I don't\nneed to keep a clone of it.\n\nIn any case, it would be useful to know the reason those files are\nread-only in the first place. Do you guys know who might know?\n\nAlbert\n"},{"id":"381130","messageId":"34935414-4e69-114b-7a32-f94514e3679d@iee.email","threadId":"51717","inReplyTo":"CAAQViEv1_YXPxLRN=eT7yQhro55K4audnouzAjjbHhJsU7pgQA@mail.gmail.com","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-08-25T22:41:32Z","receivedAt":"2019-08-25T22:41:35Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 25/08/2019 20:58, Albert Vaca Cintora wrote:\n> On Sun, Aug 25, 2019 at 7:54 PM Johannes Sixt <j6t@kdbg.org> wrote:\n>> Am 23.08.19 um 22:43 schrieb Albert Vaca Cintora:\n>>> However, I'm sure that a large percentage of developers out there will\n>>> agree with me that having to use force (-f) to delete every cloned\n>>> repo is annoying, and even worse, it creates the bad habit of always\n>>> force-deleting everything.\n>> IMO, the bad habit is to delete cloned repositories all the time. If\n>> your workflow necessitates this, then you are doing something wrong.\n>> Maybe you have an X-Y-problem?\n>>\n>> -- Hannes\n> There are plenty of valid workflows where one would delete a repo.\n>\n> What you suggest is like saying I shouldn't delete pictures from my\n> camera, because in that case I shouldn't have taken them in the first\n> place.\n>\n> Sometimes I clone a repo just to grep for an error string and then I\n> don't need it anymore, or I clone several repos until I find the one\n> that contains what I want and delete the rest. Sometimes I want to\n> write a patch for some software I don't develop regularly so I don't\n> need to keep a clone of it.\n>\n> In any case, it would be useful to know the reason those files are\n> read-only in the first place. Do you guys know who might know?\n>\n> Albert\nSurely (?), if we are considering our stored revisions to be immutable, \nthen removing the write bit is the right thing to do.\nIf I understand correctly (*) we don't separate the delete permission \nfrom 'no-write' permissions, so the consequence will be that such files \nare read-only.\n\nPhilip\n\n(*) I'm primarily a Windows user, so certain Linux nuances pass me by \n;-). I simply delete the repo folder then click the gui dialog to agree \nto delete the r/o files. Simples.\n"},{"id":"381177","messageId":"006201d55c1a$68180f50$38482df0$@nexbridge.com","threadId":"51717","inReplyTo":"CAAQViEv1_YXPxLRN=eT7yQhro55K4audnouzAjjbHhJsU7pgQA@mail.gmail.com","subject":"RE: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2019-08-26T14:27:29Z","receivedAt":"2019-08-26T14:27:51Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On August 25, 2019 3:59 PM, Albert Vaca Cintora wrote:\n> To: Johannes Sixt <j6t@kdbg.org>\n> On Sun, Aug 25, 2019 at 7:54 PM Johannes Sixt <j6t@kdbg.org> wrote:\n> >\n> > Am 23.08.19 um 22:43 schrieb Albert Vaca Cintora:\n> > > However, I'm sure that a large percentage of developers out there\n> > > will agree with me that having to use force (-f) to delete every\n> > > cloned repo is annoying, and even worse, it creates the bad habit of\n> > > always force-deleting everything.\n> >\n> > IMO, the bad habit is to delete cloned repositories all the time. If\n> > your workflow necessitates this, then you are doing something wrong.\n> > Maybe you have an X-Y-problem?\n> >\n> > -- Hannes\n> \n> There are plenty of valid workflows where one would delete a repo.\n> \n> What you suggest is like saying I shouldn't delete pictures from my camera,\n> because in that case I shouldn't have taken them in the first place.\n> \n> Sometimes I clone a repo just to grep for an error string and then I don't\n> need it anymore, or I clone several repos until I find the one that contains\n> what I want and delete the rest. Sometimes I want to write a patch for some\n> software I don't develop regularly so I don't need to keep a clone of it.\n> \n> In any case, it would be useful to know the reason those files are read-only in\n> the first place. Do you guys know who might know?\n\nWhy don't you wrap your clone in a script that calls chmod -R u+w .git after the clone? This seems like a pretty trivial approach regardless of your workflow. This works in Linux, Mac, Windows (under cygwin-bash) and anything else POSIX-ish.\n\n"},{"id":"381180","messageId":"xmqq5zmkkn4a.fsf@gitster-ct.c.googlers.com","threadId":"51717","inReplyTo":"34935414-4e69-114b-7a32-f94514e3679d@iee.email","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-08-26T14:38:45Z","receivedAt":"2019-08-26T14:38:52Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Philip Oakley <philipoakley@iee.email> writes:\n\n> Surely (?), if we are considering our stored revisions to be\n> immutable, then removing the write bit is the right thing to do.\n> If I understand correctly (*) we don't separate the delete permission\n> from 'no-write' permissions, so the consequence will be that such\n> files are read-only.\n\nAnd directories (e.g. .git/objects/) are not made read-only for\nobvious reasons.  Read-only files inside a writeable directory can\nbe deleted just like read-write ones can be (iow, the \"delete\npermission\" comes from the \"write permission\" of the containing\ndirectory) so \"rm -r .git\" should \"work\" just fine (depending on the\ndefinition of working, of course---it is discouraged to throw away\nyour work).\n\nPerhaps Windows filesystem or file manager application behave\ndifferently and tries to protect users from removing read-only files\nin read-write folders by mistake, or something?  If that is what the\nthread is complaining about, I agree that's a bit unfortunate.\nPerhaps Windows port can implement \"this is an immultable file---do\nnot write into it\" slightly differently in adjust_shared_perm()?\n"},{"id":"381194","messageId":"xmqqsgpoj6ad.fsf@gitster-ct.c.googlers.com","threadId":"51717","inReplyTo":"006201d55c1a$68180f50$38482df0$@nexbridge.com","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-08-26T15:27:38Z","receivedAt":"2019-08-26T15:27:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Randall S. Becker\" <rsbecker@nexbridge.com> writes:\n\n>> Sometimes I clone a repo just to grep for an error string and then I don't\n>> need it anymore, or I clone several repos until I find the one that contains\n>> what I want and delete the rest. Sometimes I want to write a patch for some\n>> software I don't develop regularly so I don't need to keep a clone of it.\n>> \n>> In any case, it would be useful to know the reason those files are read-only in\n>> the first place. Do you guys know who might know?\n>\n> Why don't you wrap your clone in a script that calls chmod -R u+w\n> .git after the clone? This seems like a pretty trivial approach\n> regardless of your workflow. This works in Linux, Mac, Windows\n> (under cygwin-bash) and anything else POSIX-ish.\n\nBut on anything POSIX-ish, is it a problem for some files (but not\nany directory) in .git is made read-only?\n\n\n\n"},{"id":"381201","messageId":"008e01d55c2a$08749ea0$195ddbe0$@nexbridge.com","threadId":"51717","inReplyTo":"xmqqsgpoj6ad.fsf@gitster-ct.c.googlers.com","subject":"RE: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2019-08-26T16:19:22Z","receivedAt":"2019-08-26T16:19:40Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On August 26, 2019 11:28 AM, Junio C Hamano wrote:\n> \"Randall S. Becker\" <rsbecker@nexbridge.com> writes:\n> \n> >> Sometimes I clone a repo just to grep for an error string and then I\n> >> don't need it anymore, or I clone several repos until I find the one\n> >> that contains what I want and delete the rest. Sometimes I want to\n> >> write a patch for some software I don't develop regularly so I don't\nneed\n> to keep a clone of it.\n> >>\n> >> In any case, it would be useful to know the reason those files are\n> >> read-only in the first place. Do you guys know who might know?\n> >\n> > Why don't you wrap your clone in a script that calls chmod -R u+w .git\n> > after the clone? This seems like a pretty trivial approach regardless\n> > of your workflow. This works in Linux, Mac, Windows (under\n> > cygwin-bash) and anything else POSIX-ish.\n> \n> But on anything POSIX-ish, is it a problem for some files (but not any\n> directory) in .git is made read-only?\n\nNot for me or anyone I personally support. As I suggested to Albert,\nwrapping a clone in a script with a chmod would solve the problem with\nminimal work.\n\nMy own personal issue is convincing people not to clone for every topic\nbranch, but that's unrelated.\n\n"},{"id":"381232","messageId":"CAAQViEsL+X5ZYmmSjG1JBksGjthHCUyWa3525b8dN7u1XAbvJg@mail.gmail.com","threadId":"51717","inReplyTo":"xmqq5zmkkn4a.fsf@gitster-ct.c.googlers.com","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Albert Vaca Cintora","fromEmail":"albertvaka@gmail.com","sentAt":"2019-08-26T18:42:56Z","receivedAt":"2019-08-26T18:43:24Z","isPatch":false,"sender":{"key":"albertvaka@gmail.com","avatar":"https://gravatar.com/avatar/43c0c20a97d21b8e4c969b026c0d67a4131a7f5c2fd76b679205dbda879dcf53?d=mp&s=160"},"body":"On Mon, Aug 26, 2019 at 4:38 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> And directories (e.g. .git/objects/) are not made read-only for\n> obvious reasons.  Read-only files inside a writeable directory can\n> be deleted just like read-write ones can be (iow, the \"delete\n> permission\" comes from the \"write permission\" of the containing\n> directory) so \"rm -r .git\" should \"work\" just fine (depending on the\n> definition of working, of course---it is discouraged to throw away\n> your work).\n>\n\nIt \"works\" for some definition of work, but it asks for confirmation\nfor every file, which is a pain. I'm on Linux.\n\nOn Mon, Aug 26, 2019 at 4:27 PM Randall S. Becker\n<rsbecker@nexbridge.com> wrote:\n>\n> Why don't you wrap your clone in a script that calls chmod -R u+w .git after the clone? This seems like a pretty trivial approach regardless of your workflow. This works in Linux, Mac, Windows (under cygwin-bash) and anything else POSIX-ish.\n>\n\nWrapping `git clone` should work as a workaround. Although if that\ndoesn't break anything... then why were those files read-only in the\nfirst place? :)\n\nThe fact that, from a formal point of view, those files are immutable\ndoesn't seem to justify them being read-only (or, at least, doesn't\nfollow any convention): there are plenty of immutable files on any\nsystem (eg: all binaries and libs, application assets like images and\nicons, pid/lock files for daemons, etc.) that are not made read-only.\n\nI can go with the workaround, but I'm still inclined to think this\noption should be built in into git.\n\nAlbert\n"},{"id":"381240","messageId":"20190826191840.GS20404@szeder.dev","threadId":"51717","inReplyTo":"CAAQViEsL+X5ZYmmSjG1JBksGjthHCUyWa3525b8dN7u1XAbvJg@mail.gmail.com","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-08-26T19:18:40Z","receivedAt":"2019-08-26T19:18:46Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Mon, Aug 26, 2019 at 08:42:56PM +0200, Albert Vaca Cintora wrote:\n> > Why don't you wrap your clone in a script that calls chmod -R u+w .git after the clone? This seems like a pretty trivial approach regardless of your workflow. This works in Linux, Mac, Windows (under cygwin-bash) and anything else POSIX-ish.\n> >\n> \n> Wrapping `git clone` should work as a workaround. Although if that\n> doesn't break anything... then why were those files read-only in the\n> first place? :)\n\nThose read-only object and pack files contain all the version history,\nand, therefore, are precious.  Making them read-only can protect\nfrom accidental deletion.\n\n> The fact that, from a formal point of view, those files are immutable\n> doesn't seem to justify them being read-only (or, at least, doesn't\n> follow any convention): there are plenty of immutable files on any\n> system (eg: all binaries and libs, application assets like images and\n> icons, pid/lock files for daemons, etc.) that are not made read-only.\n\nNone of those files are actually immutable: the next update will\noverwrite the binaries, libs, and assets, stopping the daemon will\nremove the pidfile.\n\nOTOH, Git's object and pack files are indeed immutable.\n\n"},{"id":"381387","messageId":"xmqq4l224d0x.fsf@gitster-ct.c.googlers.com","threadId":"51717","inReplyTo":"CAAQViEsL+X5ZYmmSjG1JBksGjthHCUyWa3525b8dN7u1XAbvJg@mail.gmail.com","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-08-27T19:35:42Z","receivedAt":"2019-08-27T19:35:46Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Albert Vaca Cintora <albertvaka@gmail.com> writes:\n\n> It \"works\" for some definition of work, but it asks for confirmation\n> for every file, which is a pain. I'm on Linux.\n\nAh, your \"rm\" command needs to learn \"-f\" option, too, then?\n"},{"id":"381572","messageId":"CAAQViEv1wWGTzQ29t0qi9rYoRY=Y86GL7E5rR4XySOBoeRx2pg@mail.gmail.com","threadId":"51717","inReplyTo":"xmqq4l224d0x.fsf@gitster-ct.c.googlers.com","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Albert Vaca Cintora","fromEmail":"albertvaka@gmail.com","sentAt":"2019-08-30T12:49:30Z","receivedAt":"2019-08-30T12:49:58Z","isPatch":false,"sender":{"key":"albertvaka@gmail.com","avatar":"https://gravatar.com/avatar/43c0c20a97d21b8e4c969b026c0d67a4131a7f5c2fd76b679205dbda879dcf53?d=mp&s=160"},"body":"On Tue, Aug 27, 2019 at 9:35 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Ah, your \"rm\" command needs to learn \"-f\" option, too, then?\n\nThe whole point of this thread was to remove the need of -f forcing the removal.\n"},{"id":"381591","messageId":"xmqqd0gmzk0c.fsf@gitster-ct.c.googlers.com","threadId":"51717","inReplyTo":"CAAQViEv1wWGTzQ29t0qi9rYoRY=Y86GL7E5rR4XySOBoeRx2pg@mail.gmail.com","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-08-30T16:38:11Z","receivedAt":"2019-08-30T16:38:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Albert Vaca Cintora <albertvaka@gmail.com> writes:\n\n> On Tue, Aug 27, 2019 at 9:35 PM Junio C Hamano <gitster@pobox.com> wrote:\n>>\n>> Ah, your \"rm\" command needs to learn \"-f\" option, too, then?\n>\n> The whole point of this thread was to remove the need of -f forcing the removal.\n\nOK, I misunderstood what you wanted to do.\n\nIf an implementation of Git were making everything under .git/\nread-only, including directories, then it is veriy much reasonable\nto complain against such an implementation.  The usual \"I know I am\ndoing something unusual and forcing it\" safety given by \"rm -rf\" is\nnot enough to remove such a clone, and user would need \"chmod -R u+w\"\nbeforehand to be able to remove---that is being unreasonably paranoid\nin the name of protecting against mistakes.\n\nBut requiring an additional single \"f\" when doing \"rm -rf .git\"?  Is\nthat realy too much of a hassle?  The option \"-f\" is to allow people\ndeal with an unusual situation, while preventing everyday use from\ndoing something harmful unintendedly.  And removing a cloned\nrepository is an unusual situation that would not happen every day,\nno?\n"},{"id":"381598","messageId":"20190830202635.0bc7e14f@kitsune.suse.cz","threadId":"51717","inReplyTo":"xmqqd0gmzk0c.fsf@gitster-ct.c.googlers.com","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Michal Suchánek","fromEmail":"msuchanek@suse.de","sentAt":"2019-08-30T18:26:35Z","receivedAt":"2019-08-30T18:26:39Z","isPatch":false,"sender":{"key":"msuchanek@suse.de","avatar":"https://avatars.githubusercontent.com/u/787652?v=4"},"body":"On Fri, 30 Aug 2019 09:38:11 -0700\nJunio C Hamano <gitster@pobox.com> wrote:\n\n> Albert Vaca Cintora <albertvaka@gmail.com> writes:\n> \n> > On Tue, Aug 27, 2019 at 9:35 PM Junio C Hamano <gitster@pobox.com> wrote:  \n> >>\n> >> Ah, your \"rm\" command needs to learn \"-f\" option, too, then?  \n> >\n> > The whole point of this thread was to remove the need of -f forcing the removal.  \n> \n> OK, I misunderstood what you wanted to do.\n> \n> If an implementation of Git were making everything under .git/\n> read-only, including directories, then it is veriy much reasonable\n> to complain against such an implementation.  The usual \"I know I am\n> doing something unusual and forcing it\" safety given by \"rm -rf\" is\n> not enough to remove such a clone, and user would need \"chmod -R u+w\"\n> beforehand to be able to remove---that is being unreasonably paranoid\n> in the name of protecting against mistakes.\n> \n> But requiring an additional single \"f\" when doing \"rm -rf .git\"?  Is\n> that realy too much of a hassle?  The option \"-f\" is to allow people\n> deal with an unusual situation, while preventing everyday use from\n> doing something harmful unintendedly.  And removing a cloned\n> repository is an unusual situation that would not happen every day,\n> no?\n\nNot everyone's day. Some people's day, sure.\n\nI am not in this situation so often but indeed I sometimes clone\nseveral repositories in a day to search for a patch or piece of code\nand then don't need them anymore. Some people may be in such situation\nmore often or regularly.\n\nThat's why this request makes sense to me.\n\nThanks\n\nMichal\n"},{"id":"381599","messageId":"xmqqmufqxxof.fsf@gitster-ct.c.googlers.com","threadId":"51717","inReplyTo":"20190830202635.0bc7e14f@kitsune.suse.cz","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-08-30T19:25:52Z","receivedAt":"2019-08-30T19:25:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michal Suchánek <msuchanek@suse.de> writes:\n\n>> But requiring an additional single \"f\" when doing \"rm -rf .git\"?  Is\n>> that realy too much of a hassle?  The option \"-f\" is to allow people\n>> deal with an unusual situation, while preventing everyday use from\n>> doing something harmful unintendedly.  And removing a cloned\n>> repository is an unusual situation that would not happen every day,\n>> no?\n> ...\n> I am not in this situation so often but indeed I sometimes clone\n> several repositories in a day to search for a patch or piece of code\n> and then don't need them anymore. Some people may be in such situation\n> more often or regularly.\n\nBut between these two:\n\n\t$ git clone --no-read-only-file-in-git https://github.com/foo/bar\n\t...sightsee...\n\t$ rm -r bar\n\nto avoid \"f\" in \"rm -r\", vs.\n\n\t$ git clone https://github.com/foo/bar\n\t...sightsee...\n\t$ rm -rf bar\n\nto clone a repository you only have a tentive interest in just like\nany other more permanent repositories, I am not sure how the former\nis preferrable.\n"},{"id":"381628","messageId":"CAAQViEufHT70-c17hdPqFh4HxB1Wy1dF6huF88P2-n+LWkhamQ@mail.gmail.com","threadId":"51717","inReplyTo":"xmqqmufqxxof.fsf@gitster-ct.c.googlers.com","subject":"Re: [Feature Request] Option to make .git not read-only in cloned repos","fromName":"Albert Vaca Cintora","fromEmail":"albertvaka@gmail.com","sentAt":"2019-08-31T20:40:20Z","receivedAt":"2019-08-31T20:42:31Z","isPatch":false,"sender":{"key":"albertvaka@gmail.com","avatar":"https://gravatar.com/avatar/43c0c20a97d21b8e4c969b026c0d67a4131a7f5c2fd76b679205dbda879dcf53?d=mp&s=160"},"body":"On Fri, Aug 30, 2019 at 9:25 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> But between these two:\n>\n>         $ git clone --no-read-only-file-in-git https://github.com/foo/bar\n>         ...sightsee...\n>         $ rm -r bar\n>\n> to avoid \"f\" in \"rm -r\", vs.\n>\n>         $ git clone https://github.com/foo/bar\n>         ...sightsee...\n>         $ rm -rf bar\n>\n> to clone a repository you only have a tentive interest in just like\n> any other more permanent repositories, I am not sure how the former\n> is preferrable.\n\nI would permanently enable --no-read-only-file-in-git for all newly\ncloned repositories (via an alias, or .gitconfig if possible), so\nthere would be no need to type it every time.\n"}]}