{"thread":{"id":"35348","subject":"submodule update and core.askpass","startedAt":"2013-11-16T21:24:30Z","lastAt":"2013-11-22T12:33:44Z","messageCount":4,"participants":["Dmitry Neverov","Thomas Rast","Jens Lehmann"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"230711","messageId":"m28uwoxcoh.fsf@nds-macbook-air.labs.intellij.net","threadId":"35348","inReplyTo":null,"subject":"submodule update and core.askpass","fromName":"Dmitry Neverov","fromEmail":"dmitry.neverov@jetbrains.com","sentAt":"2013-11-16T21:24:30Z","receivedAt":"2013-11-16T21:24:30Z","isPatch":false,"sender":{"key":"dmitry.neverov@jetbrains.com","avatar":null},"body":"Hi,\n\nit seems like \"git submodule update\" command doesn't respect the\ncore.askpass option specified in a command line. I have a repository\nwith a submodule, I serve it over http which requires an authorization\nand both main repository and submodule require the same credentials. I\nrun the following commands (pass.sh is a script which prints a password\nto stdout):\n\ngit -c core.askpass=pass.sh clone main-repo\ncd main-repo\ngit submodule init\ngit submodule sync\ngit -c core.askpass=pass.sh submodule update\n\nThe last command asks for a password interactively. \n\nI've run bisect, it seems like it started failing from commit\nbe8779f7ac9a3be9aa783df008d59082f4054f67. I've checked: submodule update\nworks fine in 1.8.5.rc2 with removed call to clear_local_git_env.\n\nIs there any way to make git submodule update respect core.askpass\noption, so one can use it in scripts?\n\n-- \nDmitry Neverov\n"},{"id":"230712","messageId":"87eh6gkoq9.fsf@linux-k42r.v.cablecom.net","threadId":"35348","inReplyTo":"m28uwoxcoh.fsf@nds-macbook-air.labs.intellij.net","subject":"Re: submodule update and core.askpass","fromName":"Thomas Rast","fromEmail":"tr@thomasrast.ch","sentAt":"2013-11-16T21:42:38Z","receivedAt":"2013-11-16T21:42:38Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"+cc Daniel and Jens\n\nDmitry Neverov <dmitry.neverov@jetbrains.com> writes:\n\n> git -c core.askpass=pass.sh clone main-repo\n> cd main-repo\n> git submodule init\n> git submodule sync\n> git -c core.askpass=pass.sh submodule update\n>\n> The last command asks for a password interactively. \n>\n> I've run bisect, it seems like it started failing from commit\n> be8779f7ac9a3be9aa783df008d59082f4054f67. I've checked: submodule update\n> works fine in 1.8.5.rc2 with removed call to clear_local_git_env.\n\nAside from GIT_CONFIG_PARAMETERS, which this needs, I wonder if we\nshould also let other variables pass through.  For example, if the user\nwent out of their way to set GIT_ALTERNATE_OBJECT_DIRECTORIES, shouldn't\nwe also respect that?\n\nThe list of variables that is unset by clear_local_git_env is $(git\nrev-parse --local-env-vars), currently\n\n  GIT_ALTERNATE_OBJECT_DIRECTORIES\n  GIT_CONFIG\n  GIT_CONFIG_PARAMETERS\n  GIT_OBJECT_DIRECTORY\n  GIT_DIR\n  GIT_WORK_TREE\n  GIT_IMPLICIT_WORK_TREE\n  GIT_GRAFT_FILE\n  GIT_INDEX_FILE\n  GIT_NO_REPLACE_OBJECTS\n  GIT_PREFIX\n\n-- \nThomas Rast\ntr@thomasrast.ch\n"},{"id":"230713","messageId":"5287F42D.5090900@web.de","threadId":"35348","inReplyTo":"87eh6gkoq9.fsf@linux-k42r.v.cablecom.net","subject":"Re: submodule update and core.askpass","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2013-11-16T22:39:41Z","receivedAt":"2013-11-16T22:39:41Z","isPatch":false,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 16.11.2013 22:42, schrieb Thomas Rast:\n> Dmitry Neverov <dmitry.neverov@jetbrains.com> writes:\n> \n>> git -c core.askpass=pass.sh clone main-repo\n>> cd main-repo\n>> git submodule init\n>> git submodule sync\n>> git -c core.askpass=pass.sh submodule update\n>>\n>> The last command asks for a password interactively. \n>>\n>> I've run bisect, it seems like it started failing from commit\n>> be8779f7ac9a3be9aa783df008d59082f4054f67. I've checked: submodule update\n>> works fine in 1.8.5.rc2 with removed call to clear_local_git_env.\n> \n> Aside from GIT_CONFIG_PARAMETERS, which this needs ...\n\nYes, if I understand GIT_CONFIG_PARAMETERS correctly we should not\nclean it as the user explicitly asked us to use that setting.\n\n> ..., I wonder if we\n> should also let other variables pass through.  For example, if the user\n> went out of their way to set GIT_ALTERNATE_OBJECT_DIRECTORIES, shouldn't\n> we also respect that?\n\nHmm, I'm not so sure. Does the user really want the setting of\nGIT_ALTERNATE_OBJECT_DIRECTORIES to be honored inside the submodule\ntoo or would he want a different setting (including none)? I suspect\ndifferent users would give different answers. And wouldn't a working\nGIT_CONFIG_PARAMETERS (or configuring the submodule after the initial\nclone) be the solution for that?\n\n> The list of variables that is unset by clear_local_git_env is $(git\n> rev-parse --local-env-vars), currently\n> \n>   GIT_ALTERNATE_OBJECT_DIRECTORIES\n>   GIT_CONFIG\n>   GIT_CONFIG_PARAMETERS\n>   GIT_OBJECT_DIRECTORY\n>   GIT_DIR\n>   GIT_WORK_TREE\n>   GIT_IMPLICIT_WORK_TREE\n>   GIT_GRAFT_FILE\n>   GIT_INDEX_FILE\n>   GIT_NO_REPLACE_OBJECTS\n>   GIT_PREFIX\n"},{"id":"230940","messageId":"m2wqk0zkd3.fsf@nds-macbook-air.labs.intellij.net","threadId":"35348","inReplyTo":"5287F42D.5090900@web.de","subject":"Re: submodule update and core.askpass","fromName":"Dmitry Neverov","fromEmail":"dmitry.neverov@jetbrains.com","sentAt":"2013-11-22T12:33:44Z","receivedAt":"2013-11-22T12:33:44Z","isPatch":false,"sender":{"key":"dmitry.neverov@jetbrains.com","avatar":null},"body":"BTW, a workaround is to pass a path to askpass script in the GIT_ASKPASS\nenvironment variable. \nJens Lehmann <Jens.Lehmann@web.de> writes:\n\n> Am 16.11.2013 22:42, schrieb Thomas Rast:\n>> Dmitry Neverov <dmitry.neverov@jetbrains.com> writes:\n>> \n>>> git -c core.askpass=pass.sh clone main-repo\n>>> cd main-repo\n>>> git submodule init\n>>> git submodule sync\n>>> git -c core.askpass=pass.sh submodule update\n>>>\n>>> The last command asks for a password interactively. \n>>>\n>>> I've run bisect, it seems like it started failing from commit\n>>> be8779f7ac9a3be9aa783df008d59082f4054f67. I've checked: submodule update\n>>> works fine in 1.8.5.rc2 with removed call to clear_local_git_env.\n>> \n>> Aside from GIT_CONFIG_PARAMETERS, which this needs ...\n>\n> Yes, if I understand GIT_CONFIG_PARAMETERS correctly we should not\n> clean it as the user explicitly asked us to use that setting.\n>\n>> ..., I wonder if we\n>> should also let other variables pass through.  For example, if the user\n>> went out of their way to set GIT_ALTERNATE_OBJECT_DIRECTORIES, shouldn't\n>> we also respect that?\n>\n> Hmm, I'm not so sure. Does the user really want the setting of\n> GIT_ALTERNATE_OBJECT_DIRECTORIES to be honored inside the submodule\n> too or would he want a different setting (including none)? I suspect\n> different users would give different answers. And wouldn't a working\n> GIT_CONFIG_PARAMETERS (or configuring the submodule after the initial\n> clone) be the solution for that?\n>\n>> The list of variables that is unset by clear_local_git_env is $(git\n>> rev-parse --local-env-vars), currently\n>> \n>>   GIT_ALTERNATE_OBJECT_DIRECTORIES\n>>   GIT_CONFIG\n>>   GIT_CONFIG_PARAMETERS\n>>   GIT_OBJECT_DIRECTORY\n>>   GIT_DIR\n>>   GIT_WORK_TREE\n>>   GIT_IMPLICIT_WORK_TREE\n>>   GIT_GRAFT_FILE\n>>   GIT_INDEX_FILE\n>>   GIT_NO_REPLACE_OBJECTS\n>>   GIT_PREFIX\n>\n>\n\n-- \nDmitry Neverov\nJetBrains\nhttp://www.jetbrains.com\n\"Develop with pleasure!\"\n"}]}