git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH] config: add core.trustmtime

From
Christian Couder <christian.couder@gmail.com>
Date
Nov 25, 2015, 10:39 UTC
Message-ID
<CAP8UFD18KkH25S3RmyuBQrvGYELSTR1FfZAYKzr-Yzd6OJvmxQ@mail.gmail.com>
In-Reply-To
<alpine.DEB.1.00.1511251121390.1686@s15462909.onlinehome-server.info>
Hi Johannes,

On Wed, Nov 25, 2015 at 11:25 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 21 quoted lines
> Hi Christian,
>
> On Wed, 25 Nov 2015, Christian Couder wrote:
>
>> diff --git a/config.c b/config.c
>> index 248a21a..d720b1f 100644
>> --- a/config.c
>> +++ b/config.c
>> @@ -691,6 +691,13 @@ static int git_default_core_config(const char *var, const char *value)
>>               trust_ctime = git_config_bool(var, value);
>>               return 0;
>>       }
>> +     if (!strcmp(var, "core.trustmtime")) {
>> +             if (!strcasecmp(value, "default") || !strcasecmp(value, "check"))
>> +                     trust_mtime = -1;
>> +             else
>> +                     trust_mtime = git_config_maybe_bool(var, value);
>
> If `core.trustmtime` is set to `OMG, never!`, `git_config_maybe_bool()`
> will set trust_mtime to -1, i.e. the exact same value as if you had set
> the variable to `default` or `check`...
Yeah, I think returning -1 is the safe thing to do in this case.
> Maybe you want to be a bit stricter here and either test the return value
> of `git_config_maybe_bool()` for -1 (and warn in that case), or just
> delete the `maybe_`?

I thought that if we ever add more options in the future then people might be annoyed by older git versions warning about the new options. But I am ok to add a warning.

Thanks, Christian.

Previous: Johannes Schindelin
Message 13 of 13 in “config: add core.trustmtime”
  1. config: add core.trustmtimeChristian Couder, Nov 25, 2015
  2. Ævar Arnfjörð BjarmasonNov 25, 2015
  3. Duy NguyenNov 25, 2015
  4. Christian CouderNov 26, 2015
  5. Duy NguyenNov 26, 2015
  6. Ævar Arnfjörð BjarmasonNov 27, 2015
  7. Junio C HamanoNov 30, 2015
  8. Duy NguyenNov 30, 2015
  9. Torsten BögershausenDec 1, 2015
  10. Duy NguyenDec 2, 2015
  11. Christian CouderDec 7, 2015
  12. Johannes SchindelinNov 25, 2015
  13. Christian CouderNov 25, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.