From 1a73454e551d87ccd4cbaec162cdd659dcc9a9e1 Mon Sep 17 00:00:00 2001 From: Giacomo Leidi Date: Tue, 3 Mar 2026 23:25:54 +0100 Subject: [PATCH] gnu: home: dotfiles: Fix inclusion of directories having .git in their name. * gnu/home/services/dotfiles.scm (%home-dotfiles-excluded): Replace .git/.* with /.git/.* . * doc/guix.texi: Document it. Fixes https://codeberg.org/guix/guix/issues/6808 Change-Id: Ib6c824bb4bf5a5b3d6939807667c7961ce0cf6d2 --- doc/guix.texi | 2 +- gnu/home/services/dotfiles.scm | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index d7f4c41d57..12e9d3465a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -51409,7 +51409,7 @@ the @code{home-dotfiles-service-type} will only provision dotfiles from this subset of applications. This field will be ignored if @code{layout} is set to @code{'plain}. -@item @code{excluded} (default: @code{'(".*~" ".*\\.swp" "\\.git/.*" "\\.gitignore")}) (type: list-of-strings) +@item @code{excluded} (default: @code{'(".*~" ".*\\.swp" "/\\.git/.*" "\\.gitignore")}) (type: list-of-strings) The list of file patterns @code{home-dotfiles-service-type} will exclude while visiting each one of the @code{directories}. diff --git a/gnu/home/services/dotfiles.scm b/gnu/home/services/dotfiles.scm index 1860009275..692b96f487 100644 --- a/gnu/home/services/dotfiles.scm +++ b/gnu/home/services/dotfiles.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2024 Ludovic Courtès -;;; Copyright © 2024 Giacomo Leidi +;;; Copyright © 2024, 2026 Giacomo Leidi ;;; ;;; This file is part of GNU Guix. ;;; @@ -45,7 +45,9 @@ (define %home-dotfiles-excluded '(".*~" ".*\\.swp" - "\\.git/.*" + ;; This first / is safe until regexp-exec in directory-contents + ;; is passed an absolute file name. + "/\\.git/.*" "\\.gitignore")) (define %home-dotfiles-layouts