Subject: Re: [PATCH v3 3/4] for-each-repo: work correctly in a worktree

From: Derrick Stolee <[email-masked]>
Date: Mon, 2 Mar 2026 13:39:16 -0500

On 3/2/2026 1:06 PM, Jeff King wrote:
> On Mon, Mar 02, 2026 at 03:36:44PM +0000, Derrick Stolee via GitGitGadget wrote:
> 
>> @@ -15,10 +16,11 @@ static const char * const for_each_repo_usage[] = {
>>  
>>  static int run_command_on_repo(const char *path, int argc, const char ** argv)
>>  {
>> -	int i;
>>  	struct child_process child = CHILD_PROCESS_INIT;
>>  	char *abspath = interpolate_path(path, 0);
>>  
>> +	clear_local_repo_env(&child.env);
>> +
>>  	child.git_cmd = 1;
>>  	strvec_pushl(&child.args, "-C", abspath, NULL);
> 
> The second part of the hunk here is as expected, but the first one looks
> wrong. We didn't remove any references to "i", so either it was
> redundant to start with (and the compiler should have complained), or
> now we've broken compilation.

You are correct. I did a --fixup here and it messed up the diff. I should
have double-checked the commit-by-commit compilation and testing post-
rebase.

> Looks like the latter, but we recover when we switch to using pushv in
> patch 4. So I think the declaration of "i" should move to that patch.

Can do. Looks like a small v4 update _is_ required.

Thanks,
-Stolee