Hello,
Jodi Jodingtonstinski <[email protected]> skribis:
> Ideally `guix pull` would ignore this setting (and possibly all user git
> settings?) if it does not work with it.
> This causes errors such as:
> `gnu/packages/music.scm:2732:1: invalid character in escape sequence:
> #\return`
> and can be resolved by disabling autocrlf and deleting
> `~/.cache/guix/checkouts` (thanks Rutherther)
I agree that ‘guix pull’ should ignore such settings; even if errors
like the one above did not occur, you’d get a checkout that’s different
at the binary level, and so no substitutes etc.
I think the patch below should do that, at least for new checkouts.
It would be great if you could try it and check that it works for you.
You can do that by:
rm -rf ~/.cache/guix/checkouts
git config --global core.autocrlf true
./pre-inst-env guix download --git \
https://git.savannah.gnu.org/git/shepherd.git
Although I’m not sure ‘autocrlf’ would fire on this repo (why does it
fire in the first place on the Git repo⁈).
Thanks,
Ludo’.
diff --git a/guix/git.scm b/guix/git.scm
index 4164531c0b..0a7bcea9bb 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017, 2020 Mathieu Othacehe <[email protected]>
-;;; Copyright © 2018-2024 Ludovic Courtès <[email protected]>
+;;; Copyright © 2018-2025 Ludovic Courtès <[email protected]>
;;; Copyright © 2021 Kyle Meyer <[email protected]>
;;; Copyright © 2021 Marius Bakke <[email protected]>
;;; Copyright © 2022 Maxime Devos <[email protected]>
@@ -236,10 +236,17 @@ (define* (clone* url directory #:key (verify-certificate? #t))
(lambda ()
(mkdir-p directory)
- (clone url directory
- (make-clone-options
- #:fetch-options (make-default-fetch-options
- #:verify-certificate? verify-certificate?))))
+ (let* ((repository
+ (clone url directory
+ (make-clone-options
+ #:fetch-options (make-default-fetch-options
+ #:verify-certificate?
+ verify-certificate?))))
+ (config (repository-config repository)))
+ ;; Prevent modification of the raw data.
+ (set-config-string config "core.autocrlf" "input")
+
+ repository))
(lambda _
(false-if-exception (rmdir directory)))))