# [PATCH GSoC] repo: Remove unnecessary variable shadow

4 messages from 2026-02-23 to 2026-02-27. Participants: K Jayatheerth, Justin Tobler, JAYATHEERTH K, Junio C Hamano.
Thread: https://gitlist.dev/t/65056

## K Jayatheerth, 2026-02-23 13:52

Subject: [PATCH GSoC] repo: Remove unnecessary variable shadow
Message-ID: <20260223135248.127935-1-jayatheerthkulkarni2005@gmail.com>
URL: https://gitlist.dev/e/20260223135248.127935-1-jayatheerthkulkarni2005%40gmail.com

```
Avoid redeclaring `entry` inside the conditional block, removing
unnecessary variable shadowing and improving code clarity without
changing behavior.

Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
---
 builtin/repo.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/builtin/repo.c b/builtin/repo.c
index 0ea045abc1..5540bd25d2 100644
--- a/builtin/repo.c
+++ b/builtin/repo.c
@@ -412,7 +412,6 @@ static void stats_table_print_structure(const struct stats_table *table)
 		const char *unit = "";
 
 		if (entry) {
-			struct stats_table_entry *entry = item->util;
 			value = entry->value;
 			if (entry->unit)
 				unit = entry->unit;
-- 
2.53.0


```

## Justin Tobler, 2026-02-23 15:32

Subject: Re: [PATCH GSoC] repo: Remove unnecessary variable shadow
Message-ID: <aZxyju3B4NHp4c_t@denethor>
URL: https://gitlist.dev/e/aZxyju3B4NHp4c_t%40denethor
In-Reply-To: <20260223135248.127935-1-jayatheerthkulkarni2005@gmail.com>

```
On 26/02/23 07:22PM, K Jayatheerth wrote:
> Avoid redeclaring `entry` inside the conditional block, removing
> unnecessary variable shadowing and improving code clarity without
> changing behavior.
> 
> Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
> ---
>  builtin/repo.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/builtin/repo.c b/builtin/repo.c
> index 0ea045abc1..5540bd25d2 100644
> --- a/builtin/repo.c
> +++ b/builtin/repo.c
> @@ -412,7 +412,6 @@ static void stats_table_print_structure(const struct stats_table *table)
>  		const char *unit = "";
>  
>  		if (entry) {
> -			struct stats_table_entry *entry = item->util;

Yup, this is indeed redundant. Thanks for cleaning up after me.

-Justin

```

## JAYATHEERTH K, 2026-02-27 17:07

Subject: Re: [PATCH GSoC] repo: Remove unnecessary variable shadow
Message-ID: <CA+rGoLeppg4Xaoqg6+SZ=ET=ze6rXUbmjLm5UvmitmRGm9u6ag@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2BrGoLeppg4Xaoqg6%2BSZ%3DET%3Dze6rXUbmjLm5UvmitmRGm9u6ag%40mail.gmail.com
In-Reply-To: <20260223135248.127935-1-jayatheerthkulkarni2005@gmail.com>

```
Hey Junio,

I got a review on this patch,
if no one has an issue I wanted to remind it for the next cycle.

Regards
- Jayatheerth

```

## Junio C Hamano, 2026-02-27 19:11

Subject: Re: [PATCH GSoC] repo: Remove unnecessary variable shadow
Message-ID: <xmqq1pi6q9wm.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq1pi6q9wm.fsf%40gitster.g
In-Reply-To: <CA+rGoLeppg4Xaoqg6+SZ=ET=ze6rXUbmjLm5UvmitmRGm9u6ag@mail.gmail.com>

```
JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:

> I got a review on this patch,
> if no one has an issue I wanted to remind it for the next cycle.

Thanks.

An easier way to ping is to resubmit exactly the same patch, with
reviewed-by: or acked-by: trailer crediting the reviewer.  We have
2000+ messages in 4 weeks, so "I got a review on this patch" without
a pointer is much less useful to verify what feedback came to the
thread from whom.  FYI here are from the headers of the message I am
responding to.

    References: <20260223135248.127935-1-jayatheerthkulkarni2005@gmail.com>
    Message-ID: <CA+rGoLeppg4Xaoqg6+SZ=ET=ze6rXUbmjLm5UvmitmRGm9u6ag@mail.gmail.com>

The reference points at the patch itself, and just like Git commits
do not have pointers to their children, the original patch message
has no links to reviews on it X-<.

I'll commit this with the following change now.

Thanks.

1:  006c49ee01 ! 1:  a66c8c7f91 repo: Remove unnecessary variable shadow
    @@ Metadata
     Author: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
     
      ## Commit message ##
    -    repo: Remove unnecessary variable shadow
    +    repo: remove unnecessary variable shadow
     
         Avoid redeclaring `entry` inside the conditional block, removing
         unnecessary variable shadowing and improving code clarity without
         changing behavior.
     
         Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
    +    Acked-by: Justin Tobler <jltobler@gmail.com>
         Signed-off-by: Junio C Hamano <gitster@pobox.com>
     
      ## builtin/repo.c ##



```
