From: Patrick Steinhardt <ps@pks.im>
To: Elijah Newren <newren@gmail.com>
Cc: git@vger.kernel.org, Karthik Nayak <karthik.188@gmail.com>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 00/18] setup: drop uses of `the_repository`
Date: Tue, 21 Apr 2026 11:41:15 +0200 [thread overview]
Message-ID: <aedGO_FGV94tMvu6@pks.im> (raw)
In-Reply-To: <CABPp-BHOVhQPL4ScA+sJCvE2OYXjLJSyDim5AocbcqoxzObGxQ@mail.gmail.com>
On Mon, Apr 20, 2026 at 08:50:45AM -0700, Elijah Newren wrote:
> Thanks, I would have preferred this series to have used the "PATCH v2"
> prefix and for its cover letter to be sent in-response-to the cover
> letter of v1, but those are nitpicks that don't affect the overall
> series.
Yeah, true. I noticed that b4 didn't quite do its thing, but too late. I
think this happens when b4 is still busy sending out mails from the
preceding version, but I already switch branches.
> I thought to check one additional thing I didn't check when reviewing
> v1. I looked for all cases where this series added "the_repository"
> to some function between the beginning and end of the series, and for
> which the function where the code was found already had a
> repo/repository parameter. There were several of these in builtins,
> but those are already littered with cases where cmd_foo() has a
> repository parameter declared UNUSED and where we use the_repository
> anyway. Those should be cleaned up, but that's outside the scope of
> this series. However, I did spot one non-builtin case: in patch 16,
> repo_migrate_ref_storage_format() already has a repo parameter, so
> your call to initialize_repository_version() can use it instead of
> the_repository.
This is something I'm always torn on. The problem here is that more
often than not, series like this end up touching lots and lots of places
throughout the code base.
On the one hand this means that I'd have to reason through every
callsite to figure out whether any repo that is available in the
caller's context is the correct repository to use, or if it's even set
at all (e.g. in the case of `cmd_foo()`). On the other hand, even if I
do so, I cannot trivially prove that the refactoring is equivalent, and
the refactoring may introduce bugs at the callsites I'm adapting because
of it.
So that's why I typically lean towards fixing the subsystem itself, but
doing the trivial swap for callers so that we only have to worry about
one part. The only exception is callers where we don't have
USE_THE_REPOSITORY_VARIABLE defined anymore.
Patrick
next prev parent reply other threads:[~2026-04-21 9:41 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 8:22 [PATCH 00/18] setup: drop uses of `the_repository` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 01/18] setup: replace use of `the_repository` in static functions Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 02/18] setup: stop using `the_repository` in `is_inside_worktree()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 03/18] setup: stop using `the_repository` in `is_inside_git_dir()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 04/18] setup: stop using `the_repository` in `prefix_path()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 05/18] setup: stop using `the_repository` in `path_inside_repo()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 06/18] setup: stop using `the_repository` in `verify_filename()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 07/18] setup: stop using `the_repository` in `verify_non_filename()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 08/18] setup: stop using `the_repository` in `enter_repo()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 09/18] setup: stop using `the_repository` in `setup_work_tree()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 10/18] setup: stop using `the_repository` in `set_git_work_tree()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 11/18] setup: stop using `the_repository` in `setup_git_env()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 12/18] setup: stop using `the_repository` in `setup_git_directory_gently()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 13/18] setup: stop using `the_repository` in `setup_git_directory()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 14/18] setup: stop using `the_repository` in `upgrade_repository_format()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 15/18] setup: stop using `the_repository` in `check_repository_format()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 16/18] setup: stop using `the_repository` in `initialize_repository_version()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 17/18] setup: stop using `the_repository` in `create_reference_database()` Patrick Steinhardt
2026-04-20 8:22 ` [PATCH 18/18] setup: stop using `the_repository` in `init_db()` Patrick Steinhardt
2026-04-20 15:50 ` [PATCH 00/18] setup: drop uses of `the_repository` Elijah Newren
2026-04-21 9:41 ` Patrick Steinhardt [this message]
2026-04-20 17:11 ` Junio C Hamano
2026-04-21 9:41 ` Patrick Steinhardt
-- strict thread matches above, loose matches on Subject: below --
2026-03-30 13:17 Patrick Steinhardt
2026-04-09 13:05 ` Karthik Nayak
2026-04-13 5:48 ` 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=aedGO_FGV94tMvu6@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=karthik.188@gmail.com \
--cc=newren@gmail.com \
/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