Re: [PATCH v5 4/6] dir_iterator: add tests for dir_iterator API

2017-04-01 Thread Junio C Hamano
Jeff King writes: > I think we actually prefer just: > > >dir/b > > in our tests. The advantages over touch are: > > 1. It is clear that the output will be empty afterwards (whereas with > touch, it might just update the timestamp on an existing file). > > 2. It's faster, since it does

Re: [PATCH v5 4/6] dir_iterator: add tests for dir_iterator API

2017-04-01 Thread Jeff King
On Thu, Mar 30, 2017 at 03:25:43PM -0300, Daniel Ferreira (theiostream) wrote: > On Thu, Mar 30, 2017 at 4:46 AM, Michael Haggerty > wrote: > > Is there a special reason to write the date to the file as opposed to, say > > > > touch dir/b > > > > ? (Some people use `: >dir/b` for this purpos

Re: [PATCH v5 4/6] dir_iterator: add tests for dir_iterator API

2017-03-30 Thread Daniel Ferreira (theiostream)
On Thu, Mar 30, 2017 at 5:05 AM, Michael Haggerty wrote: > Oh I forgot to mention, in the Git project we don't allow declarations > to be mixed with code. Apparently there's some ancient compiler > somewhere that doesn't allow it. Declarations always have to be > together, at the top of a block. (

Re: [PATCH v5 4/6] dir_iterator: add tests for dir_iterator API

2017-03-30 Thread Daniel Ferreira (theiostream)
On Thu, Mar 30, 2017 at 4:46 AM, Michael Haggerty wrote: > Is there a special reason to write the date to the file as opposed to, say > > touch dir/b > > ? (Some people use `: >dir/b` for this purpose, though I've never found > out why.) If you write the date to the file, the reader will be >

Re: [PATCH v5 4/6] dir_iterator: add tests for dir_iterator API

2017-03-30 Thread Michael Haggerty
On 03/30/2017 05:32 AM, Daniel Ferreira wrote: > Create t/helper/test-dir-iterator.c, which prints relevant information > about a directory tree iterated over with dir_iterator. > > Create t/t0065-dir-iterator.sh, which tests that dir_iterator does > iterate through a whole directory tree and that

Re: [PATCH v5 4/6] dir_iterator: add tests for dir_iterator API

2017-03-30 Thread Michael Haggerty
On 03/30/2017 05:32 AM, Daniel Ferreira wrote: > Create t/helper/test-dir-iterator.c, which prints relevant information > about a directory tree iterated over with dir_iterator. > > Create t/t0065-dir-iterator.sh, which tests that dir_iterator does > iterate through a whole directory tree and that

Re: [PATCH v5 4/6] dir_iterator: add tests for dir_iterator API

2017-03-30 Thread Michael Haggerty
On 03/30/2017 05:32 AM, Daniel Ferreira wrote: > Create t/helper/test-dir-iterator.c, which prints relevant information > about a directory tree iterated over with dir_iterator. > > Create t/t0065-dir-iterator.sh, which tests that dir_iterator does > iterate through a whole directory tree and that

[PATCH v5 4/6] dir_iterator: add tests for dir_iterator API

2017-03-29 Thread Daniel Ferreira
Create t/helper/test-dir-iterator.c, which prints relevant information about a directory tree iterated over with dir_iterator. Create t/t0065-dir-iterator.sh, which tests that dir_iterator does iterate through a whole directory tree and that post-order directory iteration is correctly implemented.