Subject: Re: [SQUASHED PATCH] Add support for GIT_CEILING_DIRECTORIES

From: David Reiss <[email-masked]>
Date: Fri, 16 May 2008 10:43:18 -0700

Sorry I missed this before.  As you said, in Johannes's version the
ceiling directories are the last directories we look in, whereas in my
implementation, they are the first directories we do not look in.  I
made this choice because it makes more sense for me to set my ceiling to
"/home", rather than "/home/dreiss", so it will work even if I am in
another user's homedir.

There is also a difference in how they handle the case where the cwd is
a ceiling directory, but I think it is worth sorting out the first issue
first.

--David

Johannes Sixt wrote:
> Johannes Schindelin schrieb:
>> Hi,
>>
>> On Fri, 16 May 2008, Johannes Sixt wrote:
>>
>>> Johannes Schindelin schrieb:
>>>> +'GIT_CEILING_DIRECTORIES'::
>>>> +   If set (to a colon delimited list of absolute directories), Git
>>>> +   will refuse to look for the .git/ directory further when hitting
>>>> +   one of those directories (otherwise it would traverse the parent
>>>> +   directories until hitting the root directory).
>>> Hmm.
>>>
>>> Looking at the current implementation, this should be written as:
>>>
>>>      If set to a colon delimited list of absolute directories,
>>>      and the current directory is in or below one of them, then
>>>      these are the top-most directories in which Git will look for
>>>      a .git/ directory (otherwise it would traverse the parent
>>>      directories until hitting the root directory).
>>
>> According to the test case
>>
>>         GIT_CEILING_DIRECTORIES="$CWD/X:$CWD/subdir" &&
>>         export GIT_CEILING_DIRECTORIES &&
>>         (cd subdir && test_must_fail git rev-parse --git-dir)
>>
>> this is not the case.  If you have something like /bla/subdir and you are
>> in /bla/subdir, it will not look for .git/.
> 
> No, the test just shows that it does not *find* a subdir/.git/, but it
> does not show that it doesn't even *look* for it.
> 
> Let's first clarify the semantics of GIT_CEILING_DIRECTORIES before we
> start fixing something: Can a directory that is named in
> GIT_CEILING_DIRECTORIES be a git repository or not?
> 
> David's original motivation was that it cannot; in your implementation
> it can.
> 
> -- Hannes
>