Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/grep.h
diff options
context:
space:
mode:
authorMatheus Tavares <matheus.bernardino@usp.br>2021-09-29 15:24:25 +0300
committerJunio C Hamano <gitster@pobox.com>2021-09-29 23:19:38 +0300
commit45bde58ef8f521e7deb730ffe90040b58d11af64 (patch)
treea4f039975ef49bcf08fefc5c802d89b92d9add2a /grep.h
parentcefe983a320c03d7843ac78e73bd513a27806845 (diff)
grep: demonstrate bug with textconv attributes and submodules
In some circumstances, "git grep --textconv --recurse-submodules" ignores the textconv attributes from the submodules and erroneously applies the attributes defined in the superproject on the submodules' files. The textconv cache is also saved on the superproject, even for submodule objects. A fix for these problems will probably require at least three changes: - Some textconv and attributes functions (as well as their callees) will have to be adjusted to work with arbitrary repositories. Note that "fill_textconv()", for example, already receives a "struct repository" but it writes the textconv cache using "write_loose_object()", which implicitly works on "the_repository". - grep.c functions will have to call textconv/userdiff routines passing the "repo" field from "struct grep_source" instead of the one from "struct grep_opt". The latter always points to "the_repository" on "git grep" executions (see its initialization in builtin/grep.c), but the former points to the correct repository that each source (an object, file, or buffer) comes from. - "userdiff_find_by_path()" might need to use a different attributes stack for each repository it works on or reset its internal static stack when the repository is changed throughout the calls. For now, let's add some tests to demonstrate these problems, and also update a NEEDSWORK comment in grep.h that mentions this bug to reference the added tests. Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.h')
-rw-r--r--grep.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/grep.h b/grep.h
index 128007db65..3b63bd0253 100644
--- a/grep.h
+++ b/grep.h
@@ -128,9 +128,9 @@ struct grep_opt {
* 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/
+ * using the textconv attributes from the superproject on the
+ * submodules. See the failing "git grep --textconv" tests in
+ * t7814-grep-recurse-submodules.sh for more information.
*/
struct repository *repo;