public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsay1•demon.co.uk>
To: Jens Lehmann <Jens.Lehmann@web•de>
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 21:06:04 +0100	[thread overview]
Message-ID: <4F8F1EAC.5040704@ramsay1.demon.co.uk> (raw)
In-Reply-To: <4F8EA009.5080405@web.de>

Jens Lehmann wrote:
>> 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 ;-)

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

  parent reply	other threads:[~2012-04-18 20:07 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
2012-04-18 18:11   ` Johannes Sixt
2012-04-18 20:06   ` Ramsay Jones [this message]
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=4F8F1EAC.5040704@ramsay1.demon.co.uk \
    --to=ramsay@ramsay1$(echo .)demon.co.uk \
    --cc=Jens.Lehmann@web$(echo .)de \
    --cc=avarab@gmail$(echo .)com \
    --cc=bwalton@artsci$(echo .)utoronto.ca \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=j6t@kdbg$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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