unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Vincent Legoll <vincent.legoll@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH] scripts: hash: Add --exclude-.git option.
Date: Tue, 6 Sep 2016 08:48:07 +0200	[thread overview]
Message-ID: <CAEwRq=qRAp7JGce7PVU1gCH6rJ6s9o7h9P7Bb0wA9JhSrB=XoA@mail.gmail.com> (raw)
In-Reply-To: <87pooit4jz.fsf@gnu.org>

On Mon, Sep 5, 2016 at 11:33 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> Hello!
>
> Jan Nieuwenhuizen <janneke@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 <janneke@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

  parent reply	other threads:[~2016-09-06  6:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05  8:43 [PATCH] scripts: hash: Add --exclude-.git option Jan Nieuwenhuizen
2016-09-05  9:20 ` Hartmut Goebel
2016-09-05 10:56   ` Vincent Legoll
2016-09-05 11:36     ` Jan Nieuwenhuizen
2016-09-05 20:20       ` Efraim Flashner
2016-09-05 21:04         ` Jan Nieuwenhuizen
2016-09-05 21:14           ` Leo Famulari
2016-09-05 20:50       ` Leo Famulari
2016-09-05 20:49 ` Danny Milosavljevic
2016-09-05 20:52   ` Leo Famulari
2016-09-05 21:33 ` Ludovic Courtès
2016-09-06  6:36   ` Jan Nieuwenhuizen
2016-09-06 12:26     ` Ludovic Courtès
2016-09-07 10:02     ` Ludovic Courtès
2016-09-06  6:48   ` Vincent Legoll [this message]
2016-09-06 12:24     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEwRq=qRAp7JGce7PVU1gCH6rJ6s9o7h9P7Bb0wA9JhSrB=XoA@mail.gmail.com' \
    --to=vincent.legoll@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).