From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vincent Legoll Subject: Re: [PATCH] scripts: hash: Add --exclude-.git option. Date: Tue, 6 Sep 2016 08:48:07 +0200 Message-ID: References: <87zinmybwv.fsf@gnu.org> <87pooit4jz.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]:53495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhAB3-0005B6-1X for guix-devel@gnu.org; Tue, 06 Sep 2016 02:48:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhAB2-0007FU-4c for guix-devel@gnu.org; Tue, 06 Sep 2016 02:48:13 -0400 In-Reply-To: <87pooit4jz.fsf@gnu.org> 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: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Cc: guix-devel On Mon, Sep 5, 2016 at 11:33 PM, Ludovic Court=C3=A8s wrote: > 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 op= tion. >> (%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 >> >> +@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))) Could this not come from each vcs package ? i.e. each vcs package defines a vcs-dir which get put together in a global %vcs-dirs variable that is used here ? I ask because that's how I did it in meld (which I'll try to package for gu= ix) in a distant past... WDYT, overdesigned ? I also like the generic proposal from Efraim (--exclude/-x) --=20 Vincent Legoll