Re: [PATCH] git-submodule.sh: Don't use $path variable in eval_gettext string
- From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
- Date
- Apr 18, 2012, 20:06 UTC
- Message-ID
- <4F8F1EAC.5040704@ramsay1.demon.co.uk>
- In-Reply-To
- <4F8EA009.5080405@web.de>
Jens Lehmann wrote:
Show 5 quoted lines
>> 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.
Show 24 quoted lines
>> 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 ;-)Yes, I noted that this was an independent fix when I first sent this to the list (as an RFC) in the v1.7.8 rc time frame.
I had intended to either add a separate patch to fix this, or note it in the commit message, but I obviously forgot.
[Junio, which alternative would you prefer?]
Thanks!
ATB, Ramsay Jones