{"thread":{"id":"34003","subject":"git daemon --access-hook problem","startedAt":"2013-05-31T20:22:38Z","lastAt":"2013-06-03T20:00:14Z","messageCount":6,"participants":["Eugene Sajine","Antoine Pelisse"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"219106","messageId":"CAPZPVFZDHHGyHhzBVVK6jS=XhEd2+JpmBT8ofiGOww8vuLUWWw@mail.gmail.com","threadId":"34003","inReplyTo":null,"subject":"git daemon --access-hook problem","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2013-05-31T20:22:38Z","receivedAt":"2013-05-31T20:22:38Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"Hi,\n\nI'm trying to test this new feature and having problems getting any\nresults in the following scenario:\n\ni have a repo in local folder\n\n/home/users/myuser/repos/projectA/.git\n\ni start the daemon with the following:\n\ngit daemon --export-all --base-path=/home/users/myuser/repos\n--enable=receive-pack --access-hook=/home/users/myuser/test_hook.bash\n\ntest_hook.bash has the following:\n\n#!/bin/bash\necho $@ >> test_hook_out.txt\necho $REMOTE_ADDR >> test_hook_out.txt\n\nthe hook is set to be executable - otherwise it complains when i do\nanything via git protocol, which proves that it seems to or check the\nhook:\n\nthen i did:\n\ncd ~/tmp/\n\ngit clone git://myhost/projectA projectA\ncd projectA\n\nand trying to perform some operations like fetch or push. It is cloned\nand fetches and pushes successfully.\nThe problem is that the file test_hook_out.txt doesn't have anything\nin it after the execution, So the hook doesn't seem to work.\n\nWhat might be the issue here?\n\nThanks,\nEugene\n"},{"id":"219209","messageId":"CAPZPVFboSH_4ehpu0WMPOz86w1Ak5L5FWOyM8M43fStGqU5sGg@mail.gmail.com","threadId":"34003","inReplyTo":"CAPZPVFZDHHGyHhzBVVK6jS=XhEd2+JpmBT8ofiGOww8vuLUWWw@mail.gmail.com","subject":"Re: git daemon --access-hook problem","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2013-06-03T00:33:24Z","receivedAt":"2013-06-03T00:33:24Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"Anybody? Any ideas?\n\nThanks in advance!\n\nEugene\n\nOn Fri, May 31, 2013 at 4:22 PM, Eugene Sajine <euguess@gmail.com> wrote:\n> Hi,\n>\n> I'm trying to test this new feature and having problems getting any\n> results in the following scenario:\n>\n> i have a repo in local folder\n>\n> /home/users/myuser/repos/projectA/.git\n>\n> i start the daemon with the following:\n>\n> git daemon --export-all --base-path=/home/users/myuser/repos\n> --enable=receive-pack --access-hook=/home/users/myuser/test_hook.bash\n>\n> test_hook.bash has the following:\n>\n> #!/bin/bash\n> echo $@ >> test_hook_out.txt\n> echo $REMOTE_ADDR >> test_hook_out.txt\n>\n> the hook is set to be executable - otherwise it complains when i do\n> anything via git protocol, which proves that it seems to or check the\n> hook:\n>\n> then i did:\n>\n> cd ~/tmp/\n>\n> git clone git://myhost/projectA projectA\n> cd projectA\n>\n> and trying to perform some operations like fetch or push. It is cloned\n> and fetches and pushes successfully.\n> The problem is that the file test_hook_out.txt doesn't have anything\n> in it after the execution, So the hook doesn't seem to work.\n>\n> What might be the issue here?\n>\n> Thanks,\n> Eugene\n"},{"id":"219249","messageId":"CALWbr2ypPCoftVLfP9uKeKStg3TWwLDchkUaL1d9s9O3kcuPwA@mail.gmail.com","threadId":"34003","inReplyTo":"CAPZPVFZDHHGyHhzBVVK6jS=XhEd2+JpmBT8ofiGOww8vuLUWWw@mail.gmail.com","subject":"Re: git daemon --access-hook problem","fromName":"Antoine Pelisse","fromEmail":"apelisse@gmail.com","sentAt":"2013-06-03T17:20:54Z","receivedAt":"2013-06-03T17:20:54Z","isPatch":false,"sender":{"key":"apelisse@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1929644?v=4"},"body":"On Fri, May 31, 2013 at 10:22 PM, Eugene Sajine <euguess@gmail.com> wrote:\n> and trying to perform some operations like fetch or push. It is cloned\n> and fetches and pushes successfully.\n> The problem is that the file test_hook_out.txt doesn't have anything\n> in it after the execution, So the hook doesn't seem to work.\n>\n> What might be the issue here?\n\nI have no idea what the issue might be, but here's how I usually debug\nthis kind of situations:\n- Exit with a non-zero value will make it an error, try \"exit 1\" at\nthe end of your script, you will know if it's executed or not\n- Your log file might not be located where you expect, you should use\nabsolute path to dump text\n- Dump the cwd to know where it's executed from\n- The documentation says you can print one line before a failure, also\ntry this to show the cwd\n\nHope that helps,\nAntoine,\n"},{"id":"219263","messageId":"CAPZPVFYdeuusW3=iBTBC+iPuOeAekvtMx6d_dozB9tsDCg3C8Q@mail.gmail.com","threadId":"34003","inReplyTo":"CALWbr2ypPCoftVLfP9uKeKStg3TWwLDchkUaL1d9s9O3kcuPwA@mail.gmail.com","subject":"Re: git daemon --access-hook problem","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2013-06-03T18:02:56Z","receivedAt":"2013-06-03T18:02:56Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"> - Your log file might not be located where you expect, you should use\n> absolute path to dump text\n\nYou were right! The problem was with the script itself - the log file\nnot being specified with absolute path! Stupid me!\n\n...\n> - The documentation says you can print one line before a failure, also\n> try this to show the cwd\n\nWould you be able to advise how this should be done?\nI don't get the error message (i mean the output of pwd) if i do this:\n\necho `pwd`\nexit 1\n\nWhat should it be?\n\nThanks!\nEugene\n\n\n\n>\n> Hope that helps,\n> Antoine,\n"},{"id":"219275","messageId":"CALWbr2ynF425qfCNr_NGH8z9UiX2G2CRrWiCo2XrgBLBbyPHMw@mail.gmail.com","threadId":"34003","inReplyTo":"CAPZPVFYdeuusW3=iBTBC+iPuOeAekvtMx6d_dozB9tsDCg3C8Q@mail.gmail.com","subject":"Re: git daemon --access-hook problem","fromName":"Antoine Pelisse","fromEmail":"apelisse@gmail.com","sentAt":"2013-06-03T19:05:30Z","receivedAt":"2013-06-03T19:05:30Z","isPatch":false,"sender":{"key":"apelisse@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1929644?v=4"},"body":"On Mon, Jun 3, 2013 at 8:02 PM, Eugene Sajine <euguess@gmail.com> wrote:\n> Would you be able to advise how this should be done?\n> I don't get the error message (i mean the output of pwd) if i do this:\n>\n> echo `pwd`\n> exit 1\n>\n> What should it be?\n\nActually, after digging into the code, it looks like you need to call\ngit-daemon with \"--informative-errors\" if you want to allow custom\nerrors. Maybe there is place for improvement in the documentation.\n\nCheers,\n"},{"id":"219283","messageId":"CAPZPVFaJ0qOhxMYDxhq4+qnWQjjhFRUjzGAemqjwAAoxC8-EDQ@mail.gmail.com","threadId":"34003","inReplyTo":"CALWbr2ynF425qfCNr_NGH8z9UiX2G2CRrWiCo2XrgBLBbyPHMw@mail.gmail.com","subject":"Re: git daemon --access-hook problem","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2013-06-03T20:00:14Z","receivedAt":"2013-06-03T20:00:14Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"Right, --informative-errors does make it better;)\n\nActually the CWD for the access-hook is not where the hook script is,\nbut inside the .git folder of the target repo. GTK.\n\nand yes, definitely some documentation improvements needed;)\n\nThanks!\n\nOn Mon, Jun 3, 2013 at 3:05 PM, Antoine Pelisse <apelisse@gmail.com> wrote:\n> On Mon, Jun 3, 2013 at 8:02 PM, Eugene Sajine <euguess@gmail.com> wrote:\n>> Would you be able to advise how this should be done?\n>> I don't get the error message (i mean the output of pwd) if i do this:\n>>\n>> echo `pwd`\n>> exit 1\n>>\n>> What should it be?\n>\n> Actually, after digging into the code, it looks like you need to call\n> git-daemon with \"--informative-errors\" if you want to allow custom\n> errors. Maybe there is place for improvement in the documentation.\n>\n> Cheers,\n"}]}