All of lore.kernel.org
 help / color / mirror / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>, Peter Wu <peter@lekensteyn.nl>
Subject: Re: [PATCH v2] archive: support filtering paths with glob
Date: Tue, 23 Sep 2014 06:04:31 +0700	[thread overview]
Message-ID: <CACsJy8CwwzOuiL1GMcK9OWZSdSqCpLzVJPyNkHocH10_1VmXSA@mail.gmail.com> (raw)
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:
> 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

  reply	other threads:[~2014-09-22 23:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 22:17 git archive and glob pathspecs Peter Wu
2014-09-03  6:21 ` Duy Nguyen
2014-09-13 10:36   ` Peter Wu
2014-09-04 13:37 ` [PATCH] archive: support filtering paths with glob Nguyễn Thái Ngọc Duy
2014-09-13 10:52   ` Peter Wu
2014-09-21  3:55     ` [PATCH v2] " Nguyễn Thái Ngọc Duy
2014-09-22 19:15       ` Junio C Hamano
2014-09-22 23:04         ` Duy Nguyen [this message]
2014-09-23 16:57           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACsJy8CwwzOuiL1GMcK9OWZSdSqCpLzVJPyNkHocH10_1VmXSA@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peter@lekensteyn.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.