# [PATCH] git-add--interactive.perl: Remove two unused variables

7 messages from 2012-06-24 to 2012-06-25. Participants: Thomas "Enki" Badie, Junio C Hamano, Thomas Rast, Thomas Badie.
Thread: https://gitlist.dev/t/30890

## Thomas "Enki" Badie, 2012-06-24 21:37

Subject: [PATCH] git-add--interactive.perl: Remove two unused variables
Message-ID: <4FE7889E.2020009@gmail.com>
URL: https://gitlist.dev/e/4FE7889E.2020009%40gmail.com

```
The patch 8f0bef6 refactors this script and leaves the `$fh' variable
unused in `diff_applies' and `patch_update_file'.

Signed-off-by: Thomas Badie <badie@lrde.epita.fr>
---
Hello,
This is my first patch. It introduces a really minor change, and I
also want to be sure the way I submit it is the right way. Thanks :)

  git-add--interactive.perl |    2 --
  1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index d948aa8..710764a 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -1067,7 +1067,6 @@ EOF
  }

  sub diff_applies {
-       my $fh;
        return run_git_apply($patch_mode_flavour{APPLY_CHECK} . '--check',
                             map { @{$_->{TEXT}} } @_);
  }
@@ -1514,7 +1513,6 @@ sub patch_update_file {
        }

        if (@result) {
-               my $fh;
                my @patch = reassemble_patch($head->{TEXT}, @result);
                my $apply_routine = $patch_mode_flavour{APPLY};
                &$apply_routine(@patch);

-- 
1.7.5.4

```

## Junio C Hamano, 2012-06-25 05:41

Subject: Re: [PATCH] git-add--interactive.perl: Remove two unused variables
Message-ID: <7vfw9khrrt.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vfw9khrrt.fsf%40alter.siamese.dyndns.org
In-Reply-To: <4FE7889E.2020009@gmail.com>

```
"Thomas \"Enki\" Badie" <thomas.badie@gmail.com> writes:

> The patch 8f0bef6 refactors this script and leaves the `$fh' variable
> unused in `diff_applies' and `patch_update_file'.
>
> Signed-off-by: Thomas Badie <badie@lrde.epita.fr>
> ---
> Hello,
> This is my first patch. It introduces a really minor change, and I
> also want to be sure the way I submit it is the right way. Thanks :)

