Re: [PATCH v2 1/3] difftool: eliminate use of global variables
- From
Elijah Newren <newren@gmail.com>
- Date
- Feb 6, 2025, 18:08 UTC
- Message-ID
- <CABPp-BHpqSRy=G4HB+QtbFuP8Bohw6Cd99va2++PawehCDt0Aw@mail.gmail.com>
- In-Reply-To
- <xmqqy0yjjix4.fsf@gitster.g>
On Thu, Feb 6, 2025 at 5:34 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> > David Aguilar <davvid@gmail.com> 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.)