{"thread":{"id":"41313","subject":"git submodule should honor \"-c credential.helper\" command line argument","startedAt":"2016-02-02T17:13:14Z","lastAt":"2016-02-19T19:34:12Z","messageCount":15,"participants":["Marc Strapetz","Jeff King","Jacob Keller","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"277252","messageId":"56B0E3AA.30804@syntevo.com","threadId":"41313","inReplyTo":null,"subject":"git submodule should honor \"-c credential.helper\" command line argument","fromName":"Marc Strapetz","fromEmail":"marc.strapetz@syntevo.com","sentAt":"2016-02-02T17:13:14Z","receivedAt":"2016-02-02T17:13:14Z","isPatch":false,"sender":{"key":"marc.strapetz@syntevo.com","avatar":"https://avatars.githubusercontent.com/u/3380730?v=4"},"body":"git -c credential.helper=helper submodule update --init submodule\n\ndoes not invoke \"helper\", but falls back to the default strategies.\nWhen configuring in ~/.gitconfig:\n\n[credential]\n   helper=helper\n\ngit submodule update --init submodule\n\nworks fine. This behavior is somewhat unexpected -- is this a bug or by \nintention? In case intention, what's the recommended way to \"inject\" \ncredentials helpers to work on submodules without modifying Git's config \nfiles?\n\nTested with Git 2.5.0 (Windows).\n\n-Marc\n"},{"id":"277297","messageId":"20160203042554.GA21179@sigill.intra.peff.net","threadId":"41313","inReplyTo":"56B0E3AA.30804@syntevo.com","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-02-03T04:25:55Z","receivedAt":"2016-02-03T04:25:55Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 02, 2016 at 06:13:14PM +0100, Marc Strapetz wrote:\n\n> git -c credential.helper=helper submodule update --init submodule\n> \n> does not invoke \"helper\", but falls back to the default strategies.\n> When configuring in ~/.gitconfig:\n> \n> [credential]\n>   helper=helper\n> \n> git submodule update --init submodule\n> \n> works fine. This behavior is somewhat unexpected -- is this a bug or by\n> intention? In case intention, what's the recommended way to \"inject\"\n> credentials helpers to work on submodules without modifying Git's config\n> files?\n> \n> Tested with Git 2.5.0 (Windows).\n\nI think the problem is that when git \"switches\" to working in the\nsubmodule repository, it clears the environment, which includes any \"-c\"\ncommand switches. This makes sense for some situations, but not for\nothers. This thread shows a similar problem:\n\n  http://thread.gmane.org/gmane.comp.version-control.git/264840\n\nJens suggested there adding an option to tell clone to pass specific\nvariables to the submodule, which I think makes sense. AFAIK, nobody has\ndone any work yet on that approach.\n\n-Peff\n"},{"id":"277306","messageId":"CA+P7+xq8sv6f8K8K0EEjXg=wdKpFg6z0K5F6P4SGEp+wKdU=rA@mail.gmail.com","threadId":"41313","inReplyTo":"20160203042554.GA21179@sigill.intra.peff.net","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-02-03T07:35:07Z","receivedAt":"2016-02-03T07:35:07Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Tue, Feb 2, 2016 at 8:25 PM, Jeff King <peff@peff.net> wrote:\n> I think the problem is that when git \"switches\" to working in the\n> submodule repository, it clears the environment, which includes any \"-c\"\n> command switches. This makes sense for some situations, but not for\n> others. This thread shows a similar problem:\n>\n>   http://thread.gmane.org/gmane.comp.version-control.git/264840\n>\n> Jens suggested there adding an option to tell clone to pass specific\n> variables to the submodule, which I think makes sense. AFAIK, nobody has\n> done any work yet on that approach.\n>\n\nThis is something that I am also interested in, haven't had a chance\nto look at it just yet though. I may have some time soon to take a\nstab at this.\n\nRegards,\nJake\n"},{"id":"277308","messageId":"56B1B569.5040502@syntevo.com","threadId":"41313","inReplyTo":"CA+P7+xq8sv6f8K8K0EEjXg=wdKpFg6z0K5F6P4SGEp+wKdU=rA@mail.gmail.com","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Marc Strapetz","fromEmail":"marc.strapetz@syntevo.com","sentAt":"2016-02-03T08:08:09Z","receivedAt":"2016-02-03T08:08:09Z","isPatch":false,"sender":{"key":"marc.strapetz@syntevo.com","avatar":"https://avatars.githubusercontent.com/u/3380730?v=4"},"body":"On 03.02.2016 08:35, Jacob Keller wrote:\n> On Tue, Feb 2, 2016 at 8:25 PM, Jeff King <peff@peff.net> wrote:\n>> I think the problem is that when git \"switches\" to working in the\n>> submodule repository, it clears the environment, which includes any \"-c\"\n>> command switches. This makes sense for some situations, but not for\n>> others. This thread shows a similar problem:\n>>\n>>    http://thread.gmane.org/gmane.comp.version-control.git/264840\n>>\n>> Jens suggested there adding an option to tell clone to pass specific\n>> variables to the submodule, which I think makes sense. AFAIK, nobody has\n>> done any work yet on that approach.\n>>\n>\n> This is something that I am also interested in, haven't had a chance\n> to look at it just yet though. I may have some time soon to take a\n> stab at this.\n\nTo have this issue addressed would be great. It's currently preventing \nme to switch our authentication-related code to credential helpers.\n\nJake, I'm happy to help, if I can (I don't have any experience with Git \ncode though, except of browsing it a couple of times ... so patches from \nmy side would need a lot of review I guess :). Just let me know.\n\n-Marc\n"},{"id":"277352","messageId":"CA+P7+xpGTvbyLOKQ=DHFBLOuVNN8WocraaZQhFD36oDiFrY+sA@mail.gmail.com","threadId":"41313","inReplyTo":"20160203042554.GA21179@sigill.intra.peff.net","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-02-03T23:44:22Z","receivedAt":"2016-02-03T23:44:22Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Tue, Feb 2, 2016 at 8:25 PM, Jeff King <peff@peff.net> wrote:\n> On Tue, Feb 02, 2016 at 06:13:14PM +0100, Marc Strapetz wrote:\n>\n>> git -c credential.helper=helper submodule update --init submodule\n>>\n>> does not invoke \"helper\", but falls back to the default strategies.\n>> When configuring in ~/.gitconfig:\n>>\n>> [credential]\n>>   helper=helper\n>>\n>> git submodule update --init submodule\n>>\n>> works fine. This behavior is somewhat unexpected -- is this a bug or by\n>> intention? In case intention, what's the recommended way to \"inject\"\n>> credentials helpers to work on submodules without modifying Git's config\n>> files?\n>>\n>> Tested with Git 2.5.0 (Windows).\n>\n> I think the problem is that when git \"switches\" to working in the\n> submodule repository, it clears the environment, which includes any \"-c\"\n> command switches. This makes sense for some situations, but not for\n> others. This thread shows a similar problem:\n>\n>   http://thread.gmane.org/gmane.comp.version-control.git/264840\n>\n> Jens suggested there adding an option to tell clone to pass specific\n> variables to the submodule, which I think makes sense. AFAIK, nobody has\n> done any work yet on that approach.\n>\n> -Peff\n> --\n\nOk so I am not sure we even really need to use \"-c\" option in\ngit-clone considering that we can just use the same flow we do for\nsetting core.worktree values. I'll propose a patch with you two Cc'ed,\nwhich I think fixes the issue. There may actually be a set of\nconfiguration we want to include though, and the main issue I see is\nthat it won't get updated correctly whenever the parent configuration\nchanges.\n\nThanks,\nJake\n"},{"id":"277674","messageId":"CA+P7+xr4gQFPsUiuqSzMsUJP6_W8FnXBwX1Xes=XjksuTs=+hQ@mail.gmail.com","threadId":"41313","inReplyTo":"CA+P7+xpGTvbyLOKQ=DHFBLOuVNN8WocraaZQhFD36oDiFrY+sA@mail.gmail.com","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-02-07T04:41:48Z","receivedAt":"2016-02-07T04:41:48Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Wed, Feb 3, 2016 at 3:44 PM, Jacob Keller <jacob.keller@gmail.com> wrote:\n> Ok so I am not sure we even really need to use \"-c\" option in\n> git-clone considering that we can just use the same flow we do for\n> setting core.worktree values. I'll propose a patch with you two Cc'ed,\n> which I think fixes the issue. There may actually be a set of\n> configuration we want to include though, and the main issue I see is\n> that it won't get updated correctly whenever the parent configuration\n> changes.\n>\n> Thanks,\n> Jake\n\nI tried adding the config as part of module_clone in\nsubmodule--helper.c but it didn't pass the test I added. I haven't had\ntime to look at this in the last few days, but I am stuck as to why\nsubmodule--helper.c appeared to not use module_clone as I thought.\n\nRegards,\nJake\n"},{"id":"277692","messageId":"56B74B17.4040304@syntevo.com","threadId":"41313","inReplyTo":"CA+P7+xr4gQFPsUiuqSzMsUJP6_W8FnXBwX1Xes=XjksuTs=+hQ@mail.gmail.com","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Marc Strapetz","fromEmail":"marc.strapetz@syntevo.com","sentAt":"2016-02-07T13:48:07Z","receivedAt":"2016-02-07T13:48:07Z","isPatch":false,"sender":{"key":"marc.strapetz@syntevo.com","avatar":"https://avatars.githubusercontent.com/u/3380730?v=4"},"body":"On 07.02.2016 05:41, Jacob Keller wrote:\n> On Wed, Feb 3, 2016 at 3:44 PM, Jacob Keller <jacob.keller@gmail.com> wrote:\n>> Ok so I am not sure we even really need to use \"-c\" option in\n>> git-clone considering that we can just use the same flow we do for\n>> setting core.worktree values. I'll propose a patch with you two Cc'ed,\n>> which I think fixes the issue. There may actually be a set of\n>> configuration we want to include though, and the main issue I see is\n>> that it won't get updated correctly whenever the parent configuration\n>> changes.\n>>\n>> Thanks,\n>> Jake\n>\n> I tried adding the config as part of module_clone in\n> submodule--helper.c but it didn't pass the test I added. I haven't had\n> time to look at this in the last few days, but I am stuck as to why\n> submodule--helper.c appeared to not use module_clone as I thought.\n\nI've tried to just comment out clearing of environment variables in \ngit-sh-setup.sh, clear_local_git_env(). I've noticed that \"-c \ncredentials-helper ...\" is stored in $GIT_CONFIG_PARAMETERS and with \nexisting code is reset there. If not clearing the environment variables, \nat least \"git submodule init\" is working properly. I didn't try with \nother commands nor to run tests.\n\n-Marc\n"},{"id":"277709","messageId":"CA+P7+xpFmZBUwq1h9Xhi7xKYfAyvcouBiV5ujHxuGJQJTMHXZw@mail.gmail.com","threadId":"41313","inReplyTo":"56B74B17.4040304@syntevo.com","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-02-08T03:44:34Z","receivedAt":"2016-02-08T03:44:34Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Sun, Feb 7, 2016 at 5:48 AM, Marc Strapetz <marc.strapetz@syntevo.com> wrote:\n> On 07.02.2016 05:41, Jacob Keller wrote:\n>>\n>> On Wed, Feb 3, 2016 at 3:44 PM, Jacob Keller <jacob.keller@gmail.com>\n>> wrote:\n>>>\n>>> Ok so I am not sure we even really need to use \"-c\" option in\n>>> git-clone considering that we can just use the same flow we do for\n>>> setting core.worktree values. I'll propose a patch with you two Cc'ed,\n>>> which I think fixes the issue. There may actually be a set of\n>>> configuration we want to include though, and the main issue I see is\n>>> that it won't get updated correctly whenever the parent configuration\n>>> changes.\n>>>\n>>> Thanks,\n>>> Jake\n>>\n>>\n>> I tried adding the config as part of module_clone in\n>> submodule--helper.c but it didn't pass the test I added. I haven't had\n>> time to look at this in the last few days, but I am stuck as to why\n>> submodule--helper.c appeared to not use module_clone as I thought.\n>\n>\n> I've tried to just comment out clearing of environment variables in\n> git-sh-setup.sh, clear_local_git_env(). I've noticed that \"-c\n> credentials-helper ...\" is stored in $GIT_CONFIG_PARAMETERS and with\n> existing code is reset there. If not clearing the environment variables, at\n> least \"git submodule init\" is working properly. I didn't try with other\n> commands nor to run tests.\n>\n> -Marc\n>\n>\n\nI'll have to dig more into this next week.\n\nRegards,\nJake\n"},{"id":"278604","messageId":"CA+P7+xpHNHVSJnVg3HwiBjWxRdSpLXCsm3GpWst=BNyhLMVd5A@mail.gmail.com","threadId":"41313","inReplyTo":"CA+P7+xpFmZBUwq1h9Xhi7xKYfAyvcouBiV5ujHxuGJQJTMHXZw@mail.gmail.com","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-02-19T01:15:54Z","receivedAt":"2016-02-19T01:15:54Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Sun, Feb 7, 2016 at 7:44 PM, Jacob Keller <jacob.keller@gmail.com> wrote:\n> On Sun, Feb 7, 2016 at 5:48 AM, Marc Strapetz <marc.strapetz@syntevo.com> wrote:\n>> On 07.02.2016 05:41, Jacob Keller wrote:\n>>>\n>>> On Wed, Feb 3, 2016 at 3:44 PM, Jacob Keller <jacob.keller@gmail.com>\n>>> wrote:\n>>>>\n>>>> Ok so I am not sure we even really need to use \"-c\" option in\n>>>> git-clone considering that we can just use the same flow we do for\n>>>> setting core.worktree values. I'll propose a patch with you two Cc'ed,\n>>>> which I think fixes the issue. There may actually be a set of\n>>>> configuration we want to include though, and the main issue I see is\n>>>> that it won't get updated correctly whenever the parent configuration\n>>>> changes.\n>>>>\n>>>> Thanks,\n>>>> Jake\n>>>\n>>>\n>>> I tried adding the config as part of module_clone in\n>>> submodule--helper.c but it didn't pass the test I added. I haven't had\n>>> time to look at this in the last few days, but I am stuck as to why\n>>> submodule--helper.c appeared to not use module_clone as I thought.\n>>\n>>\n>> I've tried to just comment out clearing of environment variables in\n>> git-sh-setup.sh, clear_local_git_env(). I've noticed that \"-c\n>> credentials-helper ...\" is stored in $GIT_CONFIG_PARAMETERS and with\n>> existing code is reset there. If not clearing the environment variables, at\n>> least \"git submodule init\" is working properly. I didn't try with other\n>> commands nor to run tests.\n>>\n>> -Marc\n>>\n>>\n>\n> I'll have to dig more into this next week.\n>\n> Regards,\n> Jake\n\nI am looking at this more and I am stuck as to how best to provide a test case.\n\nI think the problem as stated above is pretty straight forward, we\njust want to stop clearing GIT_CONFIG_PARAMETERS but I can't find an\neasy way to test that we've done the right thing. There are no current\ntests for using a credential helper with submodule update right now.\n\nRegards,\nJake\n"},{"id":"278611","messageId":"20160219043019.GA14764@sigill.intra.peff.net","threadId":"41313","inReplyTo":"CA+P7+xpHNHVSJnVg3HwiBjWxRdSpLXCsm3GpWst=BNyhLMVd5A@mail.gmail.com","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-02-19T04:30:20Z","receivedAt":"2016-02-19T04:30:20Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 18, 2016 at 05:15:54PM -0800, Jacob Keller wrote:\n\n> I am looking at this more and I am stuck as to how best to provide a\n> test case.\n> \n> I think the problem as stated above is pretty straight forward, we\n> just want to stop clearing GIT_CONFIG_PARAMETERS but I can't find an\n> easy way to test that we've done the right thing. There are no current\n> tests for using a credential helper with submodule update right now.\n\nIf you just want to test that GIT_CONFIG_PARAMETERS is left untouched in\nthe submodule, you can tweak any config setting that would impact the\nnewly-cloned repo. E.g. this:\n\n  unset GIT_COMMITTER_NAME\n  git config --global user.name='Global Name'\n  git -c user.name='Command-Line Name' clone repo-with-module foo\n  head -1 foo/.git/logs/HEAD\n  head -1 foo/.git/modules/sub/logs/HEAD\n\nshows that the parent-level clone uses the \"-c\" name, but the submodule\ndoes not.\n\nThat being said, I am not sure this is the right solution. In the thread\nI linked earlier[1], Jens indicated he would prefer not to blindly share\nconfig with the submodules, and I think I agree. Or are you proposing to\npick and choose the keys in GIT_CONFIG_PARAMETERS, and whitelist\ncredential.*?\n\nIn that case, obviously my test example would not work, though I think\nthat it might be fine to put \"user.name\" onto the whitelist (the things\nwe really would worry about is stuff like \"core.worktree\" that clearly\ndoes not make sense to carry over into the submodule).\n\n-Peff\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/264840\n"},{"id":"278615","messageId":"CA+P7+xr9dLOyaVky1jvXm7MkF0JUqs5SadrTdr4o83baMp397A@mail.gmail.com","threadId":"41313","inReplyTo":"20160219043019.GA14764@sigill.intra.peff.net","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-02-19T07:29:09Z","receivedAt":"2016-02-19T07:29:09Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Thu, Feb 18, 2016 at 8:30 PM, Jeff King <peff@peff.net> wrote:\n> On Thu, Feb 18, 2016 at 05:15:54PM -0800, Jacob Keller wrote:\n>\n>> I am looking at this more and I am stuck as to how best to provide a\n>> test case.\n>>\n>> I think the problem as stated above is pretty straight forward, we\n>> just want to stop clearing GIT_CONFIG_PARAMETERS but I can't find an\n>> easy way to test that we've done the right thing. There are no current\n>> tests for using a credential helper with submodule update right now.\n>\n> If you just want to test that GIT_CONFIG_PARAMETERS is left untouched in\n> the submodule, you can tweak any config setting that would impact the\n> newly-cloned repo. E.g. this:\n>\n>   unset GIT_COMMITTER_NAME\n>   git config --global user.name='Global Name'\n>   git -c user.name='Command-Line Name' clone repo-with-module foo\n>   head -1 foo/.git/logs/HEAD\n>   head -1 foo/.git/modules/sub/logs/HEAD\n>\n> shows that the parent-level clone uses the \"-c\" name, but the submodule\n> does not.\n>\n> That being said, I am not sure this is the right solution. In the thread\n> I linked earlier[1], Jens indicated he would prefer not to blindly share\n> config with the submodules, and I think I agree. Or are you proposing to\n> pick and choose the keys in GIT_CONFIG_PARAMETERS, and whitelist\n> credential.*?\n>\n> In that case, obviously my test example would not work, though I think\n> that it might be fine to put \"user.name\" onto the whitelist (the things\n> we really would worry about is stuff like \"core.worktree\" that clearly\n> does not make sense to carry over into the submodule).\n>\n> -Peff\n>\n> [1] http://thread.gmane.org/gmane.comp.version-control.git/264840\n>\n\nI would prefer to either.. blacklist stuff like core.worktree, or\nwhitelist a bunch of stuff that makes sense. In this case though, I\nwould prefer to have an explicit test of credential.helper, but I\ndon't know if any of our tests actually have a solid test case for\n\"credential.helper was used in a clone. There may not be test\ninfrastructure for this though, so your test might work well enough.\n\nAs for how to whitelist config to share with the submodule I am really\nnot 100% sure, since we just clear GIT_CONFIG_PARAMETERS, and I think\nwe'd need a specialized variant of clear_local_git_env_vars specific\nto submodule then.\n\nThanks,\nJake\n"},{"id":"278617","messageId":"20160219074633.GA780@sigill.intra.peff.net","threadId":"41313","inReplyTo":"CA+P7+xr9dLOyaVky1jvXm7MkF0JUqs5SadrTdr4o83baMp397A@mail.gmail.com","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-02-19T07:46:33Z","receivedAt":"2016-02-19T07:46:33Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 18, 2016 at 11:29:09PM -0800, Jacob Keller wrote:\n\n> I would prefer to either.. blacklist stuff like core.worktree, or\n> whitelist a bunch of stuff that makes sense. In this case though, I\n> would prefer to have an explicit test of credential.helper, but I\n> don't know if any of our tests actually have a solid test case for\n> \"credential.helper was used in a clone. There may not be test\n> infrastructure for this though, so your test might work well enough.\n\nTo trigger a credential fetch in actual use, you have to clone over\nhttp. See the credential tests in t5550, for example.\n\n> As for how to whitelist config to share with the submodule I am really\n> not 100% sure, since we just clear GIT_CONFIG_PARAMETERS, and I think\n> we'd need a specialized variant of clear_local_git_env_vars specific\n> to submodule then.\n\nYeah, you'll have to parse, which is pretty painful. In C, you'd do\nsomething like:\n\n  int submodule_config_ok(const char *var)\n  {\n\tif (starts_with(var, \"credential.\"))\n\t\treturn 1;\n\treturn 0;\n  }\n\n  int filter_submodule_config(const char *var, const char *value, void *data)\n  {\n\tstruct strbuf *out = data;\n\tif (submodule_config_ok(var)) {\n\t\tif (out->len)\n\t\t\tstrbuf_addch(out, ' ');\n\t\t/* these actually probably need quoted all as * one string */\n\t\tsq_quote_buf(out, var);\n\t\tsq_quote_buf(out, \"=\");\n\t\tsq_quote_buf(out, value);\n\t}\n\treturn 0;\n  }\n\nand then call it like:\n\n  struct strbuf filtered_config = STRBUF_INIT;\n  git_config_from_parameters(filter_submodule_config, &filtered_config);\n  argv_array_pushf(&child_process.env, \"%s=%s\",\n                   CONFIG_DATA_ENVIRONMENT, filtered_config.buf);\n\nbut right now git-submodule.sh is all in shell. You'd probably need a\nspecial helper from git-submodule--helper, though it might simply make\nsense to put this off until the submodule code is fully ported to C.\n\n-Peff\n"},{"id":"278618","messageId":"CA+P7+xoN+ye38tHiXc=WGenuuF0NVA1R-3nfd5_LNjOF01EJfQ@mail.gmail.com","threadId":"41313","inReplyTo":"20160219074633.GA780@sigill.intra.peff.net","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-02-19T07:51:25Z","receivedAt":"2016-02-19T07:51:25Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Thu, Feb 18, 2016 at 11:46 PM, Jeff King <peff@peff.net> wrote:\n> To trigger a credential fetch in actual use, you have to clone over\n> http. See the credential tests in t5550, for example.\n>\n\nI'll look at these.\n\n>> As for how to whitelist config to share with the submodule I am really\n>> not 100% sure, since we just clear GIT_CONFIG_PARAMETERS, and I think\n>> we'd need a specialized variant of clear_local_git_env_vars specific\n>> to submodule then.\n>\n> Yeah, you'll have to parse, which is pretty painful. In C, you'd do\n> something like:\n\n<snip>\n\n>\n> but right now git-submodule.sh is all in shell. You'd probably need a\n> special helper from git-submodule--helper, though it might simply make\n> sense to put this off until the submodule code is fully ported to C.\n>\n\nI think the best approach is probably to put this off since I am not\n100% sure how we'd handle environment variables from swapping into\nsubmoduler--helper and out. That seems really finicky and likely to go\naway once the full port occurs so I am not sure it's worth it.\n\n> -Peff\n"},{"id":"278674","messageId":"xmqqr3g8d2pn.fsf@gitster.mtv.corp.google.com","threadId":"41313","inReplyTo":"20160219043019.GA14764@sigill.intra.peff.net","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-02-19T17:33:56Z","receivedAt":"2016-02-19T17:33:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> That being said, I am not sure this is the right solution. In the thread\n> I linked earlier[1], Jens indicated he would prefer not to blindly share\n> config with the submodules, and I think I agree. Or are you proposing to\n> pick and choose the keys in GIT_CONFIG_PARAMETERS, and whitelist\n> credential.*?\n\nYes, I think it is sensible not to propagate by default, and pass\nones that are absolutely safe, sane and necessary by whitelisting.\n"},{"id":"278699","messageId":"CA+P7+xqyD=oOnZ+T_L29KYyS4EpmAAVda33ypTphFuPMbvyNRw@mail.gmail.com","threadId":"41313","inReplyTo":"xmqqr3g8d2pn.fsf@gitster.mtv.corp.google.com","subject":"Re: git submodule should honor \"-c credential.helper\" command line argument","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-02-19T19:34:12Z","receivedAt":"2016-02-19T19:34:12Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Fri, Feb 19, 2016 at 9:33 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Jeff King <peff@peff.net> writes:\n>\n>> That being said, I am not sure this is the right solution. In the thread\n>> I linked earlier[1], Jens indicated he would prefer not to blindly share\n>> config with the submodules, and I think I agree. Or are you proposing to\n>> pick and choose the keys in GIT_CONFIG_PARAMETERS, and whitelist\n>> credential.*?\n>\n> Yes, I think it is sensible not to propagate by default, and pass\n> ones that are absolutely safe, sane and necessary by whitelisting.\n\nYes I agree. I'm trying to think of a reasonable way to implement this\nas part of a submodule--helper.. something like whitelist-config or\nsomething, which would just output the value of GIT_CONFIG_PARAMETERS\nafter whitelisting. It would be up to the shell code to then use this\ninside a subshell.\n\nRegards,\nJake\n"}]}