{"thread":{"id":"13048","subject":"permissions and packed-refs?","startedAt":"2008-04-10T12:30:50Z","lastAt":"2008-04-10T19:21:38Z","messageCount":4,"participants":["Nigel Magnay","Robert Haines","Logan Kennelly"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"74061","messageId":"320075ff0804100530s2af22cc9r43208101e46a8154@mail.gmail.com","threadId":"13048","inReplyTo":null,"subject":"permissions and packed-refs?","fromName":"Nigel Magnay","fromEmail":"nigel.magnay@gmail.com","sentAt":"2008-04-10T12:30:50Z","receivedAt":"2008-04-10T12:30:50Z","isPatch":false,"sender":{"key":"nigel.magnay@gmail.com","avatar":"https://gravatar.com/avatar/d85cf38287bef3a8e4fa02358d2756d7589f8676c5eeb881ce2f6d731e4526c3?d=mp&s=160"},"body":"This is likely a really stupid question... a repo that was working,\nhas now stopped accepting a push with\n\nCounting objects: 43, done.\nCompressing objects: 100% (18/18)   Compressing objects: 100% (18/18),\ndone.\nWriting objects: 100% (23/23)   Writing objects: 100% (23/23), 4.65 KiB,\ndone.\nTotal 23 (delta 10), reused 0 (delta 0)\nerror: Unable to append to logs/refs/heads/realtime: Permission denied\nPushing to ssh://10.1.3.153/pub/scm/git/git-svn/realtime.git\nTo ssh://10.1.3.153/pub/scm/git/git-svn/realtime.git\n ! [remote rejected] realtime -> realtime (failed to write)\nerror: failed to push some refs to\n'ssh://10.1.3.153/pub/scm/git/git-svn/realtime.git'\n\nI think git gc was run on the server at some point, as the head in\nquestion has been shifted into packed-refs.\n\nServer is linux (1.5.4.4) client is msysGit.\n"},{"id":"74085","messageId":"10723DA2-555B-40DB-8428-BDF07CA2510E@manchester.ac.uk","threadId":"13048","inReplyTo":"320075ff0804100530s2af22cc9r43208101e46a8154@mail.gmail.com","subject":"Re: permissions and packed-refs?","fromName":"Robert Haines","fromEmail":"rhaines@manchester.ac.uk","sentAt":"2008-04-10T16:21:36Z","receivedAt":"2008-04-10T16:21:36Z","isPatch":false,"sender":{"key":"rhaines@manchester.ac.uk","avatar":null},"body":"\nOn 10 Apr 2008, at 13:30, Nigel Magnay wrote:\n> This is likely a really stupid question... a repo that was working,\n> has now stopped accepting a push with\n>\n> Counting objects: 43, done.\n> Compressing objects: 100% (18/18)   Compressing objects: 100% (18/18),\n> done.\n> Writing objects: 100% (23/23)   Writing objects: 100% (23/23), 4.65  \n> KiB,\n> done.\n> Total 23 (delta 10), reused 0 (delta 0)\n> error: Unable to append to logs/refs/heads/realtime: Permission denied\n> Pushing to ssh://10.1.3.153/pub/scm/git/git-svn/realtime.git\n> To ssh://10.1.3.153/pub/scm/git/git-svn/realtime.git\n>  ! [remote rejected] realtime -> realtime (failed to write)\n> error: failed to push some refs to\n> 'ssh://10.1.3.153/pub/scm/git/git-svn/realtime.git'\n>\n> I think git gc was run on the server at some point, as the head in\n> question has been shifted into packed-refs.\n\nI've seen this after git gc too. Has the owner of the affected files  \nchanged? If so you need to make sure that git gc is run by the  \ncorrect user. If you run it as root for example, everything it  \ntouches will end up owned by root!\n\nCheers,\nRob\n"},{"id":"74088","messageId":"135BAC69-9549-4E61-BD6F-A99364C27CCC@sent.com","threadId":"13048","inReplyTo":"10723DA2-555B-40DB-8428-BDF07CA2510E@manchester.ac.uk","subject":"Re: permissions and packed-refs?","fromName":"Logan Kennelly","fromEmail":"logank@sent.com","sentAt":"2008-04-10T18:19:56Z","receivedAt":"2008-04-10T18:19:56Z","isPatch":false,"sender":{"key":"logank@sent.com","avatar":"https://gravatar.com/avatar/b7eb73a3eeb83e51f7b9a39a93c798da45e21d2f378efd58fc9139ec128a39f4?d=mp&s=160"},"body":"On Apr 10, 2008, at 9:21 AM, Robert Haines wrote:\n\n> I've seen this after git gc too. Has the owner of the affected  \n> files changed? If so you need to make sure that git gc is run by  \n> the correct user. If you run it as root for example, everything it  \n> touches will end up owned by root!\n\nNot only that, but you must make sure that you have the appropriate  \numask set. I'm not sure if this affects the pack file, but the reflog  \nis certainly rewritten in a way that prevents other users from pushing.\n\nI've been meaning to submit a patch to make git better honor  \n\"core.sharedrepository\" (it's probably as simple as adding a couple  \ncalls to adjust_shared_perm), but the workaround was so easy that I  \nhad forgotten about the issue.\n\n-- \n                                                         Logan Kennelly\n       ,,,\n      (. .)\n--ooO-(_)-Ooo--\n"},{"id":"74091","messageId":"320075ff0804101221n376e0c8mf9114f25dea6b2af@mail.gmail.com","threadId":"13048","inReplyTo":"135BAC69-9549-4E61-BD6F-A99364C27CCC@sent.com","subject":"Re: permissions and packed-refs?","fromName":"Nigel Magnay","fromEmail":"nigel.magnay@gmail.com","sentAt":"2008-04-10T19:21:38Z","receivedAt":"2008-04-10T19:21:38Z","isPatch":false,"sender":{"key":"nigel.magnay@gmail.com","avatar":"https://gravatar.com/avatar/d85cf38287bef3a8e4fa02358d2756d7589f8676c5eeb881ce2f6d731e4526c3?d=mp&s=160"},"body":"Yeah, I think that's probably what's happening. TBH it's a bit of an\nache to have to make sure umasks and things are set correctly, and\nit's probably partially that the repo was set up just from a direct\ncopy of someone's machine.\n\nWe've reverted to using a common account user for now.\n\nOn Thu, Apr 10, 2008 at 7:19 PM, Logan Kennelly <logank@sent.com> wrote:\n> On Apr 10, 2008, at 9:21 AM, Robert Haines wrote:\n>\n>\n> > I've seen this after git gc too. Has the owner of the affected files\n> changed? If so you need to make sure that git gc is run by the correct user.\n> If you run it as root for example, everything it touches will end up owned\n> by root!\n> >\n>\n>  Not only that, but you must make sure that you have the appropriate umask\n> set. I'm not sure if this affects the pack file, but the reflog is certainly\n> rewritten in a way that prevents other users from pushing.\n>\n>  I've been meaning to submit a patch to make git better honor\n> \"core.sharedrepository\" (it's probably as simple as adding a couple calls to\n> adjust_shared_perm), but the workaround was so easy that I had forgotten\n> about the issue.\n>\n>  --\n>                                                         Logan Kennelly\n>       ,,,\n>      (. .)\n>  --ooO-(_)-Ooo--\n>\n>\n>\n>\n"}]}