{"thread":{"id":"14956","subject":"fastest way to check if dir is a workdir","startedAt":"2008-08-12T11:34:56Z","lastAt":"2008-08-12T13:01:28Z","messageCount":2,"participants":["Thomas Koch","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"86919","messageId":"200808121334.57066.thomas@koch.ro","threadId":"14956","inReplyTo":null,"subject":"fastest way to check if dir is a workdir","fromName":"Thomas Koch","fromEmail":"thomas@koch.ro","sentAt":"2008-08-12T11:34:56Z","receivedAt":"2008-08-12T11:34:56Z","isPatch":false,"sender":{"key":"thomas@koch.ro","avatar":null},"body":"Hi,\n\nI'm writing a little php-git-wrapper and would like to have a function\nwhich tells me, whether a given path is part of a git checkout or not.\n\nWhat would be the fastest commandline to check, whether the current dir\nis part of a checkout? It may be assumed that the repository is at the\nstandard position.\n\nThanks a lot,\n-- \nThomas Koch, Software Developer\nhttp://www.koch.ro\n\nYoung Media Concepts GmbH\nSonnenstr. 4\nCH-8280 Kreuzlingen\nSwitzerland\n\nTel    +41 (0)71 / 508 24 86\nFax    +41 (0)71 / 560 53 89\nMobile +49 (0)170 / 753 89 16\nWeb    www.ymc.ch\n"},{"id":"86927","messageId":"20080812130128.GA28658@sigill.intra.peff.net","threadId":"14956","inReplyTo":"200808121334.57066.thomas@koch.ro","subject":"Re: fastest way to check if dir is a workdir","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-08-12T13:01:28Z","receivedAt":"2008-08-12T13:01:28Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Aug 12, 2008 at 01:34:56PM +0200, Thomas Koch wrote:\n\n> I'm writing a little php-git-wrapper and would like to have a function\n> which tells me, whether a given path is part of a git checkout or not.\n> \n> What would be the fastest commandline to check, whether the current dir\n> is part of a checkout? It may be assumed that the repository is at the\n> standard position.\n\nHow about \"git rev-parse --is-inside-work-tree\"?\n\n-Peff\n"}]}