git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* How to configure sendemail for no-auth?
@ 2018-04-05  7:23 Olaf Hering
  2018-04-05  8:42 ` How to undo previously set configuration? Ævar Arnfjörð Bjarmason
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Olaf Hering @ 2018-04-05  7:23 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

My ~/.gitconfig looks like this, because all cloned repositories require these settings:
[sendemail]
        from = Olaf Hering <olaf@aepfle.de>
        envelopesender = olaf@aepfle.de
        chainreplyto = false
        ccover = yes
        smtpencryption = tls
        smtpdomain = sender
        smtppass = smtppass
        smtpAuth = PLAIN
        smtpserver = smtp.strato.de
        smtpuser = smtpuser
        confirm = always
        assume8bitEncoding = yes
        transferEncoding = 8bit

Now there is that one repo that requires this:

[sendemail]
        from = Olaf Hering <a@b.c>
        envelopesender = a@b.c
        smtpserver = otherhost

That "otherhost" does just plain oldstyle unencrypted SMTP.

How do I undo the global sendemail settings for that one repo?
Setting the knobs to empty strings does not help:
Command unknown: 'AUTH' at /usr/lib/git/git-send-email line 1455.

It seems the global smtpuser is causing the error.

Olaf

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* How to undo previously set configuration?
  2018-04-05  7:23 How to configure sendemail for no-auth? Olaf Hering
@ 2018-04-05  8:42 ` Ævar Arnfjörð Bjarmason
  2018-04-05  8:49   ` Olaf Hering
  2018-04-05 10:24 ` How to configure sendemail for no-auth? astian
  2018-04-05 10:27 ` astian
  2 siblings, 1 reply; 13+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2018-04-05  8:42 UTC (permalink / raw)
  To: Olaf Hering; +Cc: git, Jeff King


On Thu, Apr 05 2018, Olaf Hering wrote:

[Changed subject]

> My ~/.gitconfig looks like this, because all cloned repositories require these settings:
> [sendemail]
>         from = Olaf Hering <olaf@aepfle.de>
>         envelopesender = olaf@aepfle.de
>         chainreplyto = false
>         ccover = yes
>         smtpencryption = tls
>         smtpdomain = sender
>         smtppass = smtppass
>         smtpAuth = PLAIN
>         smtpserver = smtp.strato.de
>         smtpuser = smtpuser
>         confirm = always
>         assume8bitEncoding = yes
>         transferEncoding = 8bit
>
> Now there is that one repo that requires this:
>
> [sendemail]
>         from = Olaf Hering <a@b.c>
>         envelopesender = a@b.c
>         smtpserver = otherhost
>
> That "otherhost" does just plain oldstyle unencrypted SMTP.
>
> How do I undo the global sendemail settings for that one repo?
> Setting the knobs to empty strings does not help:
> Command unknown: 'AUTH' at /usr/lib/git/git-send-email line 1455.
>
> It seems the global smtpuser is causing the error.

There isn't any way to do this, the only way out is the hack of using
conditional includes and placing this repository in some special
location.

In general it would be very nice if git learned to conditionally pay
attention to config from various places, I've been meaning to work on
this but haven't figured out a good syntax for it (suggestions
welcome!). Things I'd like to do:

1) Set some config in e.g. ~/.gitconfig saying that I want to ignore
   everything from /etc/gitconfig, or in /some/repo/.git/config saying I
   want to ignore ~/.gitconfig but not /etc/gitconfig.

2) Ditto #1 but more granular, e.g. for your use-case saying you're OK
   with grabbing ~/.gitconfig, but you'd like to ignore all sendemail.*
   values from there, or say in your local .git/config that you'd like
   to ignore all previously set sendemail.* no matter where it came
   from.

3) Ability to re-arrange the config priority, right now it's hardcoded
   that we look at /etc/gitconfig, then ~/.gitconfig then your
   .git/config. You can add a config for ~/work with the conditional
   includes, but it would be nice (just as a general thing) to also
   re-arrange things so /etc/gitconfig gets parsed last or whatever.

   I don't really have a use-case for that, but adding such priorities
   would be simple once we had support for #1 and #2, just some
   "priority" integer you could override for each file, and we'd set
   default values for them, e.g. 10 for /etc/gitconfig, 20 for
   ~/.gitconfig, 40 for .git/config etc.

For any of this to work we'd need to re-arrange the config code so that
we'd fully parse all the config files first, and consider any such
"ignore the thing before me" rules in each file, and then make a second
pass over the config data

The ulterior motive I want this for is to eventually support some
facility where we can safely load a .gitconfig from clone repos, since
once we have this for other reasons (and as noted above, it would be
useful for that in its own right) we can load .gitconfig from some
untrusted source, because we're going to be able to say that we only
trust the repo's .gitconfig to set sendemail.to or whatever, but nothing
else.

Previous ramblings from me on this subject:
https://public-inbox.org/git/87zi6eakkt.fsf@evledraar.gmail.com/

So maybe something like this in a .git/config

    # Reject all previous such [config] overrides, by default we'd add
    # them (as default in git config)
    [config]
    reject = *
    [config "system"]
    priority = 50
    reject = *
    accept = sendmail.*
    [config "global"]
    reject = *
    accept = sendmail.*

And eventually have git itself mark up each config option on some scale
of least harmful (sendmail.to & friends) to most harmful (executing
shell aliases), and:

    # Remote maintained untrusted config
    [config "repo"]
    acceptLevel = least-harmful

Or whatever toggle to include some default policy shipped with
git. Actually we could just do that with more generally with config
includes if we learned some syntax for including some templates shipped
with git itself.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to undo previously set configuration?
  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
  0 siblings, 1 reply; 13+ messages in thread
From: Olaf Hering @ 2018-04-05  8:49 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Jeff King

[-- Attachment #1: Type: text/plain, Size: 313 bytes --]

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.

Olaf

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to configure sendemail for no-auth?
  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 10:24 ` astian
  2018-04-05 10:27 ` astian
  2 siblings, 0 replies; 13+ messages in thread
From: astian @ 2018-04-05 10:24 UTC (permalink / raw)
  To: git; +Cc: Olaf Hering

Olaf Hering:
> My ~/.gitconfig looks like this, because all cloned repositories require these settings:
> [sendemail]
>         from = Olaf Hering <olaf@aepfle.de>
>         envelopesender = olaf@aepfle.de
>         chainreplyto = false
>         ccover = yes
>         smtpencryption = tls
>         smtpdomain = sender
>         smtppass = smtppass
>         smtpAuth = PLAIN
>         smtpserver = smtp.strato.de
>         smtpuser = smtpuser
>         confirm = always
>         assume8bitEncoding = yes
>         transferEncoding = 8bit
> 
> Now there is that one repo that requires this:
> 
> [sendemail]
>         from = Olaf Hering <a@b.c>
>         envelopesender = a@b.c
>         smtpserver = otherhost
> 
> That "otherhost" does just plain oldstyle unencrypted SMTP.
> 
> How do I undo the global sendemail settings for that one repo?
> Setting the knobs to empty strings does not help:
> Command unknown: 'AUTH' at /usr/lib/git/git-send-email line 1455.
> 
> It seems the global smtpuser is causing the error.
> 
> Olaf

Hm, I remember successfully doing something like this, quite some time ago.

Couldn't you simply disable smtpEncryption in the .git/config of that one
repo?  E.g.:

[sendemail]
  smtpEncryption = none

You might also want to take a look at "identities" in the manual.  And related
to that, there's a patch in this old (never merged) series of mine which might
be useful since I believe the documentation bug it fixes still exists.

Cheers.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to configure sendemail for no-auth?
  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 10:24 ` How to configure sendemail for no-auth? astian
