git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.)

Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 13 in “difftool: eliminate use of global variables”
  1. 1/3 difftool: eliminate use of global variablesDavid Aguilar, Feb 6, 2025
  2. 2/3 difftool: eliminate use of the_repositoryDavid Aguilar, Feb 6, 2025
  3. Elijah NewrenFeb 6, 2025
  4. 3/3 difftool: eliminate use of USE_THE_REPOSITORY_VARIABLEDavid Aguilar, Feb 6, 2025
  5. Elijah NewrenFeb 6, 2025
  6. Patrick SteinhardtFeb 7, 2025
  7. Junio C HamanoFeb 7, 2025
  8. Elijah NewrenFeb 6, 2025
  9. David AguilarFeb 7, 2025
  10. Junio C HamanoFeb 6, 2025
  11. Elijah NewrenFeb 6, 2025
  12. Junio C HamanoFeb 6, 2025
  13. Patrick SteinhardtFeb 7, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.