From: Junio C Hamano <gitster@pobox.com>
To: Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] tree-diff: remove the usage of the_hash_algo global
Date: Fri, 20 Feb 2026 12:21:29 -0800 [thread overview]
Message-ID: <xmqq342vxj1y.fsf@gitster.g> (raw)
In-Reply-To: <20260220175331.1250726-1-shreyanshpaliwalcmsmn@gmail.com> (Shreyansh Paliwal's message of "Fri, 20 Feb 2026 23:21:26 +0530")
Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> writes:
> emit_path() uses the global the_hash_algo even though a local repository is
> already available via struct diff_options *opt.
>
> Replace these uses with opt->repo->hash_algo. With no remaining reliance on
> global states in this file, drop the dependency on 'environment.h' and remove
> '#define USE_THE_REPOSITORY_VARIABLE'.
>
> This follows earlier cleanups to introduce opt->repo in tree-diff.c [1][2].
>
> [1]- https://lore.kernel.org/git/20180921155739.14407-21-pclouds@gmail.com/
> [2]- https://lore.kernel.org/git/20260109213021.2546-2-l.s.r@web.de/
>
> Signed-off-by: Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com>
> ---
> tree-diff.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Nice. Will queue. Thanks.
prev parent reply other threads:[~2026-02-20 20:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 17:51 [PATCH] tree-diff: remove the usage of the_hash_algo global Shreyansh Paliwal
2026-02-20 20:21 ` 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=xmqq342vxj1y.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=shreyanshpaliwalcmsmn@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