@ 2018-04-05 10:27 ` astian
  2 siblings, 0 replies; 13+ messages in thread
From: astian @ 2018-04-05 10:27 UTC (permalink / raw)
  To: git; +Cc: Olaf Hering

astian:
> Olaf Hering:> My ~/.gitconfig looks like this, because all cloned repositories require these settings:
>> [sendemail]
>>         from = Olaf Hering <olaf@aepfle.de>
>>         envelopesender = olaf@aepfle.de
>>         chainreplyto = false
>>         ccover = yes
>>         smtpencryption = tls
>>         smtpdomain = sender
>>         smtppass = smtppass
>>         smtpAuth = PLAIN
>>         smtpserver = smtp.strato.de
>>         smtpuser = smtpuser
>>         confirm = always
>>         assume8bitEncoding = yes
>>         transferEncoding = 8bit
>> 
>> Now there is that one repo that requires this:
>> 
>> [sendemail]
>>         from = Olaf Hering <a@b.c>
>>         envelopesender = a@b.c
>>         smtpserver = otherhost
>> 
>> That "otherhost" does just plain oldstyle unencrypted SMTP.
>> 
>> How do I undo the global sendemail settings for that one repo?
>> Setting the knobs to empty strings does not help:
>> Command unknown: 'AUTH' at /usr/lib/git/git-send-email line 1455.
>> 
>> It seems the global smtpuser is causing the error.
>> 
>> Olaf
> Hm, I remember successfully doing something like this, quite some time ago.
> 
> Couldn't you simply disable smtpEncryption in the .git/config of that one
> repo?  E.g.:
> 
> [sendemail]
>   smtpEncryption = none
> 
> You might also want to take a look at "identities" in the manual.  And related
> to that, there's a patch in this old (never merged) series of mine which might
> be useful since I believe the documentation bug it fixes still exists.
> 
> Cheers.

Err, forgot the link:
https://public-inbox.org/git/xmqqzicc6zbf.fsf@gitster.mtv.corp.google.com/T/

Cheers.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to undo previously set configuration?
  2018-04-05  8:49   ` Olaf Hering
