git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "David Aguilar" <davvid@gmail.com>,
	git@vger.kernel.org,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Patrick Steinhardt" <ps@pks.im>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: [PATCH v2 1/3] difftool: eliminate use of global variables
Date: Thu, 6 Feb 2025 10:08:29 -0800	[thread overview]
Message-ID: <CABPp-BHpqSRy=G4HB+QtbFuP8Bohw6Cd99va2++PawehCDt0Aw@mail.gmail.com> (raw)
In-Reply-To: <xmqqy0yjjix4.fsf@gitster.g>

On Thu, Feb 6, 2025 at 5:34 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> 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.)

  reply	other threads:[~2025-02-06 18:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06  4:20 [PATCH v2 1/3] difftool: eliminate use of global variables David Aguilar
2025-02-06  4:20 ` [PATCH v2 2/3] difftool: eliminate use of the_repository David Aguilar
2025-02-06  8:30   ` Elijah Newren
2025-02-06  4:20 ` [PATCH v2 3/3] difftool: eliminate use of USE_THE_REPOSITORY_VARIABLE David Aguilar
2025-02-06  8:31   ` Elijah Newren
2025-02-07  6:28     ` Patrick Steinhardt
2025-02-07 17:49       ` Junio C Hamano
2025-02-06  8:29 ` [PATCH v2 1/3] difftool: eliminate use of global variables Elijah Newren
2025-02-07  4:44   ` David Aguilar
2025-02-06 13:34 ` Junio C Hamano
2025-02-06 18:08   ` Elijah Newren [this message]
2025-02-06 19:07     ` Junio C Hamano
2025-02-07  6:28     ` Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABPp-BHpqSRy=G4HB+QtbFuP8Bohw6Cd99va2++PawehCDt0Aw@mail.gmail.com' \
    --to=newren@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).