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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 20, 2019, 16:26 UTC
Message-ID
<xmqqh857vsqz.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAHd-oW4u+iPFMvSGNvSJxfPLE34dQQ3x5_aQ-Y4Pd99FXR1p7Q@mail.gmail.com>
Matheus Tavares Bernardino <matheus.bernardino@usp.br> writes:
Show 5 quoted lines
> Hmm, I may have gotten a little confused here. Are you talking
> about the attributes stack (which contains .gitattributes and
> info/attributes)?  If so, isn't this stack already rebuild for
> every path? I mean, by the previous call chain it seems to me that
> at least these two files are reread for every path.

Yes, but for the switch that happens when coming out of a normal directory and then descending into another normal directory is just to pop the entries from the directory hierarchy we are getting out of, and then pushing the entries from the new directory hierarchy. We would not be discarding and rereading $GIT_DIR/info/ or the .gitattribute file from the top-level of the working tree.

Descending into a submodule is fundamentally and completely different. None of the attributes defined in the superproject should affect the paths in the submodule, as it is a totally separate project, oblivious to the existence of enclosing the superproject.

Every time we look up attributes for a path in a project (either the superproject or a submodule) that is different from the one we did a look-up the last time, we'd not just need to pop a handful and push a handful, but need to rebuild the stack completely from scratch, no?

Previous: Matheus Tavares BernardinoNext: Matheus Tavares Bernardino
Message 8 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.