Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
Cc: git@vger.kernel.org,  christian.couder@gmail.com,
	usmanakinyemi202@gmail.com,  siddharthasthana31@gmail.com,
	kaartic.sivaraam@gmail.com
Subject: Re: [Outreachy PATCH] merge-blobs: stop using the_repository
Date: Fri, 06 Nov 2026 18:30:15 -0800	[thread overview]
Message-ID: <xmqqy0b59xvs.fsf@gitster.g> (raw)
In-Reply-To: <20261017105244.90295-1-okhuomonajayi54@gmail.com> (Okhuomon Ajayi's message of "Sat, 17 Oct 2026 11:52:43 +0100")

Okhuomon Ajayi <okhuomonajayi54@gmail.com> writes:

> merge_blobs() already has the repository through istate.
> Pass it to fill_mmfile_blob() and use it when reading objects.
>
> Remove the USE_THE_REPOSITORY_VARIABLE definition and
> include the headers needed for the structure definitions.
>
> Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
> ---
>  merge-blobs.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)

Even though I would have introduced a single repo variable instead
of dereferencing istate->repo number of times inside merge_blobs()
function, that probably falls into personal preference category, so
insignificant a difference that once code is written in one way, it
is not worth going in and rewrite into the other way.

Let's mark the topic as ready for 'next'.  Thanks.

> -		return odb_read_object(the_repository->objects, &our->object.oid,
> +		return odb_read_object(istate->repo->objects, &our->object.oid,
> -	if (fill_mmfile_blob(&f1, our) < 0)
> +	if (fill_mmfile_blob(istate->repo, &f1, our) < 0)
>  		goto out_no_mmfile;
> -	if (fill_mmfile_blob(&f2, their) < 0)
> +	if (fill_mmfile_blob(istate->repo, &f2, their) < 0)
> -		if (fill_mmfile_blob(&common, base) < 0)
> +		if (fill_mmfile_blob(istate->repo, &common, base) < 0)

      parent reply	other threads:[~2026-11-07  2:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17 10:52 [Outreachy PATCH] merge-blobs: stop using the_repository Okhuomon Ajayi
2026-10-20 16:53 ` Usman Akinyemi
2026-10-20 21:41   ` Okhuomon Ajayi
2026-10-20 21:54   ` Junio C Hamano
2026-10-20 22:16     ` Usman Akinyemi
2026-11-07  2:30 ` 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=xmqqy0b59xvs.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kaartic.sivaraam@gmail.com \
    --cc=okhuomonajayi54@gmail.com \
    --cc=siddharthasthana31@gmail.com \
    --cc=usmanakinyemi202@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