Re: [PATCH v5 10/11] test-dump-untracked-cache: don't modify the untracked cache

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

 



On Fri, Jan 15, 2016 at 9:16 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Christian Couder <christian.couder@xxxxxxxxx> writes:
>
>> diff --git a/cache.h b/cache.h
>> index 59a15fd..89c7e10 100644
>> --- a/cache.h
>> +++ b/cache.h
>> @@ -1605,6 +1605,8 @@ extern int git_config_get_maybe_bool(const char *key, int *dest);
>>  extern int git_config_get_pathname(const char *key, const char **dest);
>>  extern int git_config_get_untracked_cache(void);
>>
>> +extern int ignore_untracked_cache_config;
>> +
>
> I know you said this is a hack to support the test, but I really do
> not like to have a test-only global variable exposed to everybody
> like this, as I do not think "ignore_untracked_cache_config" should
> be necessary outside the context of testing [*1*].
>
> If the config cache layer that is used by the implementation of
> git_config_get_untracked_cache() had a way to be told to pretend
> that the value of a particular configuration variable is a given
> value, then we could do
>
>         git_config_pretend_value("core.untrackedcache", "keep");
>
> at the beginning of the test program without harming anybody else.
>
> The above is just me "thinking aloud", without assessing if the
> damage to the entire codebase with that approach to extend the
> config layer would be larger than the damabe by this patch, and it
> is certainly not a suggestion to redo this patch along that line.
> But I am saying it aloud because it may turn out to be a good
> direction to go in the larger picture once this series is done--it
> may be a solution that is applicable to a class of similar problems
> in a more general way.
>
> Inside the scope of this series, can we at least add a comment next
> to this variable telling everybody to never use it in normal
> programs, or something?

Ok, the comments have been added or rewritten telling that in the v6 I
just sent, thanks.
--
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]