On Mon, Sep 5, 2016 at 11:33 PM, Ludovic Courtès <l...@gnu.org> wrote: > Hello! > > Jan Nieuwenhuizen <jann...@gnu.org> 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 <jann...@gnu.org> >> 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 option. >> (%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= 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" …)))
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 guix) in a distant past... WDYT, overdesigned ? I also like the generic proposal from Efraim (--exclude/-x) -- Vincent Legoll