Subject: [bug#77186] [PATCH 13/13] services: gitolite-git-configuration: Add extra-content field.

From: Tomas Volf <[email-masked]>
Date: Sat, 22 Mar 2025 18:00:33 +0100

* gnu/services/version-control.scm (<gitolite-git-configuration>): Add
extra-content 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 | 10 +++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index f8fa1ab3bd..311564c1d2 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -41192,6 +41192,9 @@ Version Control Services
 @item @code{receive-fsck-objects} (default: @code{#f})
 If it is set to true, git-receive-pack will check all received objects.
 
+@item @code{extra-content} (default: @code{""})
+Extra content to add verbatim into the git configuration file.
+
 @end table
 @end deftp
 
diff --git a/gnu/services/version-control.scm b/gnu/services/version-control.scm
index 4f36495740..05a3530fa1 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-email
             gitolite-git-configuration-default-branch
             gitolite-git-configuration-receive-fsck-objects
+            gitolite-git-configuration-extra-content
 
             gitolite-service-type
 
@@ -338,12 +339,14 @@ (define-record-type* <gitolite-git-configuration>
   (default-branch       gitolite-git-configuration-default-branch
                         (default #f))
   (receive-fsck-objects gitolite-git-configuration-receive-fsck-objects
-                        (default #f)))
+                        (default #f))
+  (extra-content        gitolite-git-configuration-extra-content
+                        (default "")))
 
 (define-gexp-compiler (gitolite-git-configuration-compiler
                        (config <gitolite-git-configuration>) system target)
   (match-record config <gitolite-git-configuration>
-                (name email default-branch receive-fsck-objects)
+                (name email default-branch receive-fsck-objects extra-content)
     (apply text-file* "gitconfig"
            `("[user]\n"
              "name  = " ,name  "\n"
@@ -355,7 +358,8 @@ (define-gexp-compiler (gitolite-git-configuration-compiler
              ,@(if receive-fsck-objects
                    `("[receive]\n"
                      "fsckObjects = true\n")
-                   '())))))
+                   '())
+             ,extra-content "\n"))))
 
 (define-record-type* <gitolite-configuration>
   gitolite-configuration make-gitolite-configuration
-- 
2.48.1