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

Re: [Outreachy PATCH v2] range-diff: use diffopt->repo instead of the_repository

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 29, 2026, 16:19 UTC
Message-ID
<xmqqzevw4gze.fsf@gitster.g>
In-Reply-To
<20261029084720.93221-1-okhuomonajayi54@gmail.com>
Okhuomon Ajayi <okhuomonajayi54@gmail.com> writes:
Show 21 quoted lines
> output_pair_header() and patch_diff() receive a diffopt whose repo
> field names the repository to work on, yet they abbreviate object
> names and look up commits in the_repository. get_filespec(), called
> from patch_diff(), also uses the_hash_algo, which is the hash
> algorithm of the_repository. If a caller set up diffopt for another
> repository, these functions would still read from the global one.
>
> Use diffopt->repo in output_pair_header(), and add a hash algorithm
> parameter to get_filespec() so that patch_diff() can pass
> diffopt->repo->hash_algo.
>
> Keep USE_THE_REPOSITORY_VARIABLE because read_patches(), output() and
> is_range_diff_range() still use the_repository.
>
> Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
> ---
> Changes since v1:
> - Reworded the commit message as suggested by Pablo. No code was
>   changed.
>
> Thanks, Pablo, for the review.

OK, well written. Except for the "In-reply-to:" header that should point at your earlier iteration of the patch (not a review message your earlier iteration received), everything I see here looks good.

Will queue.
Previous: Okhuomon Ajayi
Message 4 of 4 in “range-diff: use the repository from the diff options”
  1. range-diff: use the repository from the diff optionsOkhuomon Ajayi, Oct 28, 2026
  2. Pablo SabaterOct 29, 2026
  3. range-diff: use diffopt->repo instead of the_repositoryOkhuomon Ajayi, Oct 29, 2026
  4. Junio C HamanoOct 29, 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.