Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org,  Karthik Nayak <karthik.188@gmail.com>,
	 Elijah Newren <newren@gmail.com>
Subject: Re: [PATCH 00/18] setup: drop uses of `the_repository`
Date: Mon, 20 Apr 2026 10:11:09 -0700	[thread overview]
Message-ID: <xmqqy0ihpnf6.fsf@gitster.g> (raw)
In-Reply-To: <20260420-pks-setup-wo-the-repository-v1-0-f4a81c4988e8@pks.im> (Patrick Steinhardt's message of "Mon, 20 Apr 2026 10:22:30 +0200")

Patrick Steinhardt <ps@pks.im> writes:

> Message-Id: <20260420-pks-setup-wo-the-repository-v1-0-f4a81c4988e8@pks.im>

There seem to be some tool errors that made this marked as v1 (hence
no References/In-Reply-To).

>   -  9/18: setup: stop using `the_repository` in `setup_work_tree()`

> diff --git a/setup.c b/setup.c
> index dca32addae..80dd94b261 100644
> --- a/setup.c
> +++ b/setup.c
> @@ -26,7 +26,6 @@
>  #include "trace2.h"
>  #include "worktree.h"
>  
> -static int work_tree_config_is_bogus;

Once we start "setting up" more than one instance of "struct
repository", "the worktree configuration given to us is bogus" bit
cannot be a singleton global that applies across repositories.

Hopefully nobody sets core.bare and core.worktree in configuration
files other than the repository local one.  Otherwise a lot of
interesting would break ;-)

I am not quite sure the reasoning behind removing "initialized"
global without any replacement was properly explained, with "should
ultimately be idempotent".  This can give us a huge performance
regression, if the callers have been relying on setup_work_tree() to
be _cheap_ when they call it "just in case" no other potential
callsites have called it, even though all of them know that the
current code works only with the_repository (in other words, they
call because the switched into the_repository---they do not know for
sure if other call sites have called it).

Or does the current code never call setup_work_tree() twice, because
everybody knows that we never work with anything other than
the_repository?

Other than that, the [09/18] step looks sensible to me.

Thanks.


  parent reply	other threads:[~2026-04-20 17:11 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
2026-04-20 17:11 ` Junio C Hamano [this message]
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=xmqqy0ihpnf6.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=karthik.188@gmail.com \
    --cc=newren@gmail.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