The patch submission is almost perfect, except that:

 (1) the patch seems to be whitespace damaged; and

 (2) the author of the problematic commit should have been Cc'ed
     (especially when he is still an active participant on the list)
     to give him a chance to Ack it (I'm adding Thomas for this).

Thanks.  I like that you identified why this is a good thing by
quoting the problematic change.

>  git-add--interactive.perl |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/git-add--interactive.perl b/git-add--interactive.perl
> index d948aa8..710764a 100755
> --- a/git-add--interactive.perl
> +++ b/git-add--interactive.perl
> @@ -1067,7 +1067,6 @@ EOF
>  }
>
>  sub diff_applies {
> -       my $fh;
>        return run_git_apply($patch_mode_flavour{APPLY_CHECK} . '--check',
>                             map { @{$_->{TEXT}} } @_);
>  }
> @@ -1514,7 +1513,6 @@ sub patch_update_file {
>        }
>
>        if (@result) {
> -               my $fh;
>                my @patch = reassemble_patch($head->{TEXT}, @result);
>                my $apply_routine = $patch_mode_flavour{APPLY};
>                &$apply_routine(@patch);

```

## Thomas Rast, 2012-06-25 09:12

Subject: Re: [PATCH] git-add--interactive.perl: Remove two unused variables
Message-ID: <87txxzu55d.fsf@thomas.inf.ethz.ch>
URL: https://gitlist.dev/e/87txxzu55d.fsf%40thomas.inf.ethz.ch
In-Reply-To: <7vfw9khrrt.fsf@alter.siamese.dyndns.org>

```
Junio C Hamano <gitster@pobox.com> writes:

> "Thomas \"Enki\" Badie" <thomas.badie@gmail.com> writes:
>
>> The patch 8f0bef6 refactors this script and leaves the `$fh' variable
>> unused in `diff_applies' and `patch_update_file'.
[...]
>  (2) the author of the problematic commit should have been Cc'ed
>      (especially when he is still an active participant on the list)
>      to give him a chance to Ack it (I'm adding Thomas for this).

Indeed, my bad.  It's easy to verify from 'git show 8f0bef6' that this
was an oversight in my patch.

Acked-by: Thomas Rast <trast@student.ethz.ch>

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

```

## Thomas Badie, 2012-06-25 10:12

Subject: Re: [PATCH] git-add--interactive.perl: Remove two unused variables
Message-ID: <CAFjFENo7qLTZHrEtPPBLGzp=h0w69C+7C2zfiJJmqFANmaWAgg@mail.gmail.com>
URL: https://gitlist.dev/e/CAFjFENo7qLTZHrEtPPBLGzp%3Dh0w69C%2B7C2zfiJJmqFANmaWAgg%40mail.gmail.com
In-Reply-To: <7vfw9khrrt.fsf@alter.siamese.dyndns.org>

```
2012/6/25 Junio C Hamano <gitster@pobox.com>:
> "Thomas \"Enki\" Badie" <thomas.badie@gmail.com> writes:
>
>> The patch 8f0bef6 refactors this script and leaves the `$fh' variable
>> unused in `diff_applies' and `patch_update_file'.
>>
>> Signed-off-by: Thomas Badie <badie@lrde.epita.fr>
>> ---
>> Hello,
>> This is my first patch. It introduces a really minor change, and I
>> also want to be sure the way I submit it is the right way. Thanks :)
>
> The patch submission is almost perfect, except that:
>
>  (1) the patch seems to be whitespace damaged; and
>

The only damage I see is a space on the deleted lines which doesn't
exist in the patch. Is that you're talking about ?
I need to investigate why it appears...

>  (2) the author of the problematic commit should have been Cc'ed
>     (especially when he is still an active participant on the list)
>     to give him a chance to Ack it (I'm adding Thomas for this).

My bad, I forgot to check if the commiter were still active. I'll check it
for the next time.

> Thanks.  I like that you identified why this is a good thing by
> quoting the problematic change.

Thanks :)

>>  git-add--interactive.perl |    2 --
>>  1 files changed, 0 insertions(+), 2 deletions(-)
>>
>> diff --git a/git-add--interactive.perl b/git-add--interactive.perl
>> index d948aa8..710764a 100755
>> --- a/git-add--interactive.perl
>> +++ b/git-add--interactive.perl
>> @@ -1067,7 +1067,6 @@ EOF
>>  }
>>
>>  sub diff_applies {
>> -      my $fh;
>>        return run_git_apply($patch_mode_flavour{APPLY_CHECK} . '--check',
>>                             map { @{$_->{TEXT}} } @_);
>>  }
>> @@ -1514,7 +1513,6 @@ sub patch_update_file {
>>        }
>>
>>        if (@result) {
>> -              my $fh;
>>                my @patch = reassemble_patch($head->{TEXT}, @result);
>>                my $apply_routine = $patch_mode_flavour{APPLY};
>>                &$apply_routine(@patch);

-- 
Thomas "Enki" Badie

```

## Thomas Badie, 2012-06-25 10:16

Subject: Re: [PATCH] git-add--interactive.perl: Remove two unused variables
Message-ID: <CAFjFENqrGreepYXM3DrDiYEsau9-vM-qmf8KvqrNNjdCS-adjg@mail.gmail.com>
URL: https://gitlist.dev/e/CAFjFENqrGreepYXM3DrDiYEsau9-vM-qmf8KvqrNNjdCS-adjg%40mail.gmail.com
In-Reply-To: <87txxzu55d.fsf@thomas.inf.ethz.ch>

```
2012/6/25 Thomas Rast <trast@inf.ethz.ch>:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> "Thomas \"Enki\" Badie" <thomas.badie@gmail.com> writes:
>>
>>> The patch 8f0bef6 refactors this script and leaves the `$fh' variable
>>> unused in `diff_applies' and `patch_update_file'.
> [...]
>>  (2) the author of the problematic commit should have been Cc'ed
>>      (especially when he is still an active participant on the list)
>>      to give him a chance to Ack it (I'm adding Thomas for this).
>
> Indeed, my bad.  It's easy to verify from 'git show 8f0bef6' that this
> was an oversight in my patch.
>
> Acked-by: Thomas Rast <trast@student.ethz.ch>

It happens to everyone^^ Thanks for your answer.

Should I repost a patch V2 or it is okay like this?
Thanks

-- 
Thomas "Enki" Badie

```

## Junio C Hamano, 2012-06-25 18:06

Subject: Re: [PATCH] git-add--interactive.perl: Remove two unused variables
Message-ID: <7v7guvgtbi.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v7guvgtbi.fsf%40alter.siamese.dyndns.org
In-Reply-To: <CAFjFENo7qLTZHrEtPPBLGzp=h0w69C+7C2zfiJJmqFANmaWAgg@mail.gmail.com>

```
Thomas Badie <thomas.badie@gmail.com> writes:

> 2012/6/25 Junio C Hamano <gitster@pobox.com>:
>> "Thomas \"Enki\" Badie" <thomas.badie@gmail.com> writes:
>>
>>> The patch 8f0bef6 refactors this script and leaves the `$fh' variable
>>> unused in `diff_applies' and `patch_update_file'.
>>>
>>> Signed-off-by: Thomas Badie <badie@lrde.epita.fr>
>>> ---
>>> Hello,
>>> This is my first patch. It introduces a really minor change, and I
>>> also want to be sure the way I submit it is the right way. Thanks :)
>>
>> The patch submission is almost perfect, except that:
>>
>> (1) the patch seems to be whitespace damaged; and
>>
>
> The only damage I see is a space on the deleted lines which doesn't
> exist in the patch. Is that you're talking about ?
> I need to investigate why it appears...

A typical context line would begin with SP and typically then tab
(because our code is indented with leading tabs) but your context
lines all have two SPs in front and indented with more SPs.  This is
a symptom of your MUA mangling your patch, and the reason can be seen
in the "Content-Type: text/plain; charset=ISO-8859-1; format=flowed"
header.

```

## Thomas Badie, 2012-06-25 22:41

Subject: Re: [PATCH] git-add--interactive.perl: Remove two unused variables
Message-ID: <4FE8E934.4090604@gmail.com>
URL: https://gitlist.dev/e/4FE8E934.4090604%40gmail.com
In-Reply-To: <7v7guvgtbi.fsf@alter.siamese.dyndns.org>

```
On 25/06/2012 20:06, Junio C Hamano wrote:
> Thomas Badie <thomas.badie@gmail.com> writes:
> 
>> 2012/6/25 Junio C Hamano <gitster@pobox.com>:
>>> "Thomas \"Enki\" Badie" <thomas.badie@gmail.com> writes:
>>>
>>>> The patch 8f0bef6 refactors this script and leaves the `$fh' variable
>>>> unused in `diff_applies' and `patch_update_file'.
>>>>
>>>> Signed-off-by: Thomas Badie <badie@lrde.epita.fr>
>>>> ---
>>>> Hello,
>>>> This is my first patch. It introduces a really minor change, and I
>>>> also want to be sure the way I submit it is the right way. Thanks :)
>>>
>>> The patch submission is almost perfect, except that:
>>>
>>> (1) the patch seems to be whitespace damaged; and
>>>
>>
>> The only damage I see is a space on the deleted lines which doesn't
>> exist in the patch. Is that you're talking about ?
>> I need to investigate why it appears...
> 
> A typical context line would begin with SP and typically then tab
> (because our code is indented with leading tabs) but your context
> lines all have two SPs in front and indented with more SPs.  This is
> a symptom of your MUA mangling your patch, and the reason can be seen
> in the "Content-Type: text/plain; charset=ISO-8859-1; format=flowed"
> header.
> 

I follow the first approach in the tutorial in
`git format-patch --help`, and I hope it works as expected :)

I wonder what is the next step, should I repost the previous patch with
the line "Acked-by: Thomas Rast <trast@student.ethz.ch>" or it is okay
right now?

Thanks a lot for your help on this first patch,

-- 
Thomas "Enki" Badie

```
