All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix global bash variable on __gitcompappend
@ 2015-04-08  5:45 Márcio Almada
  2015-04-08  5:45 ` [PATCH] fix global bash variable leak " Márcio Almada
  0 siblings, 1 reply; 6+ messages in thread
From: Márcio Almada @ 2015-04-08  5:45 UTC (permalink / raw)
  To: git

Hi,

This is how to reproduce the bug:

```
git checkout [tab-tab]
echo $x # outputs the name of the last branch on completion list
```

Or more directly:

```
__gitcompappend "something"
echo $x # outputs 'something'
```

Might not be a big deal, but it's annoying to know that `$x` is lurking.

Márcio Almada (1):
  fix global bash variable leak on __gitcompappend

 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
1.9.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] fix global bash variable leak on __gitcompappend
  2015-04-08  5:45 [PATCH] fix global bash variable on __gitcompappend Márcio Almada
@ 2015-04-08  5:45 ` Márcio Almada
  2015-04-09  3:56   ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Márcio Almada @ 2015-04-08  5:45 UTC (permalink / raw)
  To: git

---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 661a829..1620546 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -186,7 +186,7 @@ fi
 
 __gitcompappend ()
 {
-	local i=${#COMPREPLY[@]}
+	local x i=${#COMPREPLY[@]}
 	for x in $1; do
 		if [[ "$x" == "$3"* ]]; then
 			COMPREPLY[i++]="$2$x$4"
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix global bash variable leak on __gitcompappend
  2015-04-08  5:45 ` [PATCH] fix global bash variable leak " Márcio Almada
@ 2015-04-09  3:56   ` Junio C Hamano
  2015-04-09  8:55     ` SZEDER Gábor
  2015-04-09 13:52     ` Marcio Almada
  0 siblings, 2 replies; 6+ messages in thread
From: Junio C Hamano @ 2015-04-09  3:56 UTC (permalink / raw)
  To: Márcio Almada; +Cc: git, SZEDER Gábor

"Márcio Almada" <marcio.web2@gmail.com> writes:

> ---
>  contrib/completion/git-completion.bash | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Nicely found and corrected.  Please sign-off your patch and Cc area
experts if you can find them (I'll do that this time for you).

Thanks.

>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 661a829..1620546 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -186,7 +186,7 @@ fi
>  
>  __gitcompappend ()
>  {
> -	local i=${#COMPREPLY[@]}
> +	local x i=${#COMPREPLY[@]}
>  	for x in $1; do
>  		if [[ "$x" == "$3"* ]]; then
>  			COMPREPLY[i++]="$2$x$4"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix global bash variable leak on __gitcompappend
  2015-04-09  3:56   ` Junio C Hamano
@ 2015-04-09  8:55     ` SZEDER Gábor
  2015-04-09 13:52     ` Marcio Almada
  1 sibling, 0 replies; 6+ messages in thread
From: SZEDER Gábor @ 2015-04-09  8:55 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Márcio Almada, git


Quoting Junio C Hamano <gitster@pobox.com>:

> "Márcio Almada" <marcio.web2@gmail.com> writes:
>
>> ---
>>  contrib/completion/git-completion.bash | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Nicely found and corrected.  Please sign-off your patch and Cc area
> experts if you can find them (I'll do that this time for you).
>
> Thanks.
>
>>
>> diff --git a/contrib/completion/git-completion.bash  
>> b/contrib/completion/git-completion.bash
>> index 661a829..1620546 100644
>> --- a/contrib/completion/git-completion.bash
>> +++ b/contrib/completion/git-completion.bash
>> @@ -186,7 +186,7 @@ fi
>>
>>  __gitcompappend ()
>>  {
>> -	local i=${#COMPREPLY[@]}
>> +	local x i=${#COMPREPLY[@]}
>>  	for x in $1; do
>>  		if [[ "$x" == "$3"* ]]; then
>>  			COMPREPLY[i++]="$2$x$4"

Looks good and obviously correct, imho even at -rc2 time.

Not sure whether it's maint-worthy, but just in case: it was  
introduced in v1.8.3-rc0~59^2~2.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix global bash variable leak on __gitcompappend
  2015-04-09  3:56   ` Junio C Hamano
  2015-04-09  8:55     ` SZEDER Gábor
@ 2015-04-09 13:52     ` Marcio Almada
  2015-04-09 19:26       ` Eric Sunshine
  1 sibling, 1 reply; 6+ messages in thread
From: Marcio Almada @ 2015-04-09 13:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, SZEDER Gábor

2015-04-09 0:56 GMT-03:00 Junio C Hamano <gitster@pobox.com>:
> "Márcio Almada" <marcio.web2@gmail.com> writes:
>
>> ---
>>  contrib/completion/git-completion.bash | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Nicely found and corrected.  Please sign-off your patch and Cc area
> experts if you can find them (I'll do that this time for you).
>
> Thanks.
>

Ok, I'll remember this next time. Thanks for your incredible work here.

>>
>> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
>> index 661a829..1620546 100644
>> --- a/contrib/completion/git-completion.bash
>> +++ b/contrib/completion/git-completion.bash
>> @@ -186,7 +186,7 @@ fi
>>
>>  __gitcompappend ()
>>  {
>> -     local i=${#COMPREPLY[@]}
>> +     local x i=${#COMPREPLY[@]}
>>       for x in $1; do
>>               if [[ "$x" == "$3"* ]]; then
>>                       COMPREPLY[i++]="$2$x$4"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fix global bash variable leak on __gitcompappend
  2015-04-09 13:52     ` Marcio Almada
@ 2015-04-09 19:26       ` Eric Sunshine
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Sunshine @ 2015-04-09 19:26 UTC (permalink / raw)
  To: Marcio Almada; +Cc: Junio C Hamano, Git List, SZEDER Gábor

On Thu, Apr 9, 2015 at 9:52 AM, Marcio Almada <marcio.web2@gmail.com> wrote:
> 2015-04-09 0:56 GMT-03:00 Junio C Hamano <gitster@pobox.com>:
>> "Márcio Almada" <marcio.web2@gmail.com> writes:
>>>  contrib/completion/git-completion.bash | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Nicely found and corrected.  Please sign-off your patch and Cc area
>> experts if you can find them (I'll do that this time for you).
>
> Ok, I'll remember this next time. Thanks for your incredible work here.

Junio's implication was that you should reply to his message with:

    Signed-off-by: Your Name <your@email>

Or re-send the patch with your sign-off added.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-04-09 19:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-08  5:45 [PATCH] fix global bash variable on __gitcompappend Márcio Almada
2015-04-08  5:45 ` [PATCH] fix global bash variable leak " Márcio Almada
2015-04-09  3:56   ` Junio C Hamano
2015-04-09  8:55     ` SZEDER Gábor
2015-04-09 13:52     ` Marcio Almada
2015-04-09 19:26       ` Eric Sunshine

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.