{"thread":{"id":"34646","subject":"git status resets permissions on index file -- Ubuntu 12.04 64b","startedAt":"2013-08-08T20:27:33Z","lastAt":"2013-08-09T19:29:54Z","messageCount":11,"participants":["Justin Collum","Stefan Beller","Andrew Ruder","Kyle J. McKay","Andreas Schwab","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"224852","messageId":"CACO0oR7a1-fUASQ+SJVbH1CU8d=NbHrK0MuMu+9Pr4_=7q85Vw@mail.gmail.com","threadId":"34646","inReplyTo":null,"subject":"git status resets permissions on index file -- Ubuntu 12.04 64b","fromName":"Justin Collum","fromEmail":"jcollum@gmail.com","sentAt":"2013-08-08T20:27:33Z","receivedAt":"2013-08-08T20:27:33Z","isPatch":false,"sender":{"key":"jcollum@gmail.com","avatar":"https://gravatar.com/avatar/e05cd422028281783064ff1b773fdc5531327b0dab095a0f6c4ca8c29e642ed8?d=mp&s=160"},"body":"I've run into a strange situation with git lately. It seems that\nanything I do involving git will alter the permissions on my index\nfile to the point that I can't do anything until I re-add the\npermissions on the file.\n\nLooks like a bug to me, is it? It does seem like this has started\nhappening since I moved over to 64b Ubuntu.\n\n$ ll .git\ntotal 156K\n...\ndrwxrwxrwx   2 dev dev 4.0K Jul 23 09:30 hooks\n-rwxrwxrwx   1 dev dev  17K Aug  8 13:12 index\ndrwxrwxrwx   2 dev dev 4.0K Jul 19 09:31 info\n...\n\n$ gs\n# On branch build-0.3\n# Your branch is ahead of 'staging/build-0.3' by 5 commits.\n#   (use \"git push\" to publish your local commits)\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n# scripts/loadMongo.coffee\nnothing added to commit but untracked files present (use \"git add\" to track)\n\n$ ll .git\ntotal 156K\n...\ndrwxrwxrwx   2 dev dev 4.0K Jul 23 09:30 hooks\n-rw-rw-r--   1 dev dev  17K Aug  8 13:16 index   # <---------------\nthis line  <-------------------------------\ndrwxrwxrwx   2 dev dev 4.0K Jul 19 09:31 info\n...\n\n$ git --version\ngit version 1.8.3.4\n\nUbuntu:\nDistributor ID: Ubuntu\nDescription: Ubuntu 12.04.2 LTS\nRelease: 12.04\nCodename: precise\n"},{"id":"224860","messageId":"52040F27.4050908@googlemail.com","threadId":"34646","inReplyTo":"CACO0oR7a1-fUASQ+SJVbH1CU8d=NbHrK0MuMu+9Pr4_=7q85Vw@mail.gmail.com","subject":"Re: git status resets permissions on index file -- Ubuntu 12.04 64b","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-08-08T21:35:35Z","receivedAt":"2013-08-08T21:35:35Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On 08/08/2013 10:27 PM, Justin Collum wrote:\n> I've run into a strange situation with git lately. It seems that\n> anything I do involving git will alter the permissions on my index\n> file to the point that I can't do anything until I re-add the\n> permissions on the file.\n> \n> Looks like a bug to me, is it? It does seem like this has started\n> happening since I moved over to 64b Ubuntu.\n> \n> $ ll .git\n> total 156K\n> ...\n> drwxrwxrwx   2 dev dev 4.0K Jul 23 09:30 hooks\n> -rwxrwxrwx   1 dev dev  17K Aug  8 13:12 index\n> drwxrwxrwx   2 dev dev 4.0K Jul 19 09:31 info\n> ...\n> \n> $ gs\n> # On branch build-0.3\n> # Your branch is ahead of 'staging/build-0.3' by 5 commits.\n> #   (use \"git push\" to publish your local commits)\n> #\n> # Untracked files:\n> #   (use \"git add <file>...\" to include in what will be committed)\n> #\n> # scripts/loadMongo.coffee\n> nothing added to commit but untracked files present (use \"git add\" to track)\n> \n> $ ll .git\n> total 156K\n> ...\n> drwxrwxrwx   2 dev dev 4.0K Jul 23 09:30 hooks\n> -rw-rw-r--   1 dev dev  17K Aug  8 13:16 index   # <---------------\n> this line  <-------------------------------\n> drwxrwxrwx   2 dev dev 4.0K Jul 19 09:31 info\n> ...\n> \n> $ git --version\n> git version 1.8.3.4\n> \n> Ubuntu:\n> Distributor ID: Ubuntu\n> Description: Ubuntu 12.04.2 LTS\n> Release: 12.04\n> Codename: precise\n\nThe permissions are set to reading for all and writing for you(r user)\nand your group. This should be no problem with standard git commands.\nBefore you had the index file executable, why would you need that?\n\nWhat kind of filesystem do you have? (The output of 'mount' would be \ninteresting) \n\nAlso what exactly breaks? (\"can't do anything\") \nWhat commands do not behave as you'd expect? \n\nStefan\n\n"},{"id":"224870","messageId":"20130808221807.GA8518@gmail.com","threadId":"34646","inReplyTo":"52040F27.4050908@googlemail.com","subject":"Re: git status resets permissions on index file -- Ubuntu 12.04 64b","fromName":"Andrew Ruder","fromEmail":"andy@aeruder.net","sentAt":"2013-08-08T22:18:07Z","receivedAt":"2013-08-08T22:18:07Z","isPatch":false,"sender":{"key":"andy@aeruder.net","avatar":"https://gravatar.com/avatar/cd5239f6d3c9acac61e817de7f7d497e518415e23720f170a10e0663a7981963?d=mp&s=160"},"body":"On Thu, Aug 08, 2013 at 11:35:35PM +0200, Stefan Beller wrote:\n> On 08/08/2013 10:27 PM, Justin Collum wrote:\n> > [...]\n> > -rwxrwxrwx   1 dev dev  17K Aug  8 13:12 index\n> > [...]\n> > -rw-rw-r--   1 dev dev  17K Aug  8 13:16 index   # <---------------\n> \n> The permissions are set to reading for all and writing for you(r user)\n> and your group. This should be no problem with standard git commands.\n> Before you had the index file executable, why would you need that?\n\nI'm about 90% sure the issue he's having is that the write bit for\nother/world goes away and he is neither the user dev or the group dev\nand the reason for all the executable bits is that he is regularly\nrunning\n\n    chmod -R 777 .\n\nJustin, if this is true, I will tell you that git respects your umask\nbut I just can't bring myself to really suggest someone type umask 000\never. :(\n\n- Andy\n"},{"id":"224871","messageId":"CACO0oR7M90iyDCo-mwoHn21jKRGuMsRWEeWkFXC-MCSUBscC9w@mail.gmail.com","threadId":"34646","inReplyTo":"20130808221807.GA8518@gmail.com","subject":"Re: git status resets permissions on index file -- Ubuntu 12.04 64b","fromName":"Justin Collum","fromEmail":"jcollum@gmail.com","sentAt":"2013-08-08T22:33:32Z","receivedAt":"2013-08-08T22:33:32Z","isPatch":false,"sender":{"key":"jcollum@gmail.com","avatar":"https://gravatar.com/avatar/e05cd422028281783064ff1b773fdc5531327b0dab095a0f6c4ca8c29e642ed8?d=mp&s=160"},"body":"On Thu, Aug 8, 2013 at 3:18 PM, Andrew Ruder <andy@aeruder.net> wrote:\n> he is neither the user dev or the group dev\n\nI am both. There's only one user on this machine and he is me.\n\n> he is regularly running  chmod -R 777\n\nYes, true. I have a program that I use to edit some of these files\n(not the git files) that likes to screw up permissions. It's a long\nstory. Anyway, I've been running that chmod regularly since well\nbefore this git issue started. I'll start using 644 for the chmod and\nsee if that helps.\n"},{"id":"224872","messageId":"C525FA0D-D22C-4C78-8C97-45819FD58DD7@gmail.com","threadId":"34646","inReplyTo":"20130808221807.GA8518@gmail.com","subject":"Re: git status resets permissions on index file -- Ubuntu 12.04 64b","fromName":"Kyle J. McKay","fromEmail":"mackyle@gmail.com","sentAt":"2013-08-08T22:37:42Z","receivedAt":"2013-08-08T22:37:42Z","isPatch":false,"sender":{"key":"mackyle@gmail.com","avatar":"https://avatars.githubusercontent.com/u/813346?v=4"},"body":"On Aug 8, 2013, at 15:18, Andrew Ruder wrote:\n> On Thu, Aug 08, 2013 at 11:35:35PM +0200, Stefan Beller wrote:\n>> On 08/08/2013 10:27 PM, Justin Collum wrote:\n>>> [...]\n>>> -rwxrwxrwx   1 dev dev  17K Aug  8 13:12 index\n>>> [...]\n>>> -rw-rw-r--   1 dev dev  17K Aug  8 13:16 index   # <---------------\n>>\n>> The permissions are set to reading for all and writing for you(r  \n>> user)\n>> and your group. This should be no problem with standard git commands.\n>> Before you had the index file executable, why would you need that?\n>\n> I'm about 90% sure the issue he's having is that the write bit for\n> other/world goes away and he is neither the user dev or the group dev\n> and the reason for all the executable bits is that he is regularly\n> running\n>\n>    chmod -R 777 .\n>\n> Justin, if this is true, I will tell you that git respects your umask\n> but I just can't bring myself to really suggest someone type umask 000\n> ever. :(\n\n\nJustin,\n\nIf you really want a repository that's writable by everyone, why not  \njust do \"git config core.sharedRepository 0666\" ?\n\nIf you just want them to be group-writable you may be happier with  \n\"git config core.sharedRepository true\" or possibly \"git config  \ncore.sharedRepository all\".  The setting is described fully in \"git  \nhelp config\".\n"},{"id":"224874","messageId":"20130808230058.GA10058@gmail.com","threadId":"34646","inReplyTo":"CACO0oR7M90iyDCo-mwoHn21jKRGuMsRWEeWkFXC-MCSUBscC9w@mail.gmail.com","subject":"Re: git status resets permissions on index file -- Ubuntu 12.04 64b","fromName":"Andrew Ruder","fromEmail":"andy@aeruder.net","sentAt":"2013-08-08T23:00:58Z","receivedAt":"2013-08-08T23:00:58Z","isPatch":false,"sender":{"key":"andy@aeruder.net","avatar":"https://gravatar.com/avatar/cd5239f6d3c9acac61e817de7f7d497e518415e23720f170a10e0663a7981963?d=mp&s=160"},"body":"On Thu, Aug 08, 2013 at 03:33:32PM -0700, Justin Collum wrote:\n> On Thu, Aug 8, 2013 at 3:18 PM, Andrew Ruder <andy@aeruder.net> wrote:\n> > he is neither the user dev or the group dev\n> \n> I am both. There's only one user on this machine and he is me.\n\nIf you are running as 'dev', then I'm not sure how the permissions in\nthe modified case would affect git's ability to work with the file.\nSeems like everything should be working fine... what is the error you\nget when things stop working?\n"},{"id":"224875","messageId":"CACO0oR7tJNKWA=cynBA8R2kaGr2iKNCiCmXKLur9nub6pnBG0g@mail.gmail.com","threadId":"34646","inReplyTo":"C525FA0D-D22C-4C78-8C97-45819FD58DD7@gmail.com","subject":"Re: git status resets permissions on index file -- Ubuntu 12.04 64b","fromName":"Justin Collum","fromEmail":"jcollum@gmail.com","sentAt":"2013-08-08T23:58:20Z","receivedAt":"2013-08-08T23:58:20Z","isPatch":false,"sender":{"key":"jcollum@gmail.com","avatar":"https://gravatar.com/avatar/e05cd422028281783064ff1b773fdc5531327b0dab095a0f6c4ca8c29e642ed8?d=mp&s=160"},"body":"doing\n\n     sudo chmod 644 ./.git/index\n\ninstead of 777 resulted in the same result a bit later:\n\n    $ gs\n    fatal: index file open failed: Permission denied\n\n\nOn Thu, Aug 8, 2013 at 3:37 PM, Kyle J. McKay <mackyle@gmail.com> wrote:\n> On Aug 8, 2013, at 15:18, Andrew Ruder wrote:\n>>\n>> On Thu, Aug 08, 2013 at 11:35:35PM +0200, Stefan Beller wrote:\n>>>\n>>> On 08/08/2013 10:27 PM, Justin Collum wrote:\n>>>>\n>>>> [...]\n>>>> -rwxrwxrwx   1 dev dev  17K Aug  8 13:12 index\n>>>> [...]\n>>>> -rw-rw-r--   1 dev dev  17K Aug  8 13:16 index   # <---------------\n>>>\n>>>\n>>> The permissions are set to reading for all and writing for you(r user)\n>>> and your group. This should be no problem with standard git commands.\n>>> Before you had the index file executable, why would you need that?\n>>\n>>\n>> I'm about 90% sure the issue he's having is that the write bit for\n>> other/world goes away and he is neither the user dev or the group dev\n>> and the reason for all the executable bits is that he is regularly\n>> running\n>>\n>>    chmod -R 777 .\n>>\n>> Justin, if this is true, I will tell you that git respects your umask\n>> but I just can't bring myself to really suggest someone type umask 000\n>> ever. :(\n>\n>\n>\n> Justin,\n>\n> If you really want a repository that's writable by everyone, why not just do\n> \"git config core.sharedRepository 0666\" ?\n>\n> If you just want them to be group-writable you may be happier with \"git\n> config core.sharedRepository true\" or possibly \"git config\n> core.sharedRepository all\".  The setting is described fully in \"git help\n> config\".\n"},{"id":"224897","messageId":"8761vf3uml.fsf@igel.home","threadId":"34646","inReplyTo":"CACO0oR7tJNKWA=cynBA8R2kaGr2iKNCiCmXKLur9nub6pnBG0g@mail.gmail.com","subject":"Re: git status resets permissions on index file -- Ubuntu 12.04 64b","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2013-08-09T12:40:18Z","receivedAt":"2013-08-09T12:40:18Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Justin Collum <jcollum@gmail.com> writes:\n\n>      sudo chmod 644 ./.git/index\n\nThat doesn't make sense.  If you are the owner of the file, why do you\nneed sudo???\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"224900","messageId":"vpqa9krja1f.fsf@anie.imag.fr","threadId":"34646","inReplyTo":"8761vf3uml.fsf@igel.home","subject":"Re: git status resets permissions on index file -- Ubuntu 12.04 64b","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-09T12:58:20Z","receivedAt":"2013-08-09T12:58:20Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Andreas Schwab <schwab@linux-m68k.org> writes:\n\n> Justin Collum <jcollum@gmail.com> writes:\n>\n>>      sudo chmod 644 ./.git/index\n>\n> That doesn't make sense.  If you are the owner of the file, why do you\n> need sudo???\n\nI suspect that some over-use of \"sudo\" resulted in files or directories\nbelonging to root. What does\n\n  find . -user 0\n\nsay?\n\n(As a developer, you should never need sudo. You should only need in as\nan administrator of your machine.)\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"224917","messageId":"CACO0oR4_+=6iimO4U0rt2JuhfxrX1CkjWR5iMkt=+EuxscmBMg@mail.gmail.com","threadId":"34646","inReplyTo":"8761vf3uml.fsf@igel.home","subject":"Re: git status resets permissions on index file -- Ubuntu 12.04 64b","fromName":"Justin Collum","fromEmail":"jcollum@gmail.com","sentAt":"2013-08-09T17:00:42Z","receivedAt":"2013-08-09T17:00:42Z","isPatch":false,"sender":{"key":"jcollum@gmail.com","avatar":"https://gravatar.com/avatar/e05cd422028281783064ff1b773fdc5531327b0dab095a0f6c4ca8c29e642ed8?d=mp&s=160"},"body":"> That doesn't make sense.  If you are the owner of the file, why do you need sudo???\n\nI've just never seen a chmod command without sudo. I assumed it was\nneeded. Is this relevant to the bug that I'm seeing?\n\nOn Fri, Aug 9, 2013 at 5:40 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:\n> Justin Collum <jcollum@gmail.com> writes:\n>\n>>      sudo chmod 644 ./.git/index\n>\n> That doesn't make sense.  If you are the owner of the file, why do you\n> need sudo???\n>\n> Andreas.\n>\n> --\n> Andreas Schwab, schwab@linux-m68k.org\n> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n> \"And now for something completely different.\"\n"},{"id":"224936","messageId":"CACO0oR7Kx0auNV6GRwqr-OdtnrCW21LxiMFrNUDRGRJN+P6ebg@mail.gmail.com","threadId":"34646","inReplyTo":"CACO0oR4_+=6iimO4U0rt2JuhfxrX1CkjWR5iMkt=+EuxscmBMg@mail.gmail.com","subject":"Re: git status resets permissions on index file -- Ubuntu 12.04 64b","fromName":"Justin Collum","fromEmail":"jcollum@gmail.com","sentAt":"2013-08-09T19:29:54Z","receivedAt":"2013-08-09T19:29:54Z","isPatch":false,"sender":{"key":"jcollum@gmail.com","avatar":"https://gravatar.com/avatar/e05cd422028281783064ff1b773fdc5531327b0dab095a0f6c4ca8c29e642ed8?d=mp&s=160"},"body":"I've looked into this a bit and I think this is a bug in Webstorm.\nWebstorm saves files a lot without you actually hitting save, so\nthat's why I didn't put 2 and 2 together. It appears that any file\nchange in Webstorm is screwing up the permissions on git's index --\nbut only in 64b Ubuntu, it wasn't happening in 32b.\n\nOn Fri, Aug 9, 2013 at 10:00 AM, Justin Collum <jcollum@gmail.com> wrote:\n>> That doesn't make sense.  If you are the owner of the file, why do you need sudo???\n>\n> I've just never seen a chmod command without sudo. I assumed it was\n> needed. Is this relevant to the bug that I'm seeing?\n>\n> On Fri, Aug 9, 2013 at 5:40 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:\n>> Justin Collum <jcollum@gmail.com> writes:\n>>\n>>>      sudo chmod 644 ./.git/index\n>>\n>> That doesn't make sense.  If you are the owner of the file, why do you\n>> need sudo???\n>>\n>> Andreas.\n>>\n>> --\n>> Andreas Schwab, schwab@linux-m68k.org\n>> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n>> \"And now for something completely different.\"\n"}]}