{"thread":{"id":"26115","subject":"\"git pull\" doesn't respect --work-tree parameter","startedAt":"2010-12-21T16:04:31Z","lastAt":"2010-12-22T11:55:23Z","messageCount":7,"participants":["Alexey Zakhlestin","Nguyen Thai Ngoc Duy","Andreas Ericsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"158441","messageId":"AANLkTi=UtZuPQcTNnwS_fXgzRn4MHAUGS8zyTMqX9E2J@mail.gmail.com","threadId":"26115","inReplyTo":null,"subject":"\"git pull\" doesn't respect --work-tree parameter","fromName":"Alexey Zakhlestin","fromEmail":"indeyets@gmail.com","sentAt":"2010-12-21T16:04:31Z","receivedAt":"2010-12-21T16:04:31Z","isPatch":false,"sender":{"key":"indeyets@gmail.com","avatar":"https://gravatar.com/avatar/24e2a17f02a5187239b508e59e696a1f8dcbe69ed6322a59f1bd17c5175b70c6?d=mp&s=160"},"body":"I am trying to use the following command:\n\ngit '--git-dir=/path/to/repository/.git' '--work-tree=/path/to/repository' pull\n\nand get this error:\n\"git-pull cannot be used without a working tree\"\n\nI get the same error, if I try to use corresponding environment variables\n\n\nlooks like a bug, because I can, successfully, use \"git status\" with\nthe same --git-dir and --work-tree parameters\n\n-- \nAlexey Zakhlestin, http://twitter.com/jimi_dini\nhttp://www.milkfarmsoft.com/\n"},{"id":"158478","messageId":"AANLkTik9s0cLc_P=NWvpO=DhytOkLNASEM7sjzoscHo3@mail.gmail.com","threadId":"26115","inReplyTo":"AANLkTi=UtZuPQcTNnwS_fXgzRn4MHAUGS8zyTMqX9E2J@mail.gmail.com","subject":"Re: \"git pull\" doesn't respect --work-tree parameter","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-12-22T11:20:23Z","receivedAt":"2010-12-22T11:20:23Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, Dec 21, 2010 at 11:04 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:\n> I am trying to use the following command:\n>\n> git '--git-dir=/path/to/repository/.git' '--work-tree=/path/to/repository' pull\n>\n> and get this error:\n> \"git-pull cannot be used without a working tree\"\n\nIt works fine for me. What's the result of\n\ngit '--git-dir=/path/to/repository/.git'\n'--work-tree=/path/to/repository' --git-dir\ngit '--git-dir=/path/to/repository/.git'\n'--work-tree=/path/to/repository' --is-inside-work-tree\ngit '--git-dir=/path/to/repository/.git'\n'--work-tree=/path/to/repository' --show-toplevel\n\n?\n\nAlso what version of git are you using?\n-- \nDuy\n"},{"id":"158480","messageId":"AANLkTinGPJRQCOVz5JeqL4xnUG9V=5fkJhz6C5Mi1A3o@mail.gmail.com","threadId":"26115","inReplyTo":"AANLkTik9s0cLc_P=NWvpO=DhytOkLNASEM7sjzoscHo3@mail.gmail.com","subject":"Re: \"git pull\" doesn't respect --work-tree parameter","fromName":"Alexey Zakhlestin","fromEmail":"indeyets@gmail.com","sentAt":"2010-12-22T11:40:26Z","receivedAt":"2010-12-22T11:40:26Z","isPatch":false,"sender":{"key":"indeyets@gmail.com","avatar":"https://gravatar.com/avatar/24e2a17f02a5187239b508e59e696a1f8dcbe69ed6322a59f1bd17c5175b70c6?d=mp&s=160"},"body":"On Wed, Dec 22, 2010 at 2:20 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n> On Tue, Dec 21, 2010 at 11:04 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:\n>> I am trying to use the following command:\n>>\n>> git '--git-dir=/path/to/repository/.git' '--work-tree=/path/to/repository' pull\n>>\n>> and get this error:\n>> \"git-pull cannot be used without a working tree\"\n>\n> It works fine for me. What's the result of\n>\n> git '--git-dir=/path/to/repository/.git'\n> '--work-tree=/path/to/repository' --git-dir\n\nNo directory given for --git-dir.\n\n> git '--git-dir=/path/to/repository/.git'\n> '--work-tree=/path/to/repository' --is-inside-work-tree\n\nUnknown option: --is-inside-work-tree\n\n> git '--git-dir=/path/to/repository/.git'\n> '--work-tree=/path/to/repository' --show-toplevel\n\nUnknown option: --show-toplevel\n\n\n> Also what version of git are you using?\n\n1.7.3.4\n\n-- \nAlexey Zakhlestin, http://twitter.com/jimi_dini\nhttp://www.milkfarmsoft.com/\n"},{"id":"158481","messageId":"4D11E427.5040506@op5.se","threadId":"26115","inReplyTo":"AANLkTinGPJRQCOVz5JeqL4xnUG9V=5fkJhz6C5Mi1A3o@mail.gmail.com","subject":"Re: \"git pull\" doesn't respect --work-tree parameter","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2010-12-22T11:42:31Z","receivedAt":"2010-12-22T11:42:31Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"On 12/22/2010 12:40 PM, Alexey Zakhlestin wrote:\n> On Wed, Dec 22, 2010 at 2:20 PM, Nguyen Thai Ngoc Duy<pclouds@gmail.com>  wrote:\n>> On Tue, Dec 21, 2010 at 11:04 PM, Alexey Zakhlestin<indeyets@gmail.com>  wrote:\n>>> I am trying to use the following command:\n>>>\n>>> git '--git-dir=/path/to/repository/.git' '--work-tree=/path/to/repository' pull\n>>>\n>>> and get this error:\n>>> \"git-pull cannot be used without a working tree\"\n>>\n>> It works fine for me. What's the result of\n>>\n>> git '--git-dir=/path/to/repository/.git'\n>> '--work-tree=/path/to/repository' --git-dir\n> \n> No directory given for --git-dir.\n> \n\nYou added an extra --git-dir without an argument at the end of\nthe command. Remove it and try again.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n\nConsidering the successes of the wars on alcohol, poverty, drugs and\nterror, I think we should give some serious thought to declaring war\non peace.\n"},{"id":"158482","messageId":"AANLkTimM9Ah+D6uYnOuZDjYzKfN2-YVArOAwegO9dbSD@mail.gmail.com","threadId":"26115","inReplyTo":"AANLkTinGPJRQCOVz5JeqL4xnUG9V=5fkJhz6C5Mi1A3o@mail.gmail.com","subject":"Re: \"git pull\" doesn't respect --work-tree parameter","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-12-22T11:44:05Z","receivedAt":"2010-12-22T11:44:05Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Dec 22, 2010 at 6:40 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:\n> On Wed, Dec 22, 2010 at 2:20 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n>> On Tue, Dec 21, 2010 at 11:04 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:\n>>> I am trying to use the following command:\n>>>\n>>> git '--git-dir=/path/to/repository/.git' '--work-tree=/path/to/repository' pull\n>>>\n>>> and get this error:\n>>> \"git-pull cannot be used without a working tree\"\n>>\n>> It works fine for me. What's the result of\n>>\n>> git '--git-dir=/path/to/repository/.git'\n>> '--work-tree=/path/to/repository' --git-dir\n>\n> No directory given for --git-dir.\n>\n>> git '--git-dir=/path/to/repository/.git'\n>> '--work-tree=/path/to/repository' --is-inside-work-tree\n>\n> Unknown option: --is-inside-work-tree\n>\n>> git '--git-dir=/path/to/repository/.git'\n>> '--work-tree=/path/to/repository' --show-toplevel\n>\n> Unknown option: --show-toplevel\n\nSorry I forgot the command name (rev-parse). The full command should\nbe \"git --git-dir=... --work-tree=... rev-parse <option>\" where option\nis --git-dir, --is-inside-work-tree, --show-toplevel. Can you please\ntry again?\n-- \nDuy\n"},{"id":"158483","messageId":"AANLkTi=JrOe=z4LNZtxfsDvkG2jYCtemYESftv=61ZrJ@mail.gmail.com","threadId":"26115","inReplyTo":"AANLkTimM9Ah+D6uYnOuZDjYzKfN2-YVArOAwegO9dbSD@mail.gmail.com","subject":"Re: \"git pull\" doesn't respect --work-tree parameter","fromName":"Alexey Zakhlestin","fromEmail":"indeyets@gmail.com","sentAt":"2010-12-22T11:50:03Z","receivedAt":"2010-12-22T11:50:03Z","isPatch":false,"sender":{"key":"indeyets@gmail.com","avatar":"https://gravatar.com/avatar/24e2a17f02a5187239b508e59e696a1f8dcbe69ed6322a59f1bd17c5175b70c6?d=mp&s=160"},"body":"On Wed, Dec 22, 2010 at 2:44 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n> On Wed, Dec 22, 2010 at 6:40 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:\n>> On Wed, Dec 22, 2010 at 2:20 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n>>> On Tue, Dec 21, 2010 at 11:04 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:\n>>>> I am trying to use the following command:\n>>>>\n>>>> git '--git-dir=/path/to/repository/.git' '--work-tree=/path/to/repository' pull\n>>>>\n>>>> and get this error:\n>>>> \"git-pull cannot be used without a working tree\"\n>>>\n>>> It works fine for me. What's the result of\n>>>\n>>> git '--git-dir=/path/to/repository/.git'\n>>> '--work-tree=/path/to/repository' --git-dir\n>>\n>> No directory given for --git-dir.\n>>\n>>> git '--git-dir=/path/to/repository/.git'\n>>> '--work-tree=/path/to/repository' --is-inside-work-tree\n>>\n>> Unknown option: --is-inside-work-tree\n>>\n>>> git '--git-dir=/path/to/repository/.git'\n>>> '--work-tree=/path/to/repository' --show-toplevel\n>>\n>> Unknown option: --show-toplevel\n>\n> Sorry I forgot the command name (rev-parse). The full command should\n> be \"git --git-dir=... --work-tree=... rev-parse <option>\" where option\n> is --git-dir, --is-inside-work-tree, --show-toplevel. Can you please\n> try again?\n\n1) returns correct path:\n/Users/indy/Documents/Sources/_mine/midgard/mvc/_rdf/midgardmvc_core/.git\n2) false\n3) returns correct path, again:\n/Users/indy/Documents/Sources/_mine/midgard/mvc/_rdf/midgardmvc_core\n\njust to make myself clear: $PWD is another path, not related to repository path\n\n-- \nAlexey Zakhlestin, http://twitter.com/jimi_dini\nhttp://www.milkfarmsoft.com/\n"},{"id":"158485","messageId":"AANLkTikoBaJmo97wh_zNaUAFHq3sf1j4b2HDuEmjRKnt@mail.gmail.com","threadId":"26115","inReplyTo":"AANLkTi=JrOe=z4LNZtxfsDvkG2jYCtemYESftv=61ZrJ@mail.gmail.com","subject":"Re: \"git pull\" doesn't respect --work-tree parameter","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-12-22T11:55:23Z","receivedAt":"2010-12-22T11:55:23Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Dec 22, 2010 at 6:50 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:\n> 1) returns correct path:\n> /Users/indy/Documents/Sources/_mine/midgard/mvc/_rdf/midgardmvc_core/.git\n> 2) false\n> 3) returns correct path, again:\n> /Users/indy/Documents/Sources/_mine/midgard/mvc/_rdf/midgardmvc_core\n>\n> just to make myself clear: $PWD is another path, not related to repository path\n\nOK. git-pull does not automatically move to worktree (while git-status\ndoes) and thus won't work when $PWD is outside worktree. I remember\nthere's a similar report this year. I'll see if I can make a patch for\nit.\n\nThank you for your report.\n-- \nDuy\n"}]}