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

Message ID a8d18e07972e811ba8e5d1af004a8ce69a60e904.1743459020.git.~@wolfsden.cz
State New
Headers
Series [bug#77186,v2,01/14] services: gitolite-rc-file-compiler: Switch to match-record. |

Commit Message

Tomas Volf March 31, 2025, 10:10 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 f6d774fd13..bc8e7206d5 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -41061,6 +41061,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 f5558e9197..344538a73e 100644
--- a/gnu/services/version-control.scm
+++ b/gnu/services/version-control.scm
@@ -60,6 +60,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
 
@@ -252,6 +253,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))))
@@ -269,7 +272,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"
@@ -277,6 +281,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)