git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC PATCH 0/3] grep: don't add subrepos to in-memory alternates

From
Matheus Tavares <matheus.bernardino@usp.br>
Date
Sep 18, 2019, 01:56 UTC
Message-ID
<cover.1568771073.git.matheus.bernardino@usp.br>

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(-)
-- 
2.23.0
Next: Matheus Tavares
Message 1 of 11 in “grep: don't add subrepos to in-memory alternates”
  1. 0/3 grep: don't add subrepos to in-memory alternatesMatheus Tavares, Sep 18, 2019
  2. 1/3 diff: use the given repo at diff_populate_filespec()Matheus Tavares, Sep 18, 2019
  3. 2/3 object: allow parse_object_or_die() to handle any repoMatheus Tavares, Sep 18, 2019
  4. 3/3 grep: don't add submodules to the alternates listMatheus Tavares, Sep 18, 2019
  5. Brandon WilliamsSep 21, 2019
  6. Junio C HamanoSep 18, 2019
  7. Matheus Tavares BernardinoSep 19, 2019
  8. Junio C HamanoSep 20, 2019
  9. Matheus Tavares BernardinoSep 21, 2019
  10. Junio C HamanoSep 28, 2019
  11. Matheus Tavares BernardinoSep 28, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.