{"thread":{"id":"14979","subject":"git -p does not detect a bare repository","startedAt":"2008-08-13T13:51:21Z","lastAt":"2008-08-13T16:51:36Z","messageCount":2,"participants":["Johannes Sixt","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"87048","messageId":"48A2E6D9.5000609@viscovery.net","threadId":"14979","inReplyTo":null,"subject":"git -p does not detect a bare repository","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-08-13T13:51:21Z","receivedAt":"2008-08-13T13:51:21Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"If $PWD is a bare repository, is it expected behavior that\n\n  $ git diff-tree master^ master\n\nworks as expected, but\n\n  $ git -p diff-tree master^ master\n\nerrors out:\n\n  fatal: ambiguous argument 'master^': unknown revision or path blabla...\n\n-- Hannes\n"},{"id":"87074","messageId":"20080813165135.GA19490@sigill.intra.peff.net","threadId":"14979","inReplyTo":"48A2E6D9.5000609@viscovery.net","subject":"Re: git -p does not detect a bare repository","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-08-13T16:51:36Z","receivedAt":"2008-08-13T16:51:36Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Aug 13, 2008 at 03:51:21PM +0200, Johannes Sixt wrote:\n\n> If $PWD is a bare repository, is it expected behavior that\n> \n>   $ git diff-tree master^ master\n> \n> works as expected, but\n> \n>   $ git -p diff-tree master^ master\n> \n> errors out:\n> \n>   fatal: ambiguous argument 'master^': unknown revision or path blabla...\n\nYep. This has been broken for some time, too. I bisected it down to\ncad3a205 from last year, which is in v1.5.3.\n\nIt's yet another incarnation of the same bug we keep seeing (which I\nsuppose is why you cc'd me). Anytime you look at the config before\nrunning setup_git_directory, it screws up the GIT_DIR calculation for\nbare repositories. AFAIK it's a bad interaction between the lazy setup\nin setup_git_env and the magic in setup_git_directory.\n\nI'm sure there is a \"right\" solution but I haven't had time to figure it\nout yet. In this case, we are looking at the config to get the value of\ncore.pager. As a workaround, you could try doing that lookup in the\nforked pager child (however, I don't think that would work on platforms\nwhere run_command doesn't use fork).\n\n-Peff\n"}]}