Re: [RFC/PATCH] Implement poor-man's submodule support in pre-commit hook
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Dec 20, 2006, 12:01 UTC
- Message-ID
- <emb8h2$io4$1@sea.gmane.org>
- In-Reply-To
- <A76C0FA3-1649-409B-B0D4-C22865622C1F@silverinsanity.com>
Brian Gernhardt wrote:
Show 18 quoted lines
>
> On Dec 20, 2006, at 5:08 AM, Andy Parkins wrote:
>
>> Hello,
>>
>> Help...
>>
>>> +if [ -f .gitmodules ]; then
>>
>> This doesn't work because git-commit is not necessarily in the root
>> of the
>> working tree. How do I safely get that root? While ${GIT_DIR}/..
>> would work
>> it is not guaranteed.
>
> The way to do that seems to be "git rev-parse --git-dir". I'm not
> sure why it's not just "git --git-dir" or similar (probably just
> historical reasons), but there you go.Because it is "git --git-dir=<PATH>" to set it (probably). Although it is not insurmountable difficulity...
-- Jakub Narebski Warsaw, Poland ShadeHawk on #git