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