All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 3/7] builtin/init: refactor messy creation of leading directories
Date: Sat, 26 Sep 2026 01:51:54 +0530	[thread overview]
Message-ID: <63798ed5-3fea-4938-8b0b-910d5f1c7bf0@gmail.com> (raw)
In-Reply-To: <20260924-pks-create-repository-stateless-v1-3-11499557cf31@pks.im>

On 9/24/26 14:49, Patrick Steinhardt wrote:
> diff --git a/builtin/init-db.c b/builtin/init-db.c
> index 5c22eae2f3..e45268f1ff 100644
> --- a/builtin/init-db.c
> +++ b/builtin/init-db.c
> @@ -131,15 +131,7 @@ int cmd_init_db(int argc,
>   	retry:
>   		if (chdir(argv[0]) < 0) {
>   			if (!mkdir_tried) {
> -				int saved;
> -				/*
> -				 * At this point we haven't read any configuration,
> -				 * and we know shared_repository should always be 0;
> -				 * but just in case we play safe.
> -				 */
> -				saved = repo_settings_get_shared_repository(the_repository);
> -				repo_settings_set_shared_repository(the_repository, 0);
> -				switch (safe_create_leading_directories_const(the_repository, argv[0])) {
> +				switch (safe_create_leading_directories_no_share_const(argv[0])) {
>   				case SCLD_OK:
>   				case SCLD_PERMS:
>   					break;
> @@ -150,7 +142,7 @@ int cmd_init_db(int argc,
>   					die_errno(_("cannot mkdir %s"), argv[0]);
>   					break;
>   				}
> -				repo_settings_set_shared_repository(the_repository, saved);
> +

Even though this patch does not aim to do so, we lost a bunch of 
'the_repository' references with this change which is nice.

The patch also looks good to me.

-- 
Sivaraam


  reply	other threads:[~2026-09-25 20:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24  9:19 [PATCH 0/7] setup: enforce repo passed to `create_repository()` has no state Patrick Steinhardt
2026-09-24  9:19 ` [PATCH 1/7] path: drop useless `safe_create_leading_directories_1()` Patrick Steinhardt
2026-09-28  9:01   ` Karthik Nayak
2026-09-24  9:19 ` [PATCH 2/7] path: introduce `safe_create_leading_directories_no_share_const()` Patrick Steinhardt
2026-09-25 19:49   ` Kaartic Sivaraam
2026-09-28  7:15     ` Patrick Steinhardt
2026-09-28  9:21       ` Kaartic Sivaraam
2026-09-24  9:19 ` [PATCH 3/7] builtin/init: refactor messy creation of leading directories Patrick Steinhardt
2026-09-25 20:21   ` Kaartic Sivaraam [this message]
2026-09-24  9:19 ` [PATCH 4/7] builtin/init: move handling of "core.sharedRepository" into "setup.c" Patrick Steinhardt
2026-09-25 20:54   ` Kaartic Sivaraam
2026-09-28  9:13   ` Karthik Nayak
2026-09-24  9:19 ` [PATCH 5/7] builtin/clone: don't apply "core.sharedRepository" to leading dirs Patrick Steinhardt
2026-09-24  9:19 ` [PATCH 6/7] repository: adapt `repo_clear()` to fully reset the repository Patrick Steinhardt
2026-09-28  9:18   ` Karthik Nayak
2026-09-28  9:52     ` Patrick Steinhardt
2026-09-24  9:19 ` [PATCH 7/7] setup: enforce that passed-in repo does not carry relevant state Patrick Steinhardt
2026-09-25 21:08 ` [PATCH 0/7] setup: enforce repo passed to `create_repository()` has no state Kaartic Sivaraam
2026-09-28  9:20 ` Karthik Nayak
2026-09-28  9:51 ` [PATCH v2 " Patrick Steinhardt
2026-09-28  9:51   ` [PATCH v2 1/7] path: drop useless `safe_create_leading_directories_1()` Patrick Steinhardt
2026-09-28  9:51   ` [PATCH v2 2/7] path: introduce `safe_create_leading_directories_no_share_const()` Patrick Steinhardt
2026-09-28  9:51   ` [PATCH v2 3/7] builtin/init: refactor messy creation of leading directories Patrick Steinhardt
2026-09-28  9:51   ` [PATCH v2 4/7] builtin/init: move handling of "core.sharedRepository" into "setup.c" Patrick Steinhardt
2026-09-28  9:51   ` [PATCH v2 5/7] builtin/clone: don't apply "core.sharedRepository" to leading dirs Patrick Steinhardt
2026-09-28  9:51   ` [PATCH v2 6/7] repository: adapt `repo_clear()` to fully reset the repository Patrick Steinhardt
2026-09-28  9:51   ` [PATCH v2 7/7] setup: enforce that passed-in repo does not carry relevant state Patrick Steinhardt
2026-09-28 12:15   ` [PATCH v2 0/7] setup: enforce repo passed to `create_repository()` has no state Kaartic Sivaraam
2026-09-28 12:19     ` Kaartic Sivaraam
2026-09-28 12:48       ` Patrick Steinhardt
2026-09-28 15:59         ` Junio C Hamano
2026-09-28 12: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=63798ed5-3fea-4938-8b0b-910d5f1c7bf0@gmail.com \
    --to=kaartic.sivaraam@gmail.com \
    --cc=git@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.