From: Christian Couder <christian.couder@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git <git@vger.kernel.org>, "Jeff King" <peff@peff.net>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Nguyen Thai Ngoc Duy" <pclouds@gmail.com>,
"David Turner" <dturner@twopensource.com>,
"Christian Couder" <chriscool@tuxfamily.org>
Subject: Re: [RFC/PATCH] config: add core.trustmtime
Date: Wed, 25 Nov 2015 11:39:30 +0100 [thread overview]
Message-ID: <CAP8UFD18KkH25S3RmyuBQrvGYELSTR1FfZAYKzr-Yzd6OJvmxQ@mail.gmail.com> (raw)
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:
> 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.
prev parent reply other threads:[~2015-11-25 10:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-25 6:35 [RFC/PATCH] config: add core.trustmtime Christian Couder
2015-11-25 9:00 ` Ævar Arnfjörð Bjarmason
2015-11-25 19:51 ` Duy Nguyen
2015-11-26 5:21 ` Christian Couder
2015-11-26 17:53 ` Duy Nguyen
2015-11-27 1:35 ` Ævar Arnfjörð Bjarmason
2015-11-30 19:05 ` Junio C Hamano
2015-11-30 19:12 ` Duy Nguyen
2015-12-01 5:57 ` Torsten Bögershausen
2015-12-02 19:28 ` Duy Nguyen
2015-12-07 5:42 ` Christian Couder
2015-11-25 10:25 ` Johannes Schindelin
2015-11-25 10:39 ` Christian Couder [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAP8UFD18KkH25S3RmyuBQrvGYELSTR1FfZAYKzr-Yzd6OJvmxQ@mail.gmail.com \
--to=christian.couder@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=avarab@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=dturner@twopensource.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).