{"thread":{"id":"48224","subject":"How to configure sendemail for no-auth?","startedAt":"2018-04-05T07:24:10Z","lastAt":"2018-04-06T17:50:57Z","messageCount":13,"participants":["Olaf Hering","Ævar Arnfjörð Bjarmason","astian","Randall S. Becker","Jeff King","Rafael Ascensao"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"343849","messageId":"20180405092358.569e0315.olaf@aepfle.de","threadId":"48224","inReplyTo":null,"subject":"How to configure sendemail for no-auth?","fromName":"Olaf Hering","fromEmail":"olaf@aepfle.de","sentAt":"2018-04-05T07:23:58Z","receivedAt":"2018-04-05T07:24:10Z","isPatch":false,"sender":{"key":"olaf@aepfle.de","avatar":"https://avatars.githubusercontent.com/u/942324?v=4"},"body":"My ~/.gitconfig looks like this, because all cloned repositories require these settings:\n[sendemail]\n        from = Olaf Hering <olaf@aepfle.de>\n        envelopesender = olaf@aepfle.de\n        chainreplyto = false\n        ccover = yes\n        smtpencryption = tls\n        smtpdomain = sender\n        smtppass = smtppass\n        smtpAuth = PLAIN\n        smtpserver = smtp.strato.de\n        smtpuser = smtpuser\n        confirm = always\n        assume8bitEncoding = yes\n        transferEncoding = 8bit\n\nNow there is that one repo that requires this:\n\n[sendemail]\n        from = Olaf Hering <a@b.c>\n        envelopesender = a@b.c\n        smtpserver = otherhost\n\nThat \"otherhost\" does just plain oldstyle unencrypted SMTP.\n\nHow do I undo the global sendemail settings for that one repo?\nSetting the knobs to empty strings does not help:\nCommand unknown: 'AUTH' at /usr/lib/git/git-send-email line 1455.\n\nIt seems the global smtpuser is causing the error.\n\nOlaf\n"},{"id":"343855","messageId":"874lkq11ug.fsf@evledraar.gmail.com","threadId":"48224","inReplyTo":"20180405092358.569e0315.olaf@aepfle.de","subject":"How to undo previously set configuration?","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-04-05T08:42:15Z","receivedAt":"2018-04-05T08:42:28Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Apr 05 2018, Olaf Hering wrote:\n\n[Changed subject]\n\n> My ~/.gitconfig looks like this, because all cloned repositories require these settings:\n> [sendemail]\n>         from = Olaf Hering <olaf@aepfle.de>\n>         envelopesender = olaf@aepfle.de\n>         chainreplyto = false\n>         ccover = yes\n>         smtpencryption = tls\n>         smtpdomain = sender\n>         smtppass = smtppass\n>         smtpAuth = PLAIN\n>         smtpserver = smtp.strato.de\n>         smtpuser = smtpuser\n>         confirm = always\n>         assume8bitEncoding = yes\n>         transferEncoding = 8bit\n>\n> Now there is that one repo that requires this:\n>\n> [sendemail]\n>         from = Olaf Hering <a@b.c>\n>         envelopesender = a@b.c\n>         smtpserver = otherhost\n>\n> That \"otherhost\" does just plain oldstyle unencrypted SMTP.\n>\n> How do I undo the global sendemail settings for that one repo?\n> Setting the knobs to empty strings does not help:\n> Command unknown: 'AUTH' at /usr/lib/git/git-send-email line 1455.\n>\n> It seems the global smtpuser is causing the error.\n\nThere isn't any way to do this, the only way out is the hack of using\nconditional includes and placing this repository in some special\nlocation.\n\nIn general it would be very nice if git learned to conditionally pay\nattention to config from various places, I've been meaning to work on\nthis but haven't figured out a good syntax for it (suggestions\nwelcome!). Things I'd like to do:\n\n1) Set some config in e.g. ~/.gitconfig saying that I want to ignore\n   everything from /etc/gitconfig, or in /some/repo/.git/config saying I\n   want to ignore ~/.gitconfig but not /etc/gitconfig.\n\n2) Ditto #1 but more granular, e.g. for your use-case saying you're OK\n   with grabbing ~/.gitconfig, but you'd like to ignore all sendemail.*\n   values from there, or say in your local .git/config that you'd like\n   to ignore all previously set sendemail.* no matter where it came\n   from.\n\n3) Ability to re-arrange the config priority, right now it's hardcoded\n   that we look at /etc/gitconfig, then ~/.gitconfig then your\n   .git/config. You can add a config for ~/work with the conditional\n   includes, but it would be nice (just as a general thing) to also\n   re-arrange things so /etc/gitconfig gets parsed last or whatever.\n\n   I don't really have a use-case for that, but adding such priorities\n   would be simple once we had support for #1 and #2, just some\n   \"priority\" integer you could override for each file, and we'd set\n   default values for them, e.g. 10 for /etc/gitconfig, 20 for\n   ~/.gitconfig, 40 for .git/config etc.\n\nFor any of this to work we'd need to re-arrange the config code so that\nwe'd fully parse all the config files first, and consider any such\n\"ignore the thing before me\" rules in each file, and then make a second\npass over the config data\n\nThe ulterior motive I want this for is to eventually support some\nfacility where we can safely load a .gitconfig from clone repos, since\nonce we have this for other reasons (and as noted above, it would be\nuseful for that in its own right) we can load .gitconfig from some\nuntrusted source, because we're going to be able to say that we only\ntrust the repo's .gitconfig to set sendemail.to or whatever, but nothing\nelse.\n\nPrevious ramblings from me on this subject:\nhttps://public-inbox.org/git/87zi6eakkt.fsf@evledraar.gmail.com/\n\nSo maybe something like this in a .git/config\n\n    # Reject all previous such [config] overrides, by default we'd add\n    # them (as default in git config)\n    [config]\n    reject = *\n    [config \"system\"]\n    priority = 50\n    reject = *\n    accept = sendmail.*\n    [config \"global\"]\n    reject = *\n    accept = sendmail.*\n\nAnd eventually have git itself mark up each config option on some scale\nof least harmful (sendmail.to & friends) to most harmful (executing\nshell aliases), and:\n\n    # Remote maintained untrusted config\n    [config \"repo\"]\n    acceptLevel = least-harmful\n\nOr whatever toggle to include some default policy shipped with\ngit. Actually we could just do that with more generally with config\nincludes if we learned some syntax for including some templates shipped\nwith git itself.\n"},{"id":"343856","messageId":"20180405104948.276de0ca.olaf@aepfle.de","threadId":"48224","inReplyTo":"874lkq11ug.fsf@evledraar.gmail.com","subject":"Re: How to undo previously set configuration?","fromName":"Olaf Hering","fromEmail":"olaf@aepfle.de","sentAt":"2018-04-05T08:49:48Z","receivedAt":"2018-04-05T08:50:03Z","isPatch":false,"sender":{"key":"olaf@aepfle.de","avatar":"https://avatars.githubusercontent.com/u/942324?v=4"},"body":"Am Thu, 05 Apr 2018 10:42:15 +0200\nschrieb Ævar Arnfjörð Bjarmason <avarab@gmail.com>:\n\n> I've been meaning to work on this but haven't figured out a good syntax for it (suggestions welcome!).\n\nJust prefix the knob with something like \"no.\" or \"-\" or whatever to indicate that it never happened.\n\nOlaf\n"},{"id":"343859","messageId":"d177a202-32b9-80a4-970f-c107c554c025@directbox.de","threadId":"48224","inReplyTo":"20180405092358.569e0315.olaf@aepfle.de","subject":"Re: How to configure sendemail for no-auth?","fromName":"astian","fromEmail":"astian@directbox.de","sentAt":"2018-04-05T10:27:00Z","receivedAt":"2018-04-05T10:34:07Z","isPatch":false,"sender":{"key":"astian@directbox.de","avatar":null},"body":"astian:\n> Olaf Hering:> My ~/.gitconfig looks like this, because all cloned repositories require these settings:\n>> [sendemail]\n>>         from = Olaf Hering <olaf@aepfle.de>\n>>         envelopesender = olaf@aepfle.de\n>>         chainreplyto = false\n>>         ccover = yes\n>>         smtpencryption = tls\n>>         smtpdomain = sender\n>>         smtppass = smtppass\n>>         smtpAuth = PLAIN\n>>         smtpserver = smtp.strato.de\n>>         smtpuser = smtpuser\n>>         confirm = always\n>>         assume8bitEncoding = yes\n>>         transferEncoding = 8bit\n>> \n>> Now there is that one repo that requires this:\n>> \n>> [sendemail]\n>>         from = Olaf Hering <a@b.c>\n>>         envelopesender = a@b.c\n>>         smtpserver = otherhost\n>> \n>> That \"otherhost\" does just plain oldstyle unencrypted SMTP.\n>> \n>> How do I undo the global sendemail settings for that one repo?\n>> Setting the knobs to empty strings does not help:\n>> Command unknown: 'AUTH' at /usr/lib/git/git-send-email line 1455.\n>> \n>> It seems the global smtpuser is causing the error.\n>> \n>> Olaf\n> Hm, I remember successfully doing something like this, quite some time ago.\n> \n> Couldn't you simply disable smtpEncryption in the .git/config of that one\n> repo?  E.g.:\n> \n> [sendemail]\n>   smtpEncryption = none\n> \n> You might also want to take a look at \"identities\" in the manual.  And related\n> to that, there's a patch in this old (never merged) series of mine which might\n> be useful since I believe the documentation bug it fixes still exists.\n> \n> Cheers.\n\nErr, forgot the link:\nhttps://public-inbox.org/git/xmqqzicc6zbf.fsf@gitster.mtv.corp.google.com/T/\n\nCheers.\n\n"},{"id":"343860","messageId":"e80299e3-1e84-c043-0f30-5cf97aa83ffb@directbox.de","threadId":"48224","inReplyTo":"20180405092358.569e0315.olaf@aepfle.de","subject":"Re: How to configure sendemail for no-auth?","fromName":"astian","fromEmail":"astian@directbox.de","sentAt":"2018-04-05T10:24:00Z","receivedAt":"2018-04-05T10:34:09Z","isPatch":false,"sender":{"key":"astian@directbox.de","avatar":null},"body":"Olaf Hering:\n> My ~/.gitconfig looks like this, because all cloned repositories require these settings:\n> [sendemail]\n>         from = Olaf Hering <olaf@aepfle.de>\n>         envelopesender = olaf@aepfle.de\n>         chainreplyto = false\n>         ccover = yes\n>         smtpencryption = tls\n>         smtpdomain = sender\n>         smtppass = smtppass\n>         smtpAuth = PLAIN\n>         smtpserver = smtp.strato.de\n>         smtpuser = smtpuser\n>         confirm = always\n>         assume8bitEncoding = yes\n>         transferEncoding = 8bit\n> \n> Now there is that one repo that requires this:\n> \n> [sendemail]\n>         from = Olaf Hering <a@b.c>\n>         envelopesender = a@b.c\n>         smtpserver = otherhost\n> \n> That \"otherhost\" does just plain oldstyle unencrypted SMTP.\n> \n> How do I undo the global sendemail settings for that one repo?\n> Setting the knobs to empty strings does not help:\n> Command unknown: 'AUTH' at /usr/lib/git/git-send-email line 1455.\n> \n> It seems the global smtpuser is causing the error.\n> \n> Olaf\n\nHm, I remember successfully doing something like this, quite some time ago.\n\nCouldn't you simply disable smtpEncryption in the .git/config of that one\nrepo?  E.g.:\n\n[sendemail]\n  smtpEncryption = none\n\nYou might also want to take a look at \"identities\" in the manual.  And related\nto that, there's a patch in this old (never merged) series of mine which might\nbe useful since I believe the documentation bug it fixes still exists.\n\nCheers.\n\n"},{"id":"343861","messageId":"8737092929.fsf@evledraar.gmail.com","threadId":"48224","inReplyTo":"20180405104948.276de0ca.olaf@aepfle.de","subject":"Re: How to undo previously set configuration?","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-04-05T11:21:02Z","receivedAt":"2018-04-05T11:21:12Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Apr 05 2018, Olaf Hering wrote:\n\n> Am Thu, 05 Apr 2018 10:42:15 +0200\n> schrieb Ævar Arnfjörð Bjarmason <avarab@gmail.com>:\n>\n>> I've been meaning to work on this but haven't figured out a good syntax for it (suggestions welcome!).\n>\n> Just prefix the knob with something like \"no.\" or \"-\" or whatever to indicate that it never happened.\n\nThose wouldn't work, respectively, because:\n\n a) For 'no.' there would be no way to override three-level keys,\n    because prefixing such a key with \"no\" would introduce a 4th nesting\n    level, which would be incompatible with existing config parsers.\n\n b) Similarly a prefix of - dies in git now. Unless I misunderstand\n    you. I'm assuming you mean something like:\n\n        [user]\n        # This is an error\n        -email\n\n    Although I see we don't ignore or error out on:\n\n        [user \"-email\"]\n        foo=bar\n\n   But that's back to problem a), and also looks ugly since you need\n   something like the extra foo=bar so we'll pay attention to it.\n\nAlso it's important that the syntax leaves room for item #1 that I\nmentioned,\n\nI.e. not just ignore stuff like user.email, but being able to specify\nwhere from you'd like to ignore that. Sometimes your local sysadmin is\noverzealous with his /etc/gitconfig settings and you'd like to\nquarantine just that, but pay attention to everything else in\n~/.gitconfig, or similarly in /some/repo/.git/config ignore your usual\ncustom sendemail.* from ~/.gitconfig but not /etc/gitconfig, so the\nsemantics can't just be \"clear existing\".\n\nBut of course, you might say that it *should* be a syntax error because\nif you rely on this feature and downgrade, you don't want to suddenly\npay attention to the sendemail.* config again.\n\nI think that's an acceptable failure mode, and better than the syntax\nerror, because that's exactly what we have now, so this is similar to\ne.g. the conditional include directive which was understood but just\ncopmletely ignored by older versions.\n\nSo we're OK with getting different config between versions with new\nreleases, but at all costs don't want to have new releases introduce\nconstructs that older gits error out on, and let's say hypothetically we\nsupported something like:\n\n    [user \"-email\"]\n    [user]\n        email = ...\n\nEven `git config -l` on older version won't show that \"user.-email\", and\nit's better if older tools at least understand the syntax, even though\nthey don't pick up on the magic.\n"},{"id":"343862","messageId":"000f01d3ccd6$15239f00$3f6add00$@nexbridge.com","threadId":"48224","inReplyTo":"8737092929.fsf@evledraar.gmail.com","subject":"RE: How to undo previously set configuration?","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2018-04-05T12:03:11Z","receivedAt":"2018-04-05T12:03:32Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On April 5, 2018 7:21 AM, Ævar Arnfjörð Bjarmason wrote:\n> On Thu, Apr 05 2018, Olaf Hering wrote:\n> \n> > Am Thu, 05 Apr 2018 10:42:15 +0200\n> > schrieb Ævar Arnfjörð Bjarmason <avarab@gmail.com>:\n> >\n> >> I've been meaning to work on this but haven't figured out a good syntax\n> for it (suggestions welcome!).\n> >\n> > Just prefix the knob with something like \"no.\" or \"-\" or whatever to indicate\n> that it never happened.\n> \n> Those wouldn't work, respectively, because:\n> \n>  a) For 'no.' there would be no way to override three-level keys,\n>     because prefixing such a key with \"no\" would introduce a 4th nesting\n>     level, which would be incompatible with existing config parsers.\n> \n>  b) Similarly a prefix of - dies in git now. Unless I misunderstand\n>     you. I'm assuming you mean something like:\n> \n>         [user]\n>         # This is an error\n>         -email\n> \n>     Although I see we don't ignore or error out on:\n> \n>         [user \"-email\"]\n>         foo=bar\n> \n>    But that's back to problem a), and also looks ugly since you need\n>    something like the extra foo=bar so we'll pay attention to it.\n> \n> Also it's important that the syntax leaves room for item #1 that I mentioned,\n> \n> I.e. not just ignore stuff like user.email, but being able to specify where from\n> you'd like to ignore that. Sometimes your local sysadmin is overzealous with\n> his /etc/gitconfig settings and you'd like to quarantine just that, but pay\n> attention to everything else in ~/.gitconfig, or similarly in\n> /some/repo/.git/config ignore your usual custom sendemail.* from\n> ~/.gitconfig but not /etc/gitconfig, so the semantics can't just be \"clear\n> existing\".\n> \n> But of course, you might say that it *should* be a syntax error because if you\n> rely on this feature and downgrade, you don't want to suddenly pay\n> attention to the sendemail.* config again.\n> \n> I think that's an acceptable failure mode, and better than the syntax error,\n> because that's exactly what we have now, so this is similar to e.g. the\n> conditional include directive which was understood but just copmletely\n> ignored by older versions.\n> \n> So we're OK with getting different config between versions with new\n> releases, but at all costs don't want to have new releases introduce\n> constructs that older gits error out on, and let's say hypothetically we\n> supported something like:\n> \n>     [user \"-email\"]\n>     [user]\n>         email = ...\n> \n> Even `git config -l` on older version won't show that \"user.-email\", and it's\n> better if older tools at least understand the syntax, even though they don't\n> pick up on the magic.\n\nI may be missing something but..\n\nAnother 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.\n\nFor 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.\n\nUndo becomes a git operation in both situations.\n\nThis may be complete OT, but I thought it might help\n\nCheers,\nRandall\n\n-- Brief whoami:\n NonStop developer since approximately 211288444200000000\n UNIX developer since approximately 421664400\n-- In my real life, I talk too much.\n\n\n\n"},{"id":"343863","messageId":"20180405152525.13d1c776.olaf@aepfle.de","threadId":"48224","inReplyTo":"8737092929.fsf@evledraar.gmail.com","subject":"Re: How to undo previously set configuration?","fromName":"Olaf Hering","fromEmail":"olaf@aepfle.de","sentAt":"2018-04-05T13:25:25Z","receivedAt":"2018-04-05T13:31:50Z","isPatch":false,"sender":{"key":"olaf@aepfle.de","avatar":"https://avatars.githubusercontent.com/u/942324?v=4"},"body":"Am Thu, 05 Apr 2018 13:21:02 +0200\nschrieb Ævar Arnfjörð Bjarmason <avarab@gmail.com>:\n\n> I'm assuming you mean something like:\n>         [user]\n>         # This is an error\n>         -email\n\nYes. 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.\n\nI do not know the git internals, so can not really help with the case.\n\nOlaf\n"},{"id":"343868","messageId":"20180405163227.GA25224@sigill.intra.peff.net","threadId":"48224","inReplyTo":"20180405152525.13d1c776.olaf@aepfle.de","subject":"Re: How to undo previously set configuration?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-04-05T16:32:27Z","receivedAt":"2018-04-05T16:32:34Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Apr 05, 2018 at 03:25:25PM +0200, Olaf Hering wrote:\n\n> Am Thu, 05 Apr 2018 13:21:02 +0200\n> schrieb Ævar Arnfjörð Bjarmason <avarab@gmail.com>:\n> \n> > I'm assuming you mean something like:\n> >         [user]\n> >         # This is an error\n> >         -email\n> \n> Yes. Just some flag to say \"whatever value this variable has from\n> earlier parsing, forget it in case it really exists\". Just like \"unset\n> PATH\" in bash.\n> \n> I do not know the git internals, so can not really help with the case.\n\nThe general strategy in Git's config is that instead of \"unsetting\", you\nshould overwrite with whatever value you _do_ want. So a config option\nlike sendemail.smtpauth should accept some kind of empty or \"none\" value\nto disable auth.\n\nMost single-value config options should work this way (and if one\ndoesn't, I'd say that's a bug we should fix).\n\nMulti-valued config (e.g., \"remote.*.fetch\") is harder, since it's\ninherently a list where each new instance adds to the list. We've\ndiscussed there having an empty value reset the list, but it's not\napplied consistently.\n\n-Peff\n"},{"id":"343968","messageId":"20180406175556.5b6e16f0.olaf@aepfle.de","threadId":"48224","inReplyTo":"20180405163227.GA25224@sigill.intra.peff.net","subject":"Re: How to undo previously set configuration?","fromName":"Olaf Hering","fromEmail":"olaf@aepfle.de","sentAt":"2018-04-06T15:55:56Z","receivedAt":"2018-04-06T15:59:22Z","isPatch":false,"sender":{"key":"olaf@aepfle.de","avatar":"https://avatars.githubusercontent.com/u/942324?v=4"},"body":"Am Thu, 5 Apr 2018 12:32:27 -0400\nschrieb Jeff King <peff@peff.net>:\n\n> The general strategy in Git's config is that instead of \"unsetting\", you\n> should overwrite with whatever value you _do_ want. So a config option\n> like sendemail.smtpauth should accept some kind of empty or \"none\" value\n> to disable auth.\n> \n> Most single-value config options should work this way (and if one\n> doesn't, I'd say that's a bug we should fix).\n\nThis 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?\n\nOlaf\n"},{"id":"343970","messageId":"20180406161506.GA28093@sigill.intra.peff.net","threadId":"48224","inReplyTo":"20180406175556.5b6e16f0.olaf@aepfle.de","subject":"Re: How to undo previously set configuration?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-04-06T16:15:07Z","receivedAt":"2018-04-06T16:15:13Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Apr 06, 2018 at 05:55:56PM +0200, Olaf Hering wrote:\n\n> > The general strategy in Git's config is that instead of \"unsetting\",\n> > you\n> > should overwrite with whatever value you _do_ want. So a config option\n> > like sendemail.smtpauth should accept some kind of empty or \"none\" value\n> > to disable auth.\n> > \n> > Most single-value config options should work this way (and if one\n> > doesn't, I'd say that's a bug we should fix).\n> \n> This does not work. Initially I copied the global config into the repo\n> and set all unwanted values to <empty>, like 'smtpuser='. Perhaps the\n> config parser recognized that fact, but the consumer does not?\n\nYes. That logic is handled by the consumer (especially in the case of\nsend-email, which is a perl script, the code runs in a totally separate\nprocess from the config parser). Naively I'd think that:\n\n  [sendemail]\n  smtpAuth =\n\nwould do what you want, and then we'd ignore smtpUser completely.\nIt looks like the smtp_auth_maybe function uses perl's \"defined\" there,\nthough. Perhaps it should treat the empty string the same there.\n\n(Or maybe it's something else; I don't use send-email myself, and in a\nfew trivial examples I couldn't get it to complain about similar\nconfig).\n\n-Peff\n"},{"id":"343973","messageId":"CACUQV5_E+MOHVD2rGjcQY=iK+tqB3wV9Lh1nwiEP+q+M-1iXzA@mail.gmail.com","threadId":"48224","inReplyTo":"20180406175556.5b6e16f0.olaf@aepfle.de","subject":"Re: How to undo previously set configuration?","fromName":"Rafael Ascensao","fromEmail":"rafa.almas@gmail.com","sentAt":"2018-04-06T16:57:39Z","receivedAt":"2018-04-06T16:58:25Z","isPatch":false,"sender":{"key":"rafa.almas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1923789?v=4"},"body":"On Fri, Apr 6, 2018 at 4:55 PM, Olaf Hering <olaf@aepfle.de> wrote:\n>\n> 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?\n>\n\nToday someone asked on #git for a way to disable diff.external for a\nsingle command.\nWithout thinking much I suggested $git -c diff.external= diff; which fails with:\n`fatal: cannot run : No such file or directory`\n\nIn this particular case there was `--no-ext-diff` to get around this\nand the case was promptly resolved.\nJust another another example where setting configuration values to\n\"empty\" doesn't translate to \"disable this option\".\n"},{"id":"343974","messageId":"20180406175044.GA32228@sigill.intra.peff.net","threadId":"48224","inReplyTo":"CACUQV5_E+MOHVD2rGjcQY=iK+tqB3wV9Lh1nwiEP+q+M-1iXzA@mail.gmail.com","subject":"Re: How to undo previously set configuration?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-04-06T17:50:44Z","receivedAt":"2018-04-06T17:50:57Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Apr 06, 2018 at 05:57:39PM +0100, Rafael Ascensao wrote:\n\n> On Fri, Apr 6, 2018 at 4:55 PM, Olaf Hering <olaf@aepfle.de> wrote:\n> >\n> > This does not work. Initially I copied the global config into the\n> > repo and set all unwanted values to <empty>, like 'smtpuser='.\n> > Perhaps the config parser recognized that fact, but the consumer\n> > does not?\n> >\n> \n> Today someone asked on #git for a way to disable diff.external for a\n> single command.\n> Without thinking much I suggested $git -c diff.external= diff; which fails with:\n> `fatal: cannot run : No such file or directory`\n> \n> In this particular case there was `--no-ext-diff` to get around this\n> and the case was promptly resolved.\n> Just another another example where setting configuration values to\n> \"empty\" doesn't translate to \"disable this option\".\n\nYeah, I think it would make sense in that case to reset\nexternal_diff_cmd_cfg to NULL. I'd almost say that git_config_string()\nshould recognize and handle this case, but I suspect there are some\ncallers who need special behavior (e.g., to set it back to some\nparticular string).\n\n-Peff\n"}]}