From: Junio C Hamano Date: Fri, 30 Aug 2024 21:27:53 GMT Subject: Re: [PATCH] revision: free commit buffers for skipped commits Message-ID: In-Reply-To: <20240830205331.GA1038751@coredump.intra.peff.net> Jeff King writes: > But since this "--skip" case is an easy one-liner, it's worth fixing in > the meantime. OK. > diff --git a/revision.c b/revision.c > index ac94f8d429..2d7ad2bddf 100644 > --- a/revision.c > +++ b/revision.c > @@ -4407,6 +4407,7 @@ static struct commit *get_revision_internal(struct rev_info *revs) > c = get_revision_1(revs); > if (!c) > break; > + free_commit_buffer(revs->repo->parsed_objects, c); > } Even if we freed the buffer and then later need it, we'd read the buffer again anyway, so this is a safe thing to do. And because commits skipped in this separate loop will _never_ be given to the caller of get_revision(), this it a reasonable optimization, too. Will queue. Thanks.