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