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
Matheus Tavares Bernardino <matheus.bernardino@usp.br>
Date
Sep 28, 2019, 04:20 UTC
Message-ID
<CAHd-oW6uG1fap-T4UF17bJmjoHAqWCDq9KbY+_8a3cEnnfATxg@mail.gmail.com>
In-Reply-To
<xmqqtv8xksrs.fsf@gitster-ct.c.googlers.com>
On Sat, Sep 28, 2019 at 12:24 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
>
> Matheus Tavares Bernardino <matheus.bernardino@usp.br> writes:
>
> > Right, this would be the best way of doing it. However, I think this
> > is not how it's currently implemented. I if correctly understood the
> > code in this call chain:
> >
> > grep_source_load_driver() >  userdiff_find_by_path() >
> > git_check_attr() > collect_some_attrs() > prepare_attr_stack() >
> > bootstrap_attr_stack()
> >
> > it seems that the whole stack is being rebuild for every path (even
> > for paths descending in the same superproject or submodule).
>
> bootstrap is guarded with "if (*stack) return;" and prepare knows to
> rewind to the common level and push down the new ones, no?

Right, I've somehow missed this guard and the fact that 'check' is static at userdiff_find_by_path() so the stack is persistent. Thanks for pointing this out and sorry for the noise.

Previous: Junio C Hamano
Message 11 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.