public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks•im>
To: Karthik Nayak <karthik.188@gmail•com>
Cc: git@vger•kernel.org,
	"brian m. carlson" <sandals@crustytoothpaste•net>,
	K Jayatheerth <jayatheerthkulkarni2005@gmail•com>,
	ryenus@gmail•com, Junio C Hamano <gitster@pobox•com>,
	Justin Tobler <jltobler@gmail•com>
Subject: Re: [PATCH v2 1/2] BreakingChanges: announce switch to "reftable" format
Date: Thu, 3 Jul 2025 13:42:12 +0200	[thread overview]
Message-ID: <aGZslJSks2GF3uB7@pks.im> (raw)
In-Reply-To: <CAOLa=ZTJOqqr25Sj0YSAc9rDmar2qZiVD3H+K6qhdN3qKdqbGw@mail.gmail.com>

On Thu, Jul 03, 2025 at 12:54:24PM +0200, Karthik Nayak wrote:
> Patrick Steinhardt <ps@pks•im> writes:
> > diff --git a/setup.c b/setup.c
> > index f93bd6a24a5..f0c06c655a9 100644
> > --- a/setup.c
> > +++ b/setup.c
> > @@ -2541,6 +2541,8 @@ static void repository_format_configure(struct repository_format *repo_fmt,
> >  			repo_fmt->ref_storage_format = ref_format;
> >  	} else if (cfg.ref_format != REF_STORAGE_FORMAT_UNKNOWN) {
> >  		repo_fmt->ref_storage_format = cfg.ref_format;
> > +	} else {
> > +		repo_fmt->ref_storage_format = REF_STORAGE_FORMAT_DEFAULT;
> >  	}
> >  	repo_set_ref_storage_format(the_repository, repo_fmt->ref_storage_format);
> >  }
> 
> Shouldn't this change be instead made to REPOSITORY_FORMAT_INIT?

It made me a bit uneasy to change `REPOSITORY_FORMAT_INIT` as it is used
in several places. So I opted for the more contained change.

In any case, I found the logic to be hard to follow anyway as it is not
immediately clear where the default value actually comes from without
the `else` branch. So I consider it a good change regardless. In fact, I
would argue we could go even further and change `REPOSITORY_FORMAT_INIT`
to be set to `_UNKNOWN`. Same for the hash.

Patrick

  reply	other threads:[~2025-07-03 11:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-02 10:14 [PATCH 0/2] Add reftable by default as a breaking change Patrick Steinhardt
2025-07-02 10:14 ` [PATCH 1/2] BreakingChanges: announce switch to "reftable" format Patrick Steinhardt
2025-07-02 17:03   ` Junio C Hamano
2025-07-02 21:21     ` brian m. carlson
2025-07-03  4:43       ` Patrick Steinhardt
2025-07-03  4:43     ` Patrick Steinhardt
2025-07-02 17:17   ` Justin Tobler
2025-07-03  5:00     ` Patrick Steinhardt
2025-07-02 10:14 ` [PATCH 2/2] setup: use "reftable" format when experimental features are enabled Patrick Steinhardt
2025-07-03  6:15 ` [PATCH v2 0/2] Add reftable by default as a breaking change Patrick Steinhardt
2025-07-03  6:15   ` [PATCH v2 1/2] BreakingChanges: announce switch to "reftable" format Patrick Steinhardt
2025-07-03 10:54     ` Karthik Nayak
2025-07-03 11:42       ` Patrick Steinhardt [this message]
2025-07-03 12:24         ` Karthik Nayak
2025-07-03 13:08           ` Patrick Steinhardt
2025-07-03  6:15   ` [PATCH v2 2/2] setup: use "reftable" format when experimental features are enabled Patrick Steinhardt
2025-07-07  5:37   ` [PATCH v2 0/2] Add reftable by default as a breaking change Junio C Hamano
2025-07-04  9:42 ` [PATCH v3 " Patrick Steinhardt
2025-07-04  9:42   ` [PATCH v3 1/2] BreakingChanges: announce switch to "reftable" format Patrick Steinhardt
2025-07-04  9:42   ` [PATCH v3 2/2] setup: use "reftable" format when experimental features are enabled Patrick Steinhardt
2025-07-04 13:14   ` [PATCH v3 0/2] Add reftable by default as a breaking change Karthik Nayak

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=aGZslJSks2GF3uB7@pks.im \
    --to=ps@pks$(echo .)im \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=jayatheerthkulkarni2005@gmail$(echo .)com \
    --cc=jltobler@gmail$(echo .)com \
    --cc=karthik.188@gmail$(echo .)com \
    --cc=ryenus@gmail$(echo .)com \
    --cc=sandals@crustytoothpaste$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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