guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] scripts: hash: Add --exclude-.git option.


From: Vincent Legoll
Subject: Re: [PATCH] scripts: hash: Add --exclude-.git option.
Date: Tue, 6 Sep 2016 08:48:07 +0200

On Mon, Sep 5, 2016 at 11:33 PM, Ludovic Courtès <address@hidden> wrote:
> 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" …)))

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]