RFC grep: don't add subrepos to in-memory alternates
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest3 patches 7 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | diff: use the given repo at diff_populate_filespec()diff.c | +1 | 0 replies | |
| 2/3 | object: allow parse_object_or_die() to handle any repobuiltin/ builtin/ bundle.c +5 more | +24 | 0 replies | |
| 3/3 | grep: don't add submodules to the alternates listbuiltin/ grep.c | +70 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/3] grep: don't add subrepos to in-memory alternates
Make git-grep --recurse-submodules stop adding subrepos to the in-memory alternates list and, instead, pass a reference to the subrepo struct down to the threads.
This series is based on ew/hashmap (it uses the added container_of macro).
There're some possibly needed changes I'm still unsure about. All feedback will be highly appreciated:
- textconv cache is written to the_repository's object database even for submodules. Should it perhaps be written to submodules' odb instead?
- Considering the following call chain: grep_source_load_driver() > userdiff_find_by_path() > git_check_attr() > collect_some_attrs() > prepare_attr_stack() > bootstrap_attr_stack():
* The last function tries to read the attributes from the .gitattributes and .git/info/attributes files of the_repository. However, for paths inside the submodule, shouldn't it try to read these files from the submodule?
* This function will also call: read_attr() > read_attr_from_index() > read_blob_data_from_index() which might, in turn, call read_object_file(). Shouldn't we pass the subrepo to it so that it can call repo_read_object_file()? (Again, for paths inside the submodule, read_object_file() won't be able to find the object as we won't be adding to alternates anymore.)
Matheus Tavares (3):
diff: use the given repo at diff_populate_filespec()
object: allow parse_object_or_die() to handle any repo
grep: don't add submodules to the alternates list
builtin/grep.c | 82 +++++++++++++++++++++++++++++++++++-------------- builtin/prune.c | 4 +-- bundle.c | 13 +++++--- diff.c | 2 +- grep.c | 26 ++++++++-------- object.c | 5 +-- object.h | 4 ++- pack-bitmap.c | 5 +-- reachable.c | 4 +-- upload-pack.c | 2 +- 10 files changed, 94 insertions(+), 53 deletions(-)
Signature · 1 line
2.23.0