Thread (12 messages) 12 messages, 4 authors, 2016-06-15

Re: [PATCH v2] git: submodule honor -c credential.* from command line

From: Jeff King <hidden>
Date: 2016-06-15 23:08:26

On Wed, Feb 24, 2016 at 07:27:23PM -0500, Eric Sunshine wrote:
quoted
diff --git a/git-submodule.sh b/git-submodule.sh
@@ -192,6 +192,16 @@ isnumber()
+# Sanitize the local git environment for use within a submodule. We
+# can't simply use clear_local_git_env since we want to preserve some
+# of the settings from GIT_CONFIG_PARAMETERS.
+sanitize_local_git_env()
+{
+       local sanitized_config = $(git submodule--helper sanitize-config)
Is 'local' a bashism? (Although, I see that 'local' is already being
used in relative_path(); perhaps that ought to be cleaned up.)
It seems to have spread to Almquist shells like dash, but it's
definitely not in POSIX. That covers _most_ platforms these days, but
I'd guess would break on older ksh. We should probably avoid it.

For the curious, there's a very thorough discussion in the first answer
here:

  http://stackoverflow.com/questions/18597697/posix-compliant-way-to-scope-variables-to-a-function-in-a-shell-script

In this case, we know that we're doing the sanitizing in a subshell, so
I think just dropping "local" and clobbering the existing
$sanitized_config is fine.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help