On Thu, Feb 06, 2025 at 10:08:29AM -0800, Elijah Newren wrote: > On Thu, Feb 6, 2025 at 5:34 AM Junio C Hamano <gitster@xxxxxxxxx> wrote: > > > > David Aguilar <davvid@xxxxxxxxx> writes: > > > > > Move difftool's global variables into a difftools_option struct > > > in preparation for removal of USE_THE_REPOSITORY_VARIABLE. > > > > Both may be good things, but I am puzzled by the "in preparation > > for" part of the above description. Would it require we lose these > > three global variables if we wanted to pass through a repository > > instance through the callchain instead of relying on implicit use of > > the_repository? > > > > Aren't these pretty much independent and orthogonal? > > The declaration of 'extern int has_symlinks;' in environment.h is > guarded by an #ifdef USE_THE_REPOSITORY_VARIABLE, so if you want to > stop declaring that, you need to both pass a repository through and > stop using that global variable. (The change to trust_exit_code and > symlinks vars do seem to be independent, but kind of make sense to > handle at the same time you are changing how has_symlinks is treated.) Ah, that makes sense. It raises the question whether the refactoring thus breaks something because we don't use that global variable anymore, e.g. if we were munging it in the preimage. But as far as I can see we don't modify it at all, so this should be fine. Patrick