services: gitolite-rc-file: Add log-extra field.

* 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
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
Tomas Volf 2025-04-01 00:10:08 +02:00 committed by Maxim Cournoyer
parent a52a7d1653
commit 9306539f08
No known key found for this signature in database
GPG key ID: 1260E46482E63562
2 changed files with 15 additions and 1 deletions

View file

@ -41058,6 +41058,13 @@ access on the server.
Gitolite allows you to set git config values using the @samp{config} Gitolite allows you to set git config values using the @samp{config}
keyword. This setting allows control over the config keys to accept. 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" . ))}) @item @code{roles} (default: @code{'(("READERS" . 1) ("WRITERS" . ))})
Set the role names allowed to be used by users running the perms command. Set the role names allowed to be used by users running the perms command.

View file

@ -60,6 +60,7 @@
gitolite-rc-file-umask gitolite-rc-file-umask
gitolite-rc-file-unsafe-pattern gitolite-rc-file-unsafe-pattern
gitolite-rc-file-git-config-keys gitolite-rc-file-git-config-keys
gitolite-rc-file-log-extra
gitolite-rc-file-roles gitolite-rc-file-roles
gitolite-rc-file-enable gitolite-rc-file-enable
@ -252,6 +253,8 @@ access to exported repositories under @file{/srv/git}."
(default #f)) (default #f))
(git-config-keys gitolite-rc-file-git-config-keys (git-config-keys gitolite-rc-file-git-config-keys
(default "")) (default ""))
(log-extra gitolite-rc-file-log-extra
(default #f))
(roles gitolite-rc-file-roles (roles gitolite-rc-file-roles
(default '(("READERS" . 1) (default '(("READERS" . 1)
("WRITERS" . 1)))) ("WRITERS" . 1))))
@ -269,7 +272,8 @@ access to exported repositories under @file{/srv/git}."
(define-gexp-compiler (gitolite-rc-file-compiler (define-gexp-compiler (gitolite-rc-file-compiler
(file <gitolite-rc-file>) system target) (file <gitolite-rc-file>) system target)
(match-record file <gitolite-rc-file> (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" (apply text-file* "gitolite.rc"
`("%RC = (\n" `("%RC = (\n"
" UMASK => " ,(format #f "~4,'0o" umask) ",\n" " UMASK => " ,(format #f "~4,'0o" umask) ",\n"
@ -277,6 +281,9 @@ access to exported repositories under @file{/srv/git}."
,(if local-code ,(if local-code
(simple-format #f " LOCAL_CODE => \"~A\",\n" local-code) (simple-format #f " LOCAL_CODE => \"~A\",\n" local-code)
"") "")
,(if log-extra
" LOG_EXTRA => 1,\n"
"")
" ROLES => {\n" " ROLES => {\n"
,@(map (match-lambda ,@(map (match-lambda
((role . value) ((role . value)