[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/07: git: Do not add '.git' to the store.
From: |
Ludovic Courtès |
Subject: |
04/07: git: Do not add '.git' to the store. |
Date: |
Tue, 21 Nov 2017 17:13:52 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit fe9b3ec3ee208c5bac7844f3d0fecce2c6b1297d
Author: Ludovic Courtès <address@hidden>
Date: Tue Nov 21 15:25:57 2017 +0100
git: Do not add '.git' to the store.
This makes 'latest-repository-commit' significantly more efficient and
reduces disk usage in the store.
* guix/git.scm (copy-to-store)[dot-git?]: New procedure.
Pass it as the #:select? argument to 'add-to-store'.
---
guix/git.scm | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/guix/git.scm b/guix/git.scm
index 7a83b56..fc41e2a 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -80,11 +80,17 @@ of SHA1 string."
"-" (string-take sha1 7)))
(define* (copy-to-store store cache-directory #:key url repository)
- "Copy items in cache-directory to store. URL and REPOSITORY are used
-to forge store directory name."
+ "Copy CACHE-DIRECTORY recursively to STORE. URL and REPOSITORY are used to
+create the store directory name."
+ (define (dot-git? file stat)
+ (and (string=? (basename file) ".git")
+ (eq? 'directory (stat:type stat))))
+
(let* ((commit (repository->head-sha1 repository))
(name (url+commit->name url commit)))
- (values (add-to-store store name #t "sha256" cache-directory) commit)))
+ (values (add-to-store store name #t "sha256" cache-directory
+ #:select? (negate dot-git?))
+ commit)))
(define (switch-to-ref repository ref)
"Switch to REPOSITORY's branch, commit or tag specified by REF."
- branch master updated (5c1f38b -> 11a54b3), Ludovic Courtès, 2017/11/21
- 01/07: union: Parametrize the symlink procedure ., Ludovic Courtès, 2017/11/21
- 02/07: gexp: 'directory-union' has a #:quiet? parameter., Ludovic Courtès, 2017/11/21
- 04/07: git: Do not add '.git' to the store.,
Ludovic Courtès <=
- 03/07: pull: Trim import list., Ludovic Courtès, 2017/11/21
- 06/07: hydra: 'evaluate' passes an alist to the entry point., Ludovic Courtès, 2017/11/21
- 07/07: hydra: Add jobs for the modular Guix., Ludovic Courtès, 2017/11/21
- 05/07: Add (guix self) and use it when pulling., Ludovic Courtès, 2017/11/21