From: Jens Lehmann <Jens.Lehmann@web.de>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Junio C Hamano <gitster@pobox.com>,
bwalton@artsci.utoronto.ca, Johannes Sixt <j6t@kdbg.org>,
avarab@gmail.com, GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH] git-submodule.sh: Don't use $path variable in eval_gettext string
Date: Wed, 18 Apr 2012 13:05:45 +0200 [thread overview]
Message-ID: <4F8EA009.5080405@web.de> (raw)
In-Reply-To: <4F8DAFDA.1020108@ramsay1.demon.co.uk>
Am 17.04.2012 20:00, schrieb Ramsay Jones:
>
> The eval_gettext (and eval_gettextln) i18n shell functions call
> git-sh-i18n--envsubst to process the variable references in the
> string parameter. Unfortunately, environment variables are case
> insensitive on windows, which leads to failure on cygwin when
> eval_gettext exports $path.
>
> Commit df599e9 (Windows: teach getenv to do a case-sensitive search,
> 06-06-2011) attempts to solve this problem on MinGW by overriding
> the system getenv() function to allow git-sh-i18n--envsubst to read
> $path rather than $PATH from the environment. However, this commit
> does not address cygwin at all and, furthermore, does not fix all
> problems on MinGW.
>
> In particular, when executing test #38 in t7400-submodule-basic.sh,
> an 'git-sh-i18n-envsubst.exe - Unable To Locate Component' dialog
> pops up saying that the application "failed to start because
> libiconv2.dll was not found." After studying the voluminous trace
> output from the process monitor, it is clear that the system is
> attempting to use $path, rather than $PATH, to search for the DLL
> file. (Note that, after dismissing the dialog, the test passes
> anyway!)
>
> As an alternative, we finesse the problem by renaming the $path
> variable to $sm_path (submodule path). This fixes the problem on
> MinGW along with all test failures on cygwin (t7400.{7,32,34},
> t7406.3 and t7407.{2,6}). We note that the foreach subcommand
> provides $path to user scripts (ie it is part of the API), so we
> can't simply rename it to $sm_path.
>
> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
> ---
To me it makes sense to rename the problematic $path variable to
get rid of this problem.
> git-submodule.sh | 161 +++++++++++++++++++++++++++---------------------------
> 1 file changed, 82 insertions(+), 79 deletions(-)
>
> diff --git a/git-submodule.sh b/git-submodule.sh
> index 3d94a14..64a70d6 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -101,11 +101,12 @@ module_list()
> module_name()
> {
> # Do we have "submodule.<something>.path = $1" defined in .gitmodules file?
> + sm_path="$1"
> re=$(printf '%s\n' "$1" | sed -e 's/[].[^$\\*]/\\&/g')
> name=$( git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
> sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' )
> test -z "$name" &&
> - die "$(eval_gettext "No submodule mapping found in .gitmodules for path '\$path'")"
> + die "$(eval_gettext "No submodule mapping found in .gitmodules for path '\$sm_path'")"
> echo "$name"
> }
And as an extra this part fixes the bug that the die won't print the
submodule path in case of an error as to do that it would have had
to use $1 here ;-)
next prev parent reply other threads:[~2012-04-18 11:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 18:00 [PATCH] git-submodule.sh: Don't use $path variable in eval_gettext string Ramsay Jones
2012-04-18 11:05 ` Jens Lehmann [this message]
2012-04-18 18:11 ` Johannes Sixt
2012-04-18 20:06 ` Ramsay Jones
2012-04-18 23:42 ` Junio C Hamano
2012-04-24 17:32 ` Ramsay Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F8EA009.5080405@web.de \
--to=jens.lehmann@web.de \
--cc=avarab@gmail.com \
--cc=bwalton@artsci.utoronto.ca \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.org \
--cc=ramsay@ramsay1.demon.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).