Subject: [PATCH v2 12/14] services: gitolite-git-configuration: Add receive-fsck-objects field.

From: Tomas Volf <[email-masked]>
Date: Tue, 1 Apr 2025 00:10:18 +0200

* gnu/services/version-control.scm (<gitolite-git-configuration>): Add
receive-fsck-objects field.
(gitolite-git-configuration-compiler): Handle it during configuration file
generation.
* doc/guix.texi (Version Control Services): Document it.

Change-Id: Iceb02f60b8ef26138961aefef4e56ca83df0e19f
---
 doc/guix.texi                    |  3 +++
 gnu/services/version-control.scm | 21 ++++++++++++++-------
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 08a9c44e5b..fec6457c08 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -41103,6 +41103,9 @@ Version Control Services
 If true, set the @code{init.defaultBranch} option to that value.  Common
 values are @code{"master"} and @code{"main"}.
 
+@item @code{receive-fsck-objects} (default: @code{#f})
+If it is set to true, git-receive-pack will check all received objects.
+
 @end table
 @end deftp
 
diff --git a/gnu/services/version-control.scm b/gnu/services/version-control.scm
index 12653b3cea..1e21174ea9 100644
--- a/gnu/services/version-control.scm
+++ b/gnu/services/version-control.scm
@@ -73,6 +73,7 @@ (define-module (gnu services version-control)
             gitolite-git-configuration-name
             gitolite-git-configuration-email
             gitolite-git-configuration-default-branch
+            gitolite-git-configuration-receive-fsck-objects
 
             gitolite-service-type
 
@@ -331,17 +332,19 @@ (define-gexp-compiler (gitolite-rc-file-compiler
 (define-record-type* <gitolite-git-configuration>
   gitolite-git-configuration make-gitolite-git-configuration
   gitolite-git-configuration?
-  (name           gitolite-git-configuration-name
-                  (default "GNU Guix"))
-  (email          gitolite-git-configuration-email
-                  (default "guix@localhost"))
-  (default-branch gitolite-git-configuration-default-branch
-                  (default #f)))
+  (name                 gitolite-git-configuration-name
+                        (default "GNU Guix"))
+  (email                gitolite-git-configuration-email
+                        (default "guix@localhost"))
+  (default-branch       gitolite-git-configuration-default-branch
+                        (default #f))
+  (receive-fsck-objects gitolite-git-configuration-receive-fsck-objects
+                        (default #f)))
 
 (define-gexp-compiler (gitolite-git-configuration-compiler
                        (config <gitolite-git-configuration>) system target)
   (match-record config <gitolite-git-configuration>
-                (name email default-branch)
+                (name email default-branch receive-fsck-objects)
     (apply text-file* "gitconfig"
            `("[user]\n"
              "name  = " ,name  "\n"
@@ -349,6 +352,10 @@ (define-gexp-compiler (gitolite-git-configuration-compiler
              ,@(if default-branch
                    `("[init]\n"
                      "defaultBranch = " ,default-branch "\n")
+                   '())
+             ,@(if receive-fsck-objects
+                   `("[receive]\n"
+                     "fsckObjects = true\n")
                    '())))))
 
 (define-record-type* <gitolite-configuration>
-- 
2.49.0