Re: [PATCH v4 2/5] dir_iterator: iterate over dir after its contents

2017-04-05 Thread Duy Nguyen
On Sun, Apr 2, 2017 at 11:25 AM, Daniel Ferreira (theiostream) wrote: > Why exactly would it not be applicable to read_directory_recursively()? Because that function is a beast (and probably should have "beast" in the function name). The function is supposed to read

Re: [PATCH v4 2/5] dir_iterator: iterate over dir after its contents

2017-04-01 Thread Daniel Ferreira (theiostream)
Why exactly would it not be applicable to read_directory_recursively()? On Thu, Mar 30, 2017 at 8:08 AM, Duy Nguyen wrote: > On Thu, Mar 30, 2017 at 1:39 PM, Michael Haggerty > wrote: >> * DIR_ITERATOR_RECURSE -- recurse into subdirectories >> >> would

Re: [PATCH v4 2/5] dir_iterator: iterate over dir after its contents

2017-03-30 Thread Junio C Hamano
Michael Haggerty writes: > I don't think any of this needs to be implemented now, but maybe keep it > in mind if/when `dir_iterator` gets more users. OK. One thing that was missing in your list was the opposite of "do not show directories", i.e. "show only directories".

Re: [PATCH v4 2/5] dir_iterator: iterate over dir after its contents

2017-03-30 Thread Duy Nguyen
On Thu, Mar 30, 2017 at 1:39 PM, Michael Haggerty wrote: > * DIR_ITERATOR_RECURSE -- recurse into subdirectories > > would make the set of possible options complete. If this option is not > set, then the iteration would be over the entries in a single directory > without

Re: [PATCH v4 2/5] dir_iterator: iterate over dir after its contents

2017-03-30 Thread Michael Haggerty
On 03/30/2017 08:08 AM, Junio C Hamano wrote: > Michael Haggerty writes: > >> I think IN_ORDER really only applies to *binary* trees, not arbitrary >> trees like a filesystem. > > How true. Even if we were giving a sorted output (and dir-iterator > doesn't and there is no

Re: [PATCH v4 2/5] dir_iterator: iterate over dir after its contents

2017-03-30 Thread Junio C Hamano
Michael Haggerty writes: > I think IN_ORDER really only applies to *binary* trees, not arbitrary > trees like a filesystem. How true. Even if we were giving a sorted output (and dir-iterator doesn't and there is no need for it to), dir/ should come before any of its

Re: [PATCH v4 2/5] dir_iterator: iterate over dir after its contents

2017-03-29 Thread Michael Haggerty
On 03/29/2017 06:46 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> I also realize that I made a goof in my comments about v3 of this patch >> series. Your new option is not choosing between "depth-first" and >> "breadth-first". Both types of iteration are

Re: [PATCH v4 2/5] dir_iterator: iterate over dir after its contents

2017-03-29 Thread Junio C Hamano
Michael Haggerty writes: > I also realize that I made a goof in my comments about v3 of this patch > series. Your new option is not choosing between "depth-first" and > "breadth-first". Both types of iteration are depth-first. Really it is > choosing between pre-order and

Re: [PATCH v4 2/5] dir_iterator: iterate over dir after its contents

2017-03-29 Thread Michael Haggerty
On 03/29/2017 11:56 AM, Michael Haggerty wrote: > On 03/29/2017 02:32 AM, Daniel Ferreira wrote: >> [...] > [...] > The disagreement is not a surprise, because there isn't a corresponding > coding error in the code below that returns the directory itself in a > post-order iteration. The net result

Re: [PATCH v4 2/5] dir_iterator: iterate over dir after its contents

2017-03-29 Thread Michael Haggerty
On 03/29/2017 02:32 AM, Daniel Ferreira wrote: > Create an option for the dir_iterator API to iterate over subdirectories > only after having iterated through their contents. This feature was > predicted, although not implemented by 0fe5043 ("dir_iterator: new API > for iterating over a directory