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" …))) (else #f))) … 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’.