git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Christian Couder <christian.couder@gmail.com>
Cc: 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:25:49 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.1.00.1511251121390.1686@s15462909.onlinehome-server.info> (raw)
In-Reply-To: <1448433323-21037-1-git-send-email-chriscool@tuxfamily.org>

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`...

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_`?

Ciao,
Dscho

  parent reply	other threads:[~2015-11-25 10:31 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 [this message]
2015-11-25 10:39   ` Christian Couder

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=alpine.DEB.1.00.1511251121390.1686@s15462909.onlinehome-server.info \
    --to=johannes.schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --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).