@ 2018-04-05 11:21     ` Ævar Arnfjörð Bjarmason
  2018-04-05 12:03       ` Randall S. Becker
  2018-04-05 13:25       ` Olaf Hering
  0 siblings, 2 replies; 13+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2018-04-05 11:21 UTC (permalink / raw)
  To: Olaf Hering; +Cc: git, Jeff King


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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: How to undo previously set configuration?
  2018-04-05 11:21     ` Ævar Arnfjörð Bjarmason
@ 2018-04-05 12:03       ` Randall S. Becker
  2018-04-05 13:25       ` Olaf Hering
  1 sibling, 0 replies; 13+ messages in thread
From: Randall S. Becker @ 2018-04-05 12:03 UTC (permalink / raw)
  To: 'Ævar Arnfjörð Bjarmason',
	'Olaf Hering'
  Cc: git, 'Jeff King'

On April 5, 2018 7:21 AM, Ævar Arnfjörð Bjarmason wrote:
> 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.

I may be missing something but..

Another completely different approach to "undoing" configurations is to consider using git for this. Have a repository set up for your ~ directory, ignoring content other than .*, so you would ignore any sub-repositories at this level. Then manage your configuration as any other repo.

For configurations that are not user-specific, use in-repository configurations instead of system and global, so your undo is also handled by git. However, you can version control your /etc directory as well. We do that to detect changes (as a practical example, we have /etc/.git with some bits ignored but critical things involving rc.d, and the system git configurations are managed content in that repository. This implies our Ops team has to use git to make changes - a good thing - and 'git status' and 'git log' tells me immediately if someone changed something.

Undo becomes a git operation in both situations.

This may be complete OT, but I thought it might help

Cheers,
Randall

-- Brief whoami:
 NonStop developer since approximately 211288444200000000
 UNIX developer since approximately 421664400
-- In my real life, I talk too much.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to undo previously set configuration?
  2018-04-05 11:21     ` Ævar Arnfjörð Bjarmason
  2018-04-05 12:03       ` Randall S. Becker
@ 2018-04-05 13:25       ` Olaf Hering
  2018-04-05 16:32         ` Jeff King
  1 sibling, 1 reply; 13+ messages in thread
From: Olaf Hering @ 2018-04-05 13:25 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Jeff King

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

Am Thu, 05 Apr 2018 13:21:02 +0200
schrieb Ævar Arnfjörð Bjarmason <avarab@gmail.com>:

> I'm assuming you mean something like:
>         [user]
>         # This is an error
>         -email

Yes. Just some flag to say "whatever value this variable has from earlier parsing, forget it in case it really exists". Just like "unset PATH" in bash.

I do not know the git internals, so can not really help with the case.

Olaf

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to undo previously set configuration?
  2018-04-05 13:25       ` Olaf Hering
@ 2018-04-05 16:32         ` Jeff King
  2018-04-06 15:55           ` Olaf Hering
  0 siblings, 1 reply; 13+ messages in thread
From: Jeff King @ 2018-04-05 16:32 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ævar Arnfjörð Bjarmason, git

On Thu, Apr 05, 2018 at 03:25:25PM +0200, Olaf Hering wrote:

> Am Thu, 05 Apr 2018 13:21:02 +0200
> schrieb Ævar Arnfjörð Bjarmason <avarab@gmail.com>:
> 
> > I'm assuming you mean something like:
> >         [user]
> >         # This is an error
> >         -email
> 
> Yes. Just some flag to say "whatever value this variable has from
> earlier parsing, forget it in case it really exists". Just like "unset
> PATH" in bash.
> 
> I do not know the git internals, so can not really help with the case.

The general strategy in Git's config is that instead of "unsetting", you
should overwrite with whatever value you _do_ want. So a config option
like sendemail.smtpauth should accept some kind of empty or "none" value
to disable auth.

Most single-value config options should work this way (and if one
doesn't, I'd say that's a bug we should fix).

Multi-valued config (e.g., "remote.*.fetch") is harder, since it's
inherently a list where each new instance adds to the list. We've
discussed there having an empty value reset the list, but it's not
applied consistently.

-Peff

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to undo previously set configuration?
  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
  0 siblings, 2 replies; 13+ messages in thread
From: Olaf Hering @ 2018-04-06 15:55 UTC (permalink / raw)
  To: Jeff King; +Cc: Ævar Arnfjörð Bjarmason, git

[-- Attachment #1: Type: text/plain, Size: 656 bytes --]

Am Thu, 5 Apr 2018 12:32:27 -0400
schrieb Jeff King <peff@peff.net>:

> The general strategy in Git's config is that instead of "unsetting", you
> should overwrite with whatever value you _do_ want. So a config option
> like sendemail.smtpauth should accept some kind of empty or "none" value
> to disable auth.
> 
> Most single-value config options should work this way (and if one
> doesn't, I'd say that's a bug we should fix).

This does not work. Initially I copied the global config into the repo and set all unwanted values to <empty>, like 'smtpuser='. Perhaps the config parser recognized that fact, but the consumer does not?

Olaf

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to undo previously set configuration?
  2018-04-06 15:55           ` Olaf Hering
@ 2018-04-06 16:15             ` Jeff King
  2018-04-06 16:57             ` Rafael Ascensao
  1 sibling, 0 replies; 13+ messages in thread
From: Jeff King @ 2018-04-06 16:15 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ævar Arnfjörð Bjarmason, git

On Fri, Apr 06, 2018 at 05:55:56PM +0200, Olaf Hering wrote:

> > The general strategy in Git's config is that instead of "unsetting",
> > you
> > should overwrite with whatever value you _do_ want. So a config option
> > like sendemail.smtpauth should accept some kind of empty or "none" value
> > to disable auth.
> > 
> > Most single-value config options should work this way (and if one
> > doesn't, I'd say that's a bug we should fix).
> 
> This does not work. Initially I copied the global config into the repo
> and set all unwanted values to <empty>, like 'smtpuser='. Perhaps the
> config parser recognized that fact, but the consumer does not?

Yes. That logic is handled by the consumer (especially in the case of
send-email, which is a perl script, the code runs in a totally separate
process from the config parser). Naively I'd think that:

  [sendemail]
  smtpAuth =

would do what you want, and then we'd ignore smtpUser completely.
It looks like the smtp_auth_maybe function uses perl's "defined" there,
though. Perhaps it should treat the empty string the same there.

(Or maybe it's something else; I don't use send-email myself, and in a
few trivial examples I couldn't get it to complain about similar
config).

-Peff

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to undo previously set configuration?
  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
  1 sibling, 1 reply; 13+ messages in thread
From: Rafael Ascensao @ 2018-04-06 16:57 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Jeff King, Ævar Arnfjörð Bjarmason,
	Git Mailing List

On Fri, Apr 6, 2018 at 4:55 PM, Olaf Hering <olaf@aepfle.de> wrote:
>
> This does not work. Initially I copied the global config into the repo and set all unwanted values to <empty>, like 'smtpuser='. Perhaps the config parser recognized that fact, but the consumer does not?
>

Today someone asked on #git for a way to disable diff.external for a
single command.
Without thinking much I suggested $git -c diff.external= diff; which fails with:
`fatal: cannot run : No such file or directory`

In this particular case there was `--no-ext-diff` to get around this
and the case was promptly resolved.
Just another another example where setting configuration values to
"empty" doesn't translate to "disable this option".

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to undo previously set configuration?
  2018-04-06 16:57             ` Rafael Ascensao
@ 2018-04-06 17:50               ` Jeff King
  0 siblings, 0 replies; 13+ messages in thread
From: Jeff King @ 2018-04-06 17:50 UTC (permalink / raw)
  To: Rafael Ascensao
  Cc: Olaf Hering, Ævar Arnfjörð Bjarmason,
	Git Mailing List

On Fri, Apr 06, 2018 at 05:57:39PM +0100, Rafael Ascensao wrote:

> On Fri, Apr 6, 2018 at 4:55 PM, Olaf Hering <olaf@aepfle.de> wrote:
> >
> > This does not work. Initially I copied the global config into the
> > repo and set all unwanted values to <empty>, like 'smtpuser='.
> > Perhaps the config parser recognized that fact, but the consumer
> > does not?
> >
> 
> Today someone asked on #git for a way to disable diff.external for a
> single command.
> Without thinking much I suggested $git -c diff.external= diff; which fails with:
> `fatal: cannot run : No such file or directory`
> 
> In this particular case there was `--no-ext-diff` to get around this
> and the case was promptly resolved.
> Just another another example where setting configuration values to
> "empty" doesn't translate to "disable this option".

Yeah, I think it would make sense in that case to reset
external_diff_cmd_cfg to NULL. I'd almost say that git_config_string()
should recognize and handle this case, but I suspect there are some
callers who need special behavior (e.g., to set it back to some
particular string).

-Peff

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-04-06 17:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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