From: Elijah Newren Date: Thu, 19 Feb 2026 18:42:28 GMT Subject: Re: [PATCH 4/5] merge-ort: prevent the_repository from coming back Message-ID: In-Reply-To: On Thu, Feb 19, 2026 at 7:27 AM Patrick Steinhardt wrote: > > On Wed, Feb 18, 2026 at 09:15:14AM +0000, Elijah Newren via GitGitGadget wrote: > > From: Elijah Newren > > > > There are two things preventing us from removing our usage of > > USE_THE_REPOSITORY_VARIABLE: one necessary use of the_repository in > > prefetch_for_content_merges(), and the use of DEFAULT_ABBREV. We have > > removed all other uses of the_repository in merge-ort before (multiple > > times), but without removing that definition, they keep coming back. > > Unfortunate, but I think it's okay to be pragmatic here. Yeah, also full disclosure: I do not know why prefetch_for_content_merges() needs to use the_repository. When I introduced it back in 2bff554b23e8 (merge-ort: add prefetching for content merges, 2021-06-22), I was just looking at diffcore_std() and trying to mimic how it did the prefetch. I don't actually understand why the comparison against the_repository is there for either of these functions. Maybe someone else knows and could shed some light? (cc: Jonathan Tan for the diffcore_std() case I was copying from...) > > diff --git a/merge-ort.c b/merge-ort.c > > index 40a11dca73..ae19118550 100644 > > --- a/merge-ort.c > > +++ b/merge-ort.c > > @@ -53,6 +53,8 @@ > > #include "unpack-trees.h" > > #include "xdiff-interface.h" > > > > +#define the_repository DO_NOT_USE_THE_REPOSITORY > > Do we want to have a comment here that explains why we do this dance? Sure, will do.