{"thread":{"id":"44189","subject":"Impossible to change working directory","startedAt":"2016-09-29T19:30:18Z","lastAt":"2016-10-01T15:35:37Z","messageCount":3,"participants":["Sebastian Feldmann","Junio C Hamano","Torsten Bögershausen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"302926","messageId":"A99D7D06-8214-4C09-BCB2-E4FCE75FF317@sebastian-feldmann.info","threadId":"44189","inReplyTo":null,"subject":"Impossible to change working directory","fromName":"Sebastian Feldmann","fromEmail":"sf@sebastian-feldmann.info","sentAt":"2016-09-29T19:30:10Z","receivedAt":"2016-09-29T19:30:18Z","isPatch":false,"sender":{"key":"sf@sebastian-feldmann.info","avatar":null},"body":"Hi there,\n\nI have a problem executing a pre-commit hook.\nThe hook script has to change the working directory to work and if I use plain\n\ngit commit\n\nit works as expected, the script executes without errors, but if I use\n\ngit commit —only file.x file.y\n\nthe script fails because changing the current working directory fails.\nIf I echo the current working directory it always echoes the root repository path\n\nIs this expected behavior?\nThanks for your feedback.\n\nCheers Sebastian\n\n\n\n\n"},{"id":"302963","messageId":"xmqq37kicmsb.fsf@gitster.mtv.corp.google.com","threadId":"44189","inReplyTo":"A99D7D06-8214-4C09-BCB2-E4FCE75FF317@sebastian-feldmann.info","subject":"Re: Impossible to change working directory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-29T23:24:20Z","receivedAt":"2016-09-29T23:24:29Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sebastian Feldmann <sf@sebastian-feldmann.info> writes:\n\n> the script fails because changing the current working directory fails.\n> If I echo the current working directory it always echoes the root repository path\n>\n> Is this expected behavior?\n\nYes, we always go to the top before doing anything.\n\nIf you echo environment variables Git may set up for you, what do\nyou see?  Do you see GIT_PREFIX that you can use to tell where you\ncame from, or something like that?\n"},{"id":"303043","messageId":"477492a9-7ff2-59d0-1463-b47694ce66c1@web.de","threadId":"44189","inReplyTo":"A99D7D06-8214-4C09-BCB2-E4FCE75FF317@sebastian-feldmann.info","subject":"Re: Impossible to change working directory","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-10-01T15:34:05Z","receivedAt":"2016-10-01T15:35:37Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 29.09.16 21:30, Sebastian Feldmann wrote:\n> Hi there,\n>\n> I have a problem executing a pre-commit hook.\n> The hook script has to change the working directory to work and if I use plain\n>\n> git commit\n>\n> it works as expected, the script executes without errors, but if I use\n>\n> git commit —only file.x file.y\n>\n> the script fails because changing the current working directory fails.\n> If I echo the current working directory it always echoes the root repository path\n>\n> Is this expected behavior?\n> Thanks for your feedback.\nIs there any chance to send us the content of the script ?\n(Or a demo example, which doesn't work)\n\n"}]}