git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] tree-diff: remove the usage of the_hash_algo global

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 20, 2026, 20:21 UTC
Message-ID
<xmqq342vxj1y.fsf@gitster.g>
In-Reply-To
<20260220175331.1250726-1-shreyanshpaliwalcmsmn@gmail.com>
Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> writes:
Show 16 quoted lines
> 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.
Previous: Shreyansh Paliwal
Message 2 of 2 in “tree-diff: remove the usage of the_hash_algo global”
  1. tree-diff: remove the usage of the_hash_algo globalShreyansh Paliwal, Feb 20, 2026
  2. Junio C HamanoFeb 20, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.