Re: [PATCH v2 5/5] Reftable support for git-core
- From
Han-Wen Nienhuys <hanwen@google.com>
- Date
- Feb 4, 2020, 20:22 UTC
- Message-ID
- <CAFQ2z_MZcYEDkyKENE+eRLAQCXObqqaypHvL_coHrecoxp655g@mail.gmail.com>
- In-Reply-To
- <20200128073100.GA563058@coredump.intra.peff.net>
On Tue, Jan 28, 2020 at 8:31 AM Jeff King <peff@peff.net> wrote:
Show 21 quoted lines
>
> > {
> > - const char *be_name = "files";
> > - struct ref_storage_be *be = find_ref_storage_backend(be_name);
> > + struct strbuf refs_path = STRBUF_INIT;
> > +
> > + /* XXX this should probably come from a git config setting and not
> > + default to reftable. */
> > + const char *be_name = "reftable";
>
> I think the scheme here needs to be something like:
>
> - "struct repository" gets a new "ref_format" field
>
> - setup.c:check_repo_format() learns about an extensions.refFormat
> config key, which we use to set repo->ref_format
>
> - init/clone should take a command-line option for the ref format of
> the new repository. Anybody choosing reftables would want to set
> core.repositoryformatversion to "1" and set the extensions.refFormat
> key.I did this, but are you sure this works? Where would the repo->ref_storage_format get set? I tried adding it to repo_init(), but this doesn't get called in a normal startup sequence.
Breakpoint 3, ref_store_init (gitdir=0x555555884b70 ".git", be_name=0x5555557942ca "reftable", flags=15) at refs.c:1841 warning: Source file is more recent than executable. 1841 { (gdb) up #1 0x00005555556de2c8 in get_main_ref_store (r=0x555555871d40 <the_repo>) at refs.c:1862 (gdb) p r->ref_storage_format $1 = 0x0 }
I'm sending the revised patch series now.
-- Han-Wen Nienhuys - Google Munich I work 80%. Don't expect answers from me on Fridays. -- Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Paul Manicle, Halimah DeLaine Prado