From: René Scharfe Date: Sun, 15 Feb 2026 18:42:42 GMT Subject: Re: [PATCH] xdiff-interface: stop using the_repository Message-ID: <97e0fa77-0946-4898-b721-5f1a5d1153bd@web.de> In-Reply-To: On 2/9/26 7:57 PM, Elijah Newren wrote: > On Sun, Feb 8, 2026 at 5:47 AM René Scharfe wrote: >> > ... >> diff --git a/merge-ort.c b/merge-ort.c >> index e80e4f735a..a4103d56ed 100644 >> --- a/merge-ort.c >> +++ b/merge-ort.c >> @@ -2136,9 +2136,9 @@ static int merge_3way(struct merge_options *opt, >> name2 = mkpathdup("%s:%s", opt->branch2, pathnames[2]); >> } >> >> - read_mmblob(&orig, o); >> - read_mmblob(&src1, a); >> - read_mmblob(&src2, b); >> + read_mmblob(&orig, the_repository->objects, o); >> + read_mmblob(&src1, the_repository->objects, a); >> + read_mmblob(&src2, the_repository->objects, b); >> >> merge_status = ll_merge(result_buf, path, &orig, base, >> &src1, name1, &src2, name2, > > A minor point, but could we use opt->repo instead of the_repository in > merge-ort? > > I've cleaned out all the_repository references before, except one in > prefetch_for_content_merges(), and would prefer folks not add more. I can imagine that this whack-a-mole game is annoying. The patch above at least didn't actually add them, it just made them explicit. Indirect references may look better on the surface, but the functions that contain them still can only be used with the_repository. The only way I can see to avoid that pain would be to convert leaf functions, only, i.e. those that reference the_repository and friends, but don't call any other functions or macros that do. This way a transition to the_repository-free would be meaningful and permanent for each function. Converting on all levels of the call chain in parallel requires less coordination and is probably more realistic in our distributed development model, though. Do you (anyone) know nice tools for listing the full call chain graph of C functions? cscope can probably be made to do that with some scripting, but seems inefficient for that purpose. Such a tool could be used to check for indirect references and tell us if functions are safe for use with other repositories. René