unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#58989] [PATCH] services: gitolite: Add local-code configuration option.
@ 2022-11-03 16:15 Alexey Abramov via Guix-patches via
  2022-11-06 14:03 ` Christopher Baines
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Abramov via Guix-patches via @ 2022-11-03 16:15 UTC (permalink / raw)
  To: 58989

* 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(-)

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





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#58989] [PATCH] services: gitolite: Add local-code configuration option.
  2022-11-03 16:15 [bug#58989] [PATCH] services: gitolite: Add local-code configuration option Alexey Abramov via Guix-patches via
@ 2022-11-06 14:03 ` Christopher Baines
  2022-11-07  6:40   ` Alexey Abramov via Guix-patches via
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Baines @ 2022-11-06 14:03 UTC (permalink / raw)
  To: Alexey Abramov; +Cc: 58989

[-- Attachment #1: Type: text/plain, Size: 731 bytes --]


Alexey Abramov via Guix-patches via <guix-patches@gnu.org> writes:

>    (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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#58989] [PATCH] services: gitolite: Add local-code configuration option.
  2022-11-06 14:03 ` Christopher Baines
@ 2022-11-07  6:40   ` Alexey Abramov via Guix-patches via
  2022-11-07 19:54     ` Christopher Baines
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Abramov via Guix-patches via @ 2022-11-07  6:40 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 58989

[-- Attachment #1: Type: text/plain, Size: 295 bytes --]

Christopher Baines <mail@cbaines.net> writes:

> Alexey Abramov via Guix-patches via <guix-patches@gnu.org> 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.

-- 
Alexey


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-services-gitolite-Add-local-code-configuration-optio.patch --]
[-- Type: text/x-patch, Size: 3080 bytes --]

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(-)

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#58989] [PATCH] services: gitolite: Add local-code configuration option.
  2022-11-07  6:40   ` Alexey Abramov via Guix-patches via
@ 2022-11-07 19:54     ` Christopher Baines
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Baines @ 2022-11-07 19:54 UTC (permalink / raw)
  To: Alexey Abramov; +Cc: 58989-done, 58989

[-- Attachment #1: Type: text/plain, Size: 342 bytes --]


Alexey Abramov <levenson@mmer.org> writes:

> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-07 19:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 16:15 [bug#58989] [PATCH] services: gitolite: Add local-code configuration option Alexey Abramov via Guix-patches via
2022-11-06 14:03 ` Christopher Baines
2022-11-07  6:40   ` Alexey Abramov via Guix-patches via
2022-11-07 19:54     ` Christopher Baines

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).