From: Jeff King Date: Fri, 27 Feb 2026 22:45:19 GMT Subject: Re: [PATCH v2 2/2] for-each-repo: work correctly in a worktree Message-ID: <20260227224519.GB2956443@coredump.intra.peff.net> In-Reply-To: On Thu, Feb 26, 2026 at 08:21:23AM -0800, Junio C Hamano wrote: > > This comment details my findings from comparing the list in > > local_repo_env[] and the top-level options listed in > > Documentation/git.adoc. That's how I was able to find that > > --exec-path sets an environment variable that's NOT in the > > list and we want to be sure we don't set it. > > Hmph, wouldn't we want to use specified exec-path inside ... > > git --exec-path=~/my/git/libexec for-each-repo sh -c "do things" > > ... "do things" script when we find Git related binaries? Or am I > not getting what you are describing here? I almost responded with the same thing, but I think the suggestion is going the other way: we (correctly) do not list EXEC_PATH_ENVIRONMENT via local_repo_env, so it will never be removed from the environment. And thus we do not need to do anything here to drop it from the list of what is removed. Double negation. :) The second paragraph: > > Should we add the comparison to EXEC_PATH_ENVIRONMENT as a > > precaution to make sure it's not added to local_repo_env in > > the future? Or is that too defensive? makes that more clear, I think. I did have to read the whole thing twice. ;) -Peff