Subject: Re: [PATCH v2 2/2] for-each-repo: work correctly in a worktree

From: Phillip Wood <[email-masked]>
Date: Thu, 26 Feb 2026 18:14:28 +0000

On 26/02/2026 16:21, Junio C Hamano wrote:
> Derrick Stolee <[email-masked]> writes:
> 
>> static int run_command_on_repo(const char *path, int argc, const char ** argv)
>> {
>> 	int i = 0;
>> 	struct child_process child = CHILD_PROCESS_INIT;
>> 	char *abspath = interpolate_path(path, 0);
>>
>> 	while (local_repo_env[i]) {
>> 		/*
>> 		 * Preserve pre-builtin options:
>> 		 * - CONFIG_ENVIRONMENT, CONFIG_DATA_ENVIRONMENT, and
>> 		 *   CONFIG_COUNT_ENVIRONMENT persist -c <name>=<value>
>> 		 *   and --config-env=<name>=<envvar> options.
>> 		 * - NO_REPLACE_OBJECTS_ENVIRONMENT persists the
>> 		 *   --no-replace-objects option.
>> 		 *
>> 		 * Note that the following options are not in local_repo_env:
>> 		 * - EXEC_PATH_ENVIRONMENT persists --exec-path option.
>> 		 */
>> 		if (strncmp(local_repo_env[i], "CONFIG_", 7) &&
> 
> Minor nit: !starts_with() lets you avoid counting bytes yourself and
> hardcoding "7" here.

More seriously it should be looking for strings starting with 
"GIT_CONFIG_", not the name of the preprocessor definitions.

Thanks

Phillip