Hi Okhuomon,
On Mon, Oct 26, 2026 at 12:13 PM Okhuomon Ajayi
<okhu…@gmail.com> wrote:
>
> show_combined_header() and show_patch_diff() already have the
> repository through opt->repo, but still used the_repository for
> the hash algorithm, abbreviating object names and resolving
> gitlinks. Use opt->repo instead.
>
> The file still needs USE_THE_REPOSITORY_VARIABLE for
> DEFAULT_ABBREV, which refers to the global default_abbrev.
Sorry, this patch might have fallen into the cracks.
> @@ -1068,7 +1069,8 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
> &result_size, NULL, NULL);
> } else if (textconv) {
> struct diff_filespec *df = alloc_filespec(elem->path);
> - fill_filespec(df, null_oid(the_hash_algo), 0, st.st_mode);
> + fill_filespec(df, null_oid(opt->repo->hash_algo),
> + 0, st.st_mode);
> result_size = fill_textconv(opt->repo, textconv, df, &result);
> free_filespec(df);
> } else if (0 <= (fd = open(elem->path, O_RDONLY))) {
Below this there is:
} else if (0 <= (fd = open(elem->path, O_RDONLY))) {
size_t len = xsize_t(st.st_size);
ssize_t done;
int is_file, i;
elem->mode = canon_mode(st.st_mode);
/* if symlinks don't work, assume symlink if all parents
* are symlinks
*/
is_file = repo_has_symlinks(rev->repo);
So `rev->repo` seems to already be used in one of these functions.
It would be more consistent to use either `rev->repo` or `opt->repo`
everywhere in these functions rather than mixing both.
If there is a reason (like consistency with other functions in this
file) to use one over the other, the commit message might want to
explain it.
Thanks.