[PATCH] services: gitolite: Add local-code configuration option.

  • Done
  • quality assurance status badge
Details
2 participants
  • Alexey Abramov
  • Christopher Baines
Owner
unassigned
Submitted by
Alexey Abramov
Severity
normal
A
A
Alexey Abramov wrote on 3 Nov 2022 17:15
(address . guix-patches@gnu.org)
20221103161525.2130-1-levenson@mmer.org
* gnu/services/version-control.scm (gitolite-rc-file): Add local-code
field.
(gitolite-rc-file-compiler): Serialize the field.
* doc/guix.texi: Document it.
---
doc/guix.texi | 9 +++++++++
gnu/services/version-control.scm | 7 ++++++-
2 files changed, 15 insertions(+), 1 deletion(-)

Toggle diff (58 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 80fb3bc47f..c05c7961e5 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -35704,6 +35704,15 @@ A value like @code{#o0027} will give read access to the group used by Gitolite
(by default: @code{git}). This is necessary when using Gitolite with software
like cgit or gitweb.
+@item @code{local-code} (default: @code{"$rc@{GL_ADMIN_BASE@}/local"})
+Allows you to add your own non-core programs, or even override the
+shipped ones with your own.
+
+Please supply the FULL path to this variable. By default, directory
+called "local" in your gitolite clone is used, providing the benefits of
+versioning them as well as making changes to them without having to log
+on to the server.
+
@item @code{unsafe-pattern} (default: @code{#f})
An optional Perl regular expression for catching unsafe configurations in
the configuration file. See
diff --git a/gnu/services/version-control.scm b/gnu/services/version-control.scm
index cd8763f5ea..8c9701afe0 100644
--- a/gnu/services/version-control.scm
+++ b/gnu/services/version-control.scm
@@ -54,6 +54,7 @@ (define-module (gnu services version-control)
<gitolite-rc-file>
gitolite-rc-file
+ gitolite-rc-file-local-code
gitolite-rc-file-umask
gitolite-rc-file-unsafe-pattern
gitolite-rc-file-git-config-keys
@@ -242,6 +243,8 @@ (define-record-type* <gitolite-rc-file>
gitolite-rc-file?
(umask gitolite-rc-file-umask
(default #o0077))
+ (local-code gitolite-rc-file-local-code
+ (default "$rc{GL_ADMIN_BASE}/local"))
(unsafe-pattern gitolite-rc-file-unsafe-pattern
(default #f))
(git-config-keys gitolite-rc-file-git-config-keys
@@ -263,11 +266,13 @@ (define-record-type* <gitolite-rc-file>
(define-gexp-compiler (gitolite-rc-file-compiler
(file <gitolite-rc-file>) system target)
(match file
- (($ <gitolite-rc-file> umask unsafe-pattern git-config-keys roles enable)
+ (($ <gitolite-rc-file> umask local-code unsafe-pattern git-config-keys roles enable)
(apply text-file* "gitolite.rc"
`("%RC = (\n"
" UMASK => " ,(format #f "~4,'0o" umask) ",\n"
" GIT_CONFIG_KEYS => '" ,git-config-keys "',\n"
+ ,(if local-code
+ (simple-format #f " LOCAL_CODE => \"~A\",\n" local-code))
" ROLES => {\n"
,@(map (match-lambda
((role . value)
--
2.36.1
C
C
Christopher Baines wrote on 6 Nov 2022 15:03
(name . Alexey Abramov)(address . levenson@mmer.org)
87a654gouw.fsf@cbaines.net
Alexey Abramov via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (13 lines)
> (match file
> - (($ <gitolite-rc-file> umask unsafe-pattern git-config-keys roles enable)
> + (($ <gitolite-rc-file> umask local-code unsafe-pattern git-config-keys roles enable)
> (apply text-file* "gitolite.rc"
> `("%RC = (\n"
> " UMASK => " ,(format #f "~4,'0o" umask) ",\n"
> " GIT_CONFIG_KEYS => '" ,git-config-keys "',\n"
> + ,(if local-code
> + (simple-format #f " LOCAL_CODE => \"~A\",\n" local-code))
> " ROLES => {\n"
> ,@(map (match-lambda
> ((role . value)

This generally looks good, but I believe the above will break if
local-code is #f.
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmNnvydfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9Xc+Rg/+K1A/yFpIPhGCgxlR4mx4KoP1nuwoqmk1
mmwmagCw4/WOyDq/lyoR1/NzSVMhG3prbr5iCZCvGfar+edEm4yW0XopOy4GtvAg
v4d+VGtsn72vFABV4jnMsheYOZclUlv16FIRDIRedtExnw7oBozd3nTWiga56g70
eKW30EC7Z+v2WSkod7K4+Lan2gePDjQ+p6pcwgCJZfp6S6IanEobTzOkw5L8fZuL
yYLeQII7IoAxmvzddJdwtY2ZKqiP96gFggCVcw4TkUFOEmf1/8JmZw6xhfia5FtA
df1rofpUAcdCO7tUHS6Ho1rwlF+B/UukKF8keapK98CRMF17TUSpnj5j3iVEtHs8
BZSM3R3rYfeUljlZAYDWs9u+LGWfwMLXAg6AlDvUSzTwt6uxxMYirglqkzjbiXhl
IQtvUKpagwnLcZI545OoN9s7wbU+ML1Nby0DBumn8F/MX5j1XaTc2ggWmolX5AIR
AmE3eunv70G+jSltrZZppW8JiIih4LkRwM2TRojZLg0Sndd6sHdQyuSTUhz0hxs+
r3EzZWqHDQDKgxeRLgKj4EQ5yfMo3s/ARwg7Tmru+lSOhPuLQtDaR1CDqR/QLtxq
xdx8KV+FH5YCTQe3U8ZOFZOJcObafZmHorqsygjm3AQrATzQgeVdGDE9Hpo1NV89
N2lI375PD1I=
=raCR
-----END PGP SIGNATURE-----

C
C
Christopher Baines wrote on 6 Nov 2022 15:05
tag 58989 moreinfo
(address . control@debbugs.gnu.org)
87edug9o0c.fsf@cbaines.net
tags 58989 + moreinfo
quit
A
A
Alexey Abramov wrote on 7 Nov 2022 07:40
Re: [bug#58989] [PATCH] services: gitolite: Add local-code configuration option.
(name . Christopher Baines)(address . mail@cbaines.net)
87leon469p.fsf@delta.lan
Christopher Baines <mail@cbaines.net> writes:

Toggle quote (3 lines)
> Alexey Abramov via Guix-patches via <guix-patches@gnu.org> writes:
>

[...]

Toggle quote (4 lines)
>
> This generally looks good, but I believe the above will break if
> local-code is #f.

Yeah, you are absolutely right. I have attached an updated patch.

--
Alexey
From 0eb61654d46e171b29a3be7b75cad22f8c32f636 Mon Sep 17 00:00:00 2001
From: Alexey Abramov <levenson@mmer.org>
Date: Wed, 19 Oct 2022 11:34:31 +0200
Subject: [PATCH] services: gitolite: Add local-code configuration option.

* gnu/services/version-control.scm (gitolite-rc-file): Add local-code
field.
(gitolite-rc-file-compiler): Serialize the field.
* doc/guix.texi: Document it.
---
doc/guix.texi | 9 +++++++++
gnu/services/version-control.scm | 8 +++++++-
2 files changed, 16 insertions(+), 1 deletion(-)

Toggle diff (59 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 80fb3bc47f..c05c7961e5 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -35704,6 +35704,15 @@ A value like @code{#o0027} will give read access to the group used by Gitolite
(by default: @code{git}). This is necessary when using Gitolite with software
like cgit or gitweb.
+@item @code{local-code} (default: @code{"$rc@{GL_ADMIN_BASE@}/local"})
+Allows you to add your own non-core programs, or even override the
+shipped ones with your own.
+
+Please supply the FULL path to this variable. By default, directory
+called "local" in your gitolite clone is used, providing the benefits of
+versioning them as well as making changes to them without having to log
+on to the server.
+
@item @code{unsafe-pattern} (default: @code{#f})
An optional Perl regular expression for catching unsafe configurations in
the configuration file. See
diff --git a/gnu/services/version-control.scm b/gnu/services/version-control.scm
index cd8763f5ea..b6b78e504e 100644
--- a/gnu/services/version-control.scm
+++ b/gnu/services/version-control.scm
@@ -54,6 +54,7 @@ (define-module (gnu services version-control)
<gitolite-rc-file>
gitolite-rc-file
+ gitolite-rc-file-local-code
gitolite-rc-file-umask
gitolite-rc-file-unsafe-pattern
gitolite-rc-file-git-config-keys
@@ -242,6 +243,8 @@ (define-record-type* <gitolite-rc-file>
gitolite-rc-file?
(umask gitolite-rc-file-umask
(default #o0077))
+ (local-code gitolite-rc-file-local-code
+ (default "$rc{GL_ADMIN_BASE}/local"))
(unsafe-pattern gitolite-rc-file-unsafe-pattern
(default #f))
(git-config-keys gitolite-rc-file-git-config-keys
@@ -263,11 +266,14 @@ (define-record-type* <gitolite-rc-file>
(define-gexp-compiler (gitolite-rc-file-compiler
(file <gitolite-rc-file>) system target)
(match file
- (($ <gitolite-rc-file> umask unsafe-pattern git-config-keys roles enable)
+ (($ <gitolite-rc-file> umask local-code unsafe-pattern git-config-keys roles enable)
(apply text-file* "gitolite.rc"
`("%RC = (\n"
" UMASK => " ,(format #f "~4,'0o" umask) ",\n"
" GIT_CONFIG_KEYS => '" ,git-config-keys "',\n"
+ ,(if local-code
+ (simple-format #f " LOCAL_CODE => \"~A\",\n" local-code)
+ "")
" ROLES => {\n"
,@(map (match-lambda
((role . value)
--
2.36.1
C
C
Christopher Baines wrote on 7 Nov 2022 20:54
(name . Alexey Abramov)(address . levenson@mmer.org)
874jvapmkc.fsf@cbaines.net
Alexey Abramov <levenson@mmer.org> writes:

Toggle quote (7 lines)
> Christopher Baines <mail@cbaines.net> writes:
>
>> This generally looks good, but I believe the above will break if
>> local-code is #f.
>
> Yeah, you are absolutely right. I have attached an updated patch.

Thanks, I've pushed this to master as
73b35195681f8367e27ebf2a239c2d4790fb2304.

Chris
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmNpYoNfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9Xctfg/9GWQxmrqrvDqEBecEbB1jaoXTggarKy7Z
Gum4eVxd77hZ/KnYByo7cnSgc1KjGWb88iS014bQISPJyxlKooxGvkgU/2bE0KBL
vYPjN2BjEOi+3k/CvmqmWRRLrQYikEg79OUZJQ2NgHSJvVZVWV0o8eIopoMDz7ZZ
tToWxiYlMKfYJv7klYF/j2G39qPTlhT4WWygd0Nb8fJwefH1WaAV145Fa4v9rjAZ
Mjhe8aMV7RbF3tyLTn3XsXFlMqfPdLCfHfpEg1jT3KXEpJ0MkT0ykT97JT90M7oZ
dTVMX+fXUS31TGimKSrI5NwdnDOmO+ET48Z1mQzFIX27e0QtMMKW3LmXHJO4Ys+O
ZgJfS+9BlhL9zHxSjZxsX4mxPTQIhPhw86Q6wFysBROE5b9TFTicTDSRXIGQXep4
mlvzxuar8zV27EEnAnBa/53AFw+1zlegBsy6slKz9a+/qW4udHORDvUULdydAO43
5gm9H6TPQ0X9dAQID9fCyaPD6vhtsim0JncOesQA3a+mDX+Fj16X4z6pc6gKxci3
mgEDNHucVwWZ5XmYNsH1zxYVf1fL3bN5f+i1T1Vqo0s4tdpYv6IscNEVB7JUXrQK
JRWuLKxgMYXnA1/0IFnGGsxxbzxZzkxc2gXfo+OwP4lVi7oiL0n3/ZdWARkHGlB/
inDFRdJu7tk=
=VFSV
-----END PGP SIGNATURE-----

?
Your comment

This issue is archived.

To comment on this conversation send an email to 58989@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 58989
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch