Subject: Re: [PATCH v3 6/8] grep: add repository to OID grep sources

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Mon, 27 Sep 2021 14:08:20 +0200

On Mon, Aug 16 2021, Jonathan Tan wrote:

> Record the repository whenever an OID grep source is created, and teach
> the worker threads to explicitly provide the repository when accessing
> objects.
> [...]
> diff --git a/grep.h b/grep.h
> index 480b3f5bba..128007db65 100644
> --- a/grep.h
> +++ b/grep.h
> @@ -120,7 +120,20 @@ struct grep_opt {
>  	struct grep_pat *header_list;
>  	struct grep_pat **header_tail;
>  	struct grep_expr *pattern_expression;
> +
> +	/*
> +	 * NEEDSWORK: See if we can remove this field, because the repository
> +	 * should probably be per-source. That is, grep.c functions using this
> +	 * field should probably start using "repo" in "struct grep_source"
> +	 * instead.
> +	 *
> +	 * This is potentially the cause of at least one bug - "git grep"
> +	 * ignoring the textconv attributes from submodules. See [1] for more
> +	 * information.
> +	 * [1] https://lore.kernel.org/git/[email-masked]/
> +	 */
>  	struct repository *repo;
> +

I ran into this comment and read the linked E-Mail, and then the
downthread
https://lore.kernel.org/git/[email-masked]/;

Given Matheus's "I've somehow missed this guard and the..." there I'm
not quite sure what/if we should be doing here & what this comment is
recommending? I.e. do we still need to adjust the call chains as noted
in the E-Mail the comment links to, or not?