Re: [PATCH v4 18/27] setup.c: support multi-checkout repo setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 6, 2014 at 2:42 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Nguyễn Thái Ngọc Duy  <pclouds@xxxxxxxxx> writes:
>
>>  core.worktree::
>>       Set the path to the root of the working tree.
>> +     If GIT_COMMON_DIR environment variable is set, core.worktree
>> +     is ignored and not used for determining the root of working tree.
>
> Just thinking aloud to see if I got the full implication of the
> above right...
>
> If we find ourselves in the multi-checkout mode because we saw
> .git/commondir on the filesystem, it is clear that the root of the
> working tree is the parent directory of that .git directory.
>
> If the reason we think we are in the multi-checkout mode is not
> because of .git/commondir but because $GIT_COMMON_DIR is set,

I tend to think so, .git/commondir is just a convenient way to set
$GIT_COMMON_DIR. $GIT_COMMON_DIR is the key. config.txt correctly
states so, but the commit message is misleading.

>  should we assume the same relationship between the root of the working tree
> and the GIT_DIR (however we find it) when the environment variable
> $GIT_WORK_TREE is not set?  Or should that configuration be an error?
> With $GIT_DIR set without $GIT_WORK_TREE set, the user is telling us
> that the $cwd is the root of the working tree, so perhaps we should
> do the same?

It should work exactly like how normal worktree does, so if $GIT_DIR
is set and $GIT_WORK_TREE is not, $PWD is the worktree root.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]