git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: How to undo previously set configuration?
Date: Thu, 05 Apr 2018 13:21:02 +0200	[thread overview]
Message-ID: <8737092929.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <20180405104948.276de0ca.olaf@aepfle.de>


On Thu, Apr 05 2018, Olaf Hering wrote:

> Am Thu, 05 Apr 2018 10:42:15 +0200
> schrieb Ævar Arnfjörð Bjarmason <avarab@gmail.com>:
>
>> I've been meaning to work on this but haven't figured out a good syntax for it (suggestions welcome!).
>
> Just prefix the knob with something like "no." or "-" or whatever to indicate that it never happened.

Those wouldn't work, respectively, because:

 a) For 'no.' there would be no way to override three-level keys,
    because prefixing such a key with "no" would introduce a 4th nesting
    level, which would be incompatible with existing config parsers.

 b) Similarly a prefix of - dies in git now. Unless I misunderstand
    you. I'm assuming you mean something like:

        [user]
        # This is an error
        -email

    Although I see we don't ignore or error out on:

        [user "-email"]
        foo=bar

   But that's back to problem a), and also looks ugly since you need
   something like the extra foo=bar so we'll pay attention to it.

Also it's important that the syntax leaves room for item #1 that I
mentioned,

I.e. not just ignore stuff like user.email, but being able to specify
where from you'd like to ignore that. Sometimes your local sysadmin is
overzealous with his /etc/gitconfig settings and you'd like to
quarantine just that, but pay attention to everything else in
~/.gitconfig, or similarly in /some/repo/.git/config ignore your usual
custom sendemail.* from ~/.gitconfig but not /etc/gitconfig, so the
semantics can't just be "clear existing".

But of course, you might say that it *should* be a syntax error because
if you rely on this feature and downgrade, you don't want to suddenly
pay attention to the sendemail.* config again.

I think that's an acceptable failure mode, and better than the syntax
error, because that's exactly what we have now, so this is similar to
e.g. the conditional include directive which was understood but just
copmletely ignored by older versions.

So we're OK with getting different config between versions with new
releases, but at all costs don't want to have new releases introduce
constructs that older gits error out on, and let's say hypothetically we
supported something like:

    [user "-email"]
    [user]
        email = ...

Even `git config -l` on older version won't show that "user.-email", and
it's better if older tools at least understand the syntax, even though
they don't pick up on the magic.

  reply	other threads:[~2018-04-05 11:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05  7:23 How to configure sendemail for no-auth? Olaf Hering
2018-04-05  8:42 ` How to undo previously set configuration? Ævar Arnfjörð Bjarmason
2018-04-05  8:49   ` Olaf Hering
2018-04-05 11:21     ` Ævar Arnfjörð Bjarmason [this message]
2018-04-05 12:03       ` Randall S. Becker
2018-04-05 13:25       ` Olaf Hering
2018-04-05 16:32         ` Jeff King
2018-04-06 15:55           ` Olaf Hering
2018-04-06 16:15             ` Jeff King
2018-04-06 16:57             ` Rafael Ascensao
2018-04-06 17:50               ` Jeff King
2018-04-05 10:24 ` How to configure sendemail for no-auth? astian
2018-04-05 10:27 ` astian

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737092929.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --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.
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 NNTP newsgroup(s).