unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Nicolas Odermatt-Lemay <nodermattlemay@gmail.com>
Cc: 71217@debbugs.gnu.org, Giacomo Leidi <goodoldpaul@autistici.org>
Subject: [bug#71217] gnu: home: dotfiles: Files not excluded when they should
Date: Wed, 20 Nov 2024 23:33:52 +0100	[thread overview]
Message-ID: <87zflttu0f.fsf@gnu.org> (raw)
In-Reply-To: <CAC-BrWpcu=+Lb_=0VUSWP4w92ohTH30zY1YA6K=-GiegfpVB7A@mail.gmail.com> (Nicolas Odermatt-Lemay's message of "Sun, 26 May 2024 22:13:26 -0400")

Hi,

(Cc: Giacomo, who authored this service.)

Nicolas Odermatt-Lemay <nodermattlemay@gmail.com> skribis:

> While attempting to setup home-dotfiles-service, I noticed that some files
> were being symlinked even though they were in the variable
> `%home-dotfiles-excluded', such as all the files of the .git directory.

Oh.

> This patch seems to fix the problem :
>
> diff --git a/gnu/home/services/dotfiles.scm b/gnu/home/services/dotfiles.scm
> index 823bdb03fb..38f7ff83d0 100644
> --- a/gnu/home/services/dotfiles.scm
> +++ b/gnu/home/services/dotfiles.scm
> @@ -45,7 +45,7 @@ (define-module (gnu home services dotfiles)
>  (define %home-dotfiles-excluded
>    '(".*~"
>      ".*\\.swp"
> -    "\\.git"
> +    "\\.git/.*"
>      "\\.gitignore"))
>
>  (define %home-dotfiles-layouts
> @@ -138,8 +138,7 @@ (define* (directory-contents directory #:key (packages
> #f))
>      (define (filter-files directory)
>        (find-files directory
>                    (lambda (file stat)
> -                    (not (regexp-exec exclusion-rx
> -                                      (basename file))))))
> +                    (not (regexp-exec exclusion-rx file)))))

That would change the semantics of ‘exclusion-rx’ though.

Maybe instead we should change from ‘file-files’ to ‘file-system-fold’
and not enter directories that match one of the exclusion patterns?

Ludo’.




           reply	other threads:[~2024-11-20 22:37 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CAC-BrWpcu=+Lb_=0VUSWP4w92ohTH30zY1YA6K=-GiegfpVB7A@mail.gmail.com>]

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=87zflttu0f.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=71217@debbugs.gnu.org \
    --cc=goodoldpaul@autistici.org \
    --cc=nodermattlemay@gmail.com \
    /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).