Thread (61 messages) flat view 61 messages, 6 authors, 2021-09-27

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

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-09-27 12:09:53

On Mon, Aug 16 2021, Jonathan Tan wrote:
quoted hunk ↗ jump to hunk
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/ (local);

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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help