Re: [PATCH/POC 2/7] Add new environment variable $GIT_SUPER_DIR

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

 



On Sat, Dec 14, 2013 at 1:12 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> diff --git a/path.c b/path.c
>> index eda9176..86a7c15 100644
>> --- a/path.c
>> +++ b/path.c
>> @@ -75,6 +75,16 @@ static void adjust_git_path(char *buf, int git_dir_len)
>>               strcpy(buf, get_index_file());
>>       else if (git_db_env && dir_prefix(base, "objects"))
>>               replace_dir(buf, git_dir_len + 7, get_object_directory());
>> +     else if (get_git_super_dir()) {
>> +             if (dir_prefix(base, "objects") || dir_prefix(base, "info") ||
>> +                 dir_prefix(base, "refs") ||
>> +                 (dir_prefix(base, "logs") && strcmp(base, "logs/HEAD")) ||
>> +                 dir_prefix(base, "rr-cache") || dir_prefix(base, "hooks") ||
>> +                 dir_prefix(base, "svn") ||
>> +                 !strcmp(base, "config") || !strcmp(base, "packed-refs") ||
>> +                 !strcmp(base, "shallow"))
>> +                     replace_dir(buf, git_dir_len, get_git_super_dir());
>> +     }
>
> This is essentially the list of what are shared across workdirs,
> right?  I wonder if it is a bad idea to make everything under .git
> of the borrowed repository shared by default, with selected
> exceptions.  Granted, not sharing by default is definitely safer
> than blindly sharing by default, so that alone may be a good
> argument to use a set of known-to-be-safe-to-share paths, like this
> code does.

The exception list could be equally long (most of them are *_HEAD).
.git is also used for temporary files with mkstemp, but I think that's
safe for sharing. What could break is when people add a new local
*_HEAD and forget to update the exception list.

> Don't we want .git/branches and .git/remotes shared?  After all,
> their moral equivalents from .git/config are shared with the code.

Yes. I missed them.
-- 
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]