git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] csum-file: introduce discard_hashfile()
Date: Fri, 26 Jul 2024 07:41:14 -0700	[thread overview]
Message-ID: <xmqqplr0z051.fsf@gitster.g> (raw)
In-Reply-To: <20240726044216.GA642208@coredump.intra.peff.net> (Jeff King's message of "Fri, 26 Jul 2024 00:42:16 -0400")

Jeff King <peff@peff.net> writes:

> There's other repeated cleanup happening here, like free(ieot) and
> strbuf_release(), which made wonder if we could bump it down to the
> cleanup label at the end of the function to simplify things. But
> probably not, as we are often doing that cleanup even in the non-error
> case. And of course the "sb" strbuf is local to a lot of blocks.

These localized and independent strbuf instances were indeed what
discouraged me from moving other clean-up to a central place.

> So even if we did want to do it, I think it would come as a separate
> patch. But mostly I wondered whether the label should be a more generic
> "cleanup" than "discard_hashfile". We could probably worry about that
> later, though, if that separate patch ever materializes.

Yup, I wobbled between a more generic "cleanup" and "hashfile is the
only thing that needs special clean-up right now", and it does show,
as you noticed, how the error code paths after calling finalize
looks like.

I think I'll rename the label to "cleaup".

Thanks.

      parent reply	other threads:[~2024-07-26 14:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-25 23:07 [PATCH] csum-file: introduce discard_hashfile() Junio C Hamano
2024-07-26  4:42 ` Jeff King
2024-07-26 12:05   ` Patrick Steinhardt
2024-07-26 15:36     ` Junio C Hamano
2024-07-26 14:41   ` Junio C Hamano [this message]

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=xmqqplr0z051.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).