From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: New =?utf-8?Q?=E2=80=98--list-generations=E2=80=99?= and =?utf-8?Q?=E2=80=98--delete-generations=E2=80=99?= options Date: Sat, 07 Sep 2013 21:34:25 +0200 Message-ID: <87bo444e9q.fsf@gnu.org> References: <87vc2o4qwc.fsf@gnu.org> <87y57kljro.fsf@karetnikov.org> <87hae81uvo.fsf@gnu.org> <87bo4fcbcz.fsf@karetnikov.org> <878uzj6nev.fsf@gnu.org> <877gf1yftq.fsf@karetnikov.org> <87bo4dspl2.fsf@gnu.org> <87a9jxeh05.fsf@gnu.org> <87r4d9r2lv.fsf@gnu.org> <874na4jfp4.fsf_-_@karetnikov.org> <87eh97616m.fsf@gnu.org> <87bo48xdgb.fsf@karetnikov.org> <87hadz9gze.fsf@gnu.org> <87fvtjdl7y.fsf@karetnikov.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIOM3-0005L6-B0 for guix-devel@gnu.org; Sat, 07 Sep 2013 15:39:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VIOLx-0002u0-3E for guix-devel@gnu.org; Sat, 07 Sep 2013 15:39:34 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:42187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIOLw-0002tu-PB for guix-devel@gnu.org; Sat, 07 Sep 2013 15:39:29 -0400 In-Reply-To: <87fvtjdl7y.fsf@karetnikov.org> (Nikita Karetnikov's message of "Fri, 06 Sep 2013 01:14:57 +0400") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Nikita Karetnikov Cc: guix-devel@gnu.org Nikita Karetnikov skribis: >> BTW, what did you think of the idea of using recutils format as the >> output? (Either as the sole output format, or otherwise as a secondary >> format.) > > I like the idea. It=E2=80=99s always better to use a documented format, > especially when it comes with a mode for Emacs. And don=E2=80=99t forget= that > =E2=80=98--search=E2=80=99 already uses recutils. I didn=E2=80=99t say a= nything before because > I haven=E2=80=99t tried to implement this part yet. I=E2=80=99m asking because if we do that, =E2=80=98--list-generations=E2=80= =99 may just as well print out *all* the generation records. Users who want to select only less than one-month old generations can do that with =E2=80=98recsel=E2=80= =99, and we don=E2=80=99t have anything more to do. WDYT? OTOH, for =E2=80=98--delete-generations=E2=80=99 it will still be more conv= enient to support =E2=80=98--delete-generations=E2=80=99. >>> Do you see any problems? Please check everything (especially the >>> =E2=80=98first-month=E2=80=99 and =E2=80=98last-month=E2=80=99 function= s). > >> Better yet: write test cases. :-) > > I have some tests, but you have to modify =E2=80=98int=E2=80=99 and the o= ther related > procedures to use them. So it=E2=80=99s not an option. > > I=E2=80=99m also not sure what=E2=80=99s the best way to test the =E2=80= =98first-month=E2=80=99 and > =E2=80=98last-month=E2=80=99 functions (the validation part). Any ideas? I think you find it difficult to test because the parsing and generation enumeration are intermingled. If parsing is separated as I suggested, with a =E2=80=98string->date-range= =E2=80=99 procedure, then it becomes trivial to write test cases for that. >> The code otherwise looks OK, but disentangling parsing from validation >> will make it even more pleasant IMO. > > I agree. I just haven=E2=80=99t found a way that avoids unnecessary repe= tition. What do you think of the separation I proposed? > Could you share your thoughts on other things that are marked with > =E2=80=9CXXX=E2=80=9D? I don=E2=80=99t have much to say on these at this stage, but I think it=E2= =80=99d be easier to comment on the next version of the patch. :-) Thanks, Ludo=E2=80=99.