[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] scripts: hash: Add --exclude-.git option.
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] scripts: hash: Add --exclude-.git option. |
Date: |
Mon, 05 Sep 2016 23:33:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Hello!
Jan Nieuwenhuizen <address@hidden> 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 <address@hidden>
> 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
>
> address@hidden --exclude-.git
> address@hidden -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’.
Re: [PATCH] scripts: hash: Add --exclude-.git option., Danny Milosavljevic, 2016/09/05
Re: [PATCH] scripts: hash: Add --exclude-.git option.,
Ludovic Courtès <=