From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] scripts: hash: Add --exclude-.git option. Date: Mon, 05 Sep 2016 23:33:36 +0200 Message-ID: <87pooit4jz.fsf@gnu.org> References: <87zinmybwv.fsf@gnu.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]:56131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh1We-0003gf-HR for guix-devel@gnu.org; Mon, 05 Sep 2016 17:33:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bh1Wa-0005oU-Gk for guix-devel@gnu.org; Mon, 05 Sep 2016 17:33:56 -0400 In-Reply-To: <87zinmybwv.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Mon, 05 Sep 2016 10:43:28 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." 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" To: Jan Nieuwenhuizen Cc: guix-devel@gnu.org Hello! Jan Nieuwenhuizen skribis: > Added an -g/--exclude-.git option for guix hash. It is very specific: > it skips toplevel .git directory. WDYT? Good idea! > From 86a580840f21f858b757cb7f421b0ba1c169e09d Mon Sep 17 00:00:00 2001 > From: Jan Nieuwenhuizen > Date: Mon, 5 Sep 2016 10:27:19 +0200 > Subject: [PATCH] scripts: hash: Add --exclude-.git option. > > * guix/scripts/hash.scm (show-help): Add help text for --exclude-.git opt= ion. > (%options): Add --exclude-.git option. > (guix-hash): Handle exclude-.git option. > * doc/guix.texi ("invoking guix hash"): Update doc. ^ Capital I. :-) > * tests/guix-hash.sh: Add test. > @table @code >=20=20 > +@item --exclude-.git > +@itemx -g What about --exclude-vcs/-x? Tar uses that name, although with slightly different semantics (info "(tar) exclude"). > + (select? (if (assq-ref opts 'exclude-.git) > + (lambda (f s) (not (string=3D f "./.git"))) Rather make the lambda a top-level procedure, like: (define (vcs-file? file stat) (case (stat:type stat) ((directory) (member (basename file) '(".git" ".svn" "CVS" =E2=80=A6))) (else #f))) =E2=80=A6 and then: (if (assq-ref opts 'exclude-vcs?) (negate vcs-file?) (const #t)) Could you send an updated patch? Thank you for making our lives easier! :-) Ludo=E2=80=99.