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

2014-09-23 Thread Junio C Hamano
Duy Nguyen writes: > On Tue, Sep 23, 2014 at 2:15 AM, Junio C Hamano 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 wo

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

2014-09-22 Thread Duy Nguyen
On Tue, Sep 23, 2014 at 2:15 AM, Junio C Hamano 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/ its

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

2014-09-22 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > +static void queue_directory(const unsigned char *sha1, > + const char *base, int baselen, const char *filename, > + unsigned mode, int stage, struct archiver_context *c) > +{ > + struct directory *d; > + d = xmallocz(sizeof(*d) + ba

[PATCH v2] archive: support filtering paths with glob

2014-09-20 Thread Nguyễn Thái Ngọc Duy
This patch fixes two problems with using :(glob) (or even "*.c" without ":(glob)"). The first one is we forgot to turn on the 'recursive' flag in struct pathspec. Without that, tree_entry_interesting() will not mark potential directories "interesting" so that it can confirm whether those directori