git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Karthik Nayak <karthik.188@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 03/16] refs: implement releasing ref storages
Date: Fri, 17 May 2024 09:08:55 +0200	[thread overview]
Message-ID: <ZkcCh3OhbPOn0HOF@tanuki> (raw)
In-Reply-To: <CAOLa=ZT3VqhrHXt9x-4DN7norTb3RuscBx+VHipn=QxJvwwThQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1726 bytes --]

On Thu, May 16, 2024 at 11:39:36AM -0500, Karthik Nayak wrote:
> Patrick Steinhardt <ps@pks.im> writes:
> 
> [snip]
> 
> > diff --git a/refs/debug.c b/refs/debug.c
> > index 58fb4557ed..27aae42134 100644
> > --- a/refs/debug.c
> > +++ b/refs/debug.c
> > @@ -33,6 +33,12 @@ struct ref_store *maybe_debug_wrap_ref_store(const char *gitdir, struct ref_stor
> >  	return (struct ref_store *)res;
> >  }
> >
> > +static void debug_release(struct ref_store *refs)
> > +{
> > +	struct debug_ref_store *drefs = (struct debug_ref_store *)refs;
> 
> We should probably add a trace here, using `trace_printf_key()`

I didn't because we don't have `debug_init()` with a trace, either, and
because there is no error code that we could report. But on the other
hand it does not hurt to have it here, so let's just add it.

[snip]
> > diff --git a/refs/reftable-backend.c b/refs/reftable-backend.c
> > index a4bb71cd76..6c262c2193 100644
> > --- a/refs/reftable-backend.c
> > +++ b/refs/reftable-backend.c
> > @@ -293,6 +293,27 @@ static struct ref_store *reftable_be_init(struct repository *repo,
> >  	return &refs->base;
> >  }
> >
> > +static void reftable_be_release(struct ref_store *ref_store)
> > +{
> > +	struct reftable_ref_store *refs = reftable_be_downcast(ref_store, 0, "release");
> > +	struct strmap_entry *entry;
> > +	struct hashmap_iter iter;
> > +
> > +	if (refs->main_stack) {
> > +		reftable_stack_destroy(refs->main_stack);
> > +		refs->main_stack = NULL;
> > +	}
> > +
> > +	if (refs->worktree_stack) {
> > +		reftable_stack_destroy(refs->worktree_stack);
> > +		refs->main_stack = NULL;
> 
> This should be `refs->worktree_stack`, right?

Good catch, yes.

Patrick

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2024-05-17  7:08 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-16  8:04 [PATCH 00/16] refs: drop all references to `the_repository` Patrick Steinhardt
2024-05-16  8:04 ` [PATCH 01/16] refs: adjust names for `init` and `init_db` callbacks Patrick Steinhardt
2024-05-16 14:50   ` Karthik Nayak
2024-05-16  8:04 ` [PATCH 02/16] refs: rename `init_db` callback to avoid confusion Patrick Steinhardt
2024-05-16 15:00   ` Karthik Nayak
2024-05-16 18:24   ` Junio C Hamano
2024-05-17  7:08     ` Patrick Steinhardt
2024-05-16  8:04 ` [PATCH 03/16] refs: implement releasing ref storages Patrick Steinhardt
2024-05-16 16:39   ` Karthik Nayak
2024-05-16 18:01     ` Junio C Hamano
2024-05-17  7:09       ` Patrick Steinhardt
2024-05-17  7:08     ` Patrick Steinhardt [this message]
2024-05-16  8:04 ` [PATCH 04/16] refs: track ref stores via strmap Patrick Steinhardt
2024-05-16 18:34   ` Junio C Hamano
2024-05-16  8:04 ` [PATCH 05/16] refs: pass repo when retrieving submodule ref store Patrick Steinhardt
2024-05-16 18:44   ` Junio C Hamano
2024-05-17  7:09     ` Patrick Steinhardt
2024-05-16  8:04 ` [PATCH 06/16] refs: refactor `resolve_gitlink_ref()` to accept a repository Patrick Steinhardt
2024-05-16 18:45   ` Junio C Hamano
2024-05-16  8:04 ` [PATCH 07/16] refs: retrieve worktree ref stores via associated repository Patrick Steinhardt
2024-05-16  8:04 ` [PATCH 08/16] refs: convert iteration over replace refs to accept ref store Patrick Steinhardt
2024-05-16  8:04 ` [PATCH 09/16] refs: pass ref store when detecting dangling symrefs Patrick Steinhardt
2024-05-16  8:04 ` [PATCH 10/16] refs: move object peeling into "object.c" Patrick Steinhardt
2024-05-16 20:55   ` Junio C Hamano
2024-05-16  8:05 ` [PATCH 11/16] refs: pass repo when peeling objects Patrick Steinhardt
2024-05-16  8:05 ` [PATCH 12/16] refs: drop `git_default_branch_name()` Patrick Steinhardt
2024-05-16 18:44   ` Karthik Nayak
2024-05-16  8:05 ` [PATCH 13/16] refs: remove `dwim_log()` Patrick Steinhardt
2024-05-16  8:05 ` [PATCH 14/16] refs/files: use correct repository Patrick Steinhardt
2024-05-16  8:05 ` [PATCH 15/16] refs/files: remove references to `the_hash_algo` Patrick Steinhardt
2024-05-16  8:05 ` [PATCH 16/16] refs/packed: " Patrick Steinhardt
2024-05-16 18:57 ` [PATCH 00/16] refs: drop all references to `the_repository` Karthik Nayak
2024-05-17  7:08   ` 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=ZkcCh3OhbPOn0HOF@tanuki \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=karthik.188@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;
as well as URLs for NNTP newsgroup(s).