Re: [PATCH] git-submodule.sh: Don't use $path variable in eval_gettext string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jens Lehmann wrote:
>> Signed-off-by: Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxx>
>> ---
> 
> 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 ;-)

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


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]