[bug#77186,02/13] services: gitolite-rc-file: Add log-extra field.

Message ID 2760c726fe70f6622ad770ba3e2b755489e8f66a.1742661305.git.~@wolfsden.cz
State New
Headers
Series Revamp the gitolite-service-type |

Commit Message

Tomas Volf March 22, 2025, 5 p.m. UTC
  * gnu/services/version-control.scm (<gitolite-rc-file>): Add log-extra field.
(gitolite-rc-file-compiler): Handle it during configuration file generation.
* doc/guix.texi (Version Control Services): Document it.

Change-Id: Ice65dbdf4f42549e3c83914da7229db9d2cf856b
---
 doc/guix.texi                    | 7 +++++++
 gnu/services/version-control.scm | 9 ++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
  

Patch

diff --git a/doc/guix.texi b/doc/guix.texi
index bcb1f9d9cf..3179d33cb3 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -41147,6 +41147,13 @@  Version Control Services
 Gitolite allows you to set git config values using the @samp{config}
 keyword.  This setting allows control over the config keys to accept.
 
+@item @code{log-extra} (default: @code{#f})
+Whether gitolite should log extra details.
+
+For historical reasons, this field defaults to @code{#f}.  The default
+value from gitolite however is @code{1} (written as @code{#t} in this
+configuration).
+
 @item @code{roles} (default: @code{'(("READERS" . 1) ("WRITERS" . ))})
 Set the role names allowed to be used by users running the perms command.
 
diff --git a/gnu/services/version-control.scm b/gnu/services/version-control.scm
index e73833713e..2e7448c33b 100644
--- a/gnu/services/version-control.scm
+++ b/gnu/services/version-control.scm
@@ -59,6 +59,7 @@  (define-module (gnu services version-control)
             gitolite-rc-file-umask
             gitolite-rc-file-unsafe-pattern
             gitolite-rc-file-git-config-keys
+            gitolite-rc-file-log-extra
             gitolite-rc-file-roles
             gitolite-rc-file-enable
 
@@ -251,6 +252,8 @@  (define-record-type* <gitolite-rc-file>
                    (default #f))
   (git-config-keys gitolite-rc-file-git-config-keys
                    (default ""))
+  (log-extra       gitolite-rc-file-log-extra
+                   (default #f))
   (roles           gitolite-rc-file-roles
                    (default '(("READERS" . 1)
                               ("WRITERS" . 1))))
@@ -268,7 +271,8 @@  (define-record-type* <gitolite-rc-file>
 (define-gexp-compiler (gitolite-rc-file-compiler
                        (file <gitolite-rc-file>) system target)
   (match-record file <gitolite-rc-file>
-                (umask local-code unsafe-pattern git-config-keys roles enable)
+                ( umask local-code unsafe-pattern git-config-keys log-extra
+                  roles enable)
     (apply text-file* "gitolite.rc"
            `("%RC = (\n"
              "    UMASK => " ,(format #f "~4,'0o" umask) ",\n"
@@ -276,6 +280,9 @@  (define-gexp-compiler (gitolite-rc-file-compiler
              ,(if local-code
                   (simple-format #f "    LOCAL_CODE => \"~A\",\n" local-code)
                   "")
+             ,(if log-extra
+                  "    LOG_EXTRA => 1,\n"
+                  "")
              "    ROLES => {\n"
              ,@(map (match-lambda
                       ((role . value)