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

Re: [PATCH v2] archive: support filtering paths with glob

From
Duy Nguyen <pclouds@gmail.com>
Date
Sep 22, 2014, 23:04 UTC
Message-ID
<CACsJy8CwwzOuiL1GMcK9OWZSdSqCpLzVJPyNkHocH10_1VmXSA@mail.gmail.com>
In-Reply-To
<xmqq4mvzlb5c.fsf@gitster.dls.corp.google.com>
On Tue, Sep 23, 2014 at 2:15 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> When we have a/b/c and a/d/e to be written, the first round would
> write a/ and then a/b/ with the above, and presumably elsewhere
> somebody will write a/b/c; next time around we do need to write a/d/
> but we wouldn't want to write a/ itself.  How is this code
> preventing the recursion going all the way up every time to avoid
> repeating a/?
>
> Puzzled...

We never traverse 'a' (or any directory) twice and we only push a directory to the stack when we examine it. After a/b and a are written down and we examine 'd', 'a/d' is pushed to the stack. When we hit 'a/d/e', we only have 'a/d' in the stack, not 'a'.

-- 
Duy
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 9 in “git archive and glob pathspecs”
  1. Peter WuSep 2, 2014
  2. Duy NguyenSep 3, 2014
  3. Peter WuSep 13, 2014
  4. archive: support filtering paths with globNguyễn Thái Ngọc Duy, Sep 4, 2014
  5. Peter WuSep 13, 2014
  6. archive: support filtering paths with globNguyễn Thái Ngọc Duy, Sep 21, 2014
  7. Junio C HamanoSep 22, 2014
  8. Duy NguyenSep 22, 2014
  9. Junio C HamanoSep 23, 2014

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.