Re: [PATCH v3 6/8] grep: add repository to OID grep sources
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Sep 27, 2021, 12:08 UTC
- Message-ID
- <878rzi1ape.fsf@evledraar.gmail.com>
- In-Reply-To
- <f362fc278cc2d0291c24097a75f8cfdfe88c27d6.1629148153.git.jonathantanmy@google.com>
On Mon, Aug 16 2021, Jonathan Tan wrote:
Show 26 quoted lines
> 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/CAHd-oW5iEQarYVxEXoTG-ua2zdoybTrSjCBKtO0YT292fm0NQQ@mail.gmail.com/
> + */
> struct repository *repo;
> +I ran into this comment and read the linked E-Mail, and then the downthread https://lore.kernel.org/git/CAHd-oW6uG1fap-T4UF17bJmjoHAqWCDq9KbY+_8a3cEnnfATxg@mail.gmail.com/;
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?