{"thread":{"id":"28838","subject":"aliases causing “Permission denied” error in git v1.7","startedAt":"2011-11-04T08:09:07Z","lastAt":"2011-11-05T11:51:28Z","messageCount":3,"participants":["Алексей Данченков","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"178813","messageId":"CALUFZ3n9cpHw3r3rcGriDqvJ+UM83L3Q19m=0YeAy51LBJzosA@mail.gmail.com","threadId":"28838","inReplyTo":null,"subject":"aliases causing “Permission denied” error in git v1.7","fromName":"Алексей Данченков","fromEmail":"adanchenkov@gmail.com","sentAt":"2011-11-04T08:09:07Z","receivedAt":"2011-11-04T08:09:07Z","isPatch":false,"sender":{"key":"adanchenkov@gmail.com","avatar":null},"body":"Hi!\n\n$ git co -b newbranch\n$ git co oldbranch\n\nresults in \"fatal: cannot exec 'git-co': Permission denied\" error.\n\nIn the same time, things like\n\n$ git checkout -b newbranch\n$ git checkout oldbranch\n\nand\n\n$ sudo git co -b newbranch\n$ sudo git co oldbranch\n\nwork as expected. Ownership rights for the .git die are set for the user\nand 0755/0644 are the mode for .git dir/subdir/files. There are no git-co\nscript anywhere in the system (as it is an alias to git-checkout, which\nresides in /usr/libexec/git-core).\n\nAliases are defined in .gitconfig of the home dir:\n\n[alias]\nco = checkout\n\nThere is no difference in git config for root or normal user.\n\nThings work well as expected when I install git v1.6. Going back to 1.7\ngives me the same error.\n\nWhat am I missing?\n\n---\n\nGentoo / kernel v3.0.6 / git v1.7.3.4\n"},{"id":"178855","messageId":"20111104203415.GB26591@sigill.intra.peff.net","threadId":"28838","inReplyTo":"CALUFZ3n9cpHw3r3rcGriDqvJ+UM83L3Q19m=0YeAy51LBJzosA@mail.gmail.com","subject":"Re: aliases causing “Permission denied” error in git v1.7","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-11-04T20:34:15Z","receivedAt":"2011-11-04T20:34:15Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Nov 04, 2011 at 12:09:07PM +0400, Алексей Данченков wrote:\n\n> $ git co -b newbranch\n> $ git co oldbranch\n> \n> results in \"fatal: cannot exec 'git-co': Permission denied\" error.\n\nGit will try commands in your PATH before aliases. So you are running\ninto a permissions problem with a \"git-co\" in your PATH.\n\nOr more likely, there is an inaccessible directory of your PATH (and we\nget the same error code from execve whether it is the directory or the\nfile itself which lacks permission). Try \"git foobar\" and I suspect you\nwill see the same thing (it doesn't matter that you have no foobar\nalias; we never get past the \"try to exec it\" stage).\n\nIf you are on Linux, try:\n\n  strace -f -e execve git foobar\n\nto see the the problematic entry that is returning EACCES. Or look\nthrough your $PATH manually.\n\n-Peff\n"},{"id":"178896","messageId":"CALUFZ3mgR8aRGO2yCfxKvHXqmz4ZOXBNSPuq0Q69yZ7ys5ttzQ@mail.gmail.com","threadId":"28838","inReplyTo":"7vhb2jbopp.fsf@alter.siamese.dyndns.org","subject":"Re: aliases causing “Permission denied” error in git v1.7","fromName":"Алексей Данченков","fromEmail":"adanchenkov@gmail.com","sentAt":"2011-11-05T11:51:28Z","receivedAt":"2011-11-05T11:51:28Z","isPatch":false,"sender":{"key":"adanchenkov@gmail.com","avatar":null},"body":"Thank you very much, Jeff and Junio!\n\nNot only I discovered more than one directory mentioned in the $PATH,\nbut missing, but also learned a lot, including the strace tool.\n\nCheers, Alexei\n\n2011/11/5 Junio C Hamano <gitster@pobox.com>:\n> Jeff King <peff@peff.net> writes:\n>\n> I do not know why my response is not showing up in the list archive, but\n> the complaint was that \"git co\" works for him and \"sudo git co\" does not.\n>\n> I suspect that Alexsey will see differences between these:\n>\n>    $ sh -c 'echo $PATH $HOME'\n>    $ sudo sh -c 'echo $PATH $HOME'\n>\n> Most likely, the latter would say /root/bin and /root; if an element in\n> the $PATH is unreadable, git would say \"cannot exec 'git-co': Permission denied\".\n>\n>\n>\n"}]}