{"thread":{"id":"34032","subject":"git rev-parse --show-toplevel doesn't work inside git-dir","startedAt":"2013-06-05T07:34:11Z","lastAt":"2013-06-05T16:17:54Z","messageCount":2,"participants":["Orgad Shaneh","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"219443","messageId":"CAGHpTB+AOrQfEGRxQ6qwFMFO0eKBMq19e3fUruNedm81o5rJfw@mail.gmail.com","threadId":"34032","inReplyTo":null,"subject":"git rev-parse --show-toplevel doesn't work inside git-dir","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2013-06-05T07:34:11Z","receivedAt":"2013-06-05T07:34:11Z","isPatch":false,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"Running \"git rev-parse --show-toplevel\" doesn't print anything when it\nis run inside .git dir (on all levels)\n\n- Orgad\n"},{"id":"219460","messageId":"20130605161754.GD8664@sigill.intra.peff.net","threadId":"34032","inReplyTo":"CAGHpTB+AOrQfEGRxQ6qwFMFO0eKBMq19e3fUruNedm81o5rJfw@mail.gmail.com","subject":"Re: git rev-parse --show-toplevel doesn't work inside git-dir","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-06-05T16:17:54Z","receivedAt":"2013-06-05T16:17:54Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jun 05, 2013 at 10:34:11AM +0300, Orgad Shaneh wrote:\n\n> Running \"git rev-parse --show-toplevel\" doesn't print anything when it\n> is run inside .git dir (on all levels)\n\nThis is by design. \"--show-toplevel\" does not print anything when you\ndo not have a working tree, and you do not have one if you are inside\nthe .git directory. If you were to do:\n\n  cd .git\n  git --work-tree=.. rev-parse --show-toplevel\n\n(or use GIT_WORK_TREE, or set core.worktree, etc), you would get back\nthe toplevel of the working tree.\n\n-Peff\n"}]}