GNU bug report logs - #58989
[PATCH] services: gitolite: Add local-code configuration option.

Previous Next

Package: guix-patches;

Reported by: Alexey Abramov <levenson <at> mmer.org>

Date: Thu, 3 Nov 2022 16:17:02 UTC

Severity: normal

Tags: moreinfo, patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 58989 in the body.
You can then email your comments to 58989 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#58989; Package guix-patches. (Thu, 03 Nov 2022 16:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alexey Abramov <levenson <at> mmer.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 03 Nov 2022 16:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alexey Abramov <levenson <at> mmer.org>
To: guix-patches <at> gnu.org
Subject: [PATCH] services: gitolite: Add local-code configuration option.
Date: Thu,  3 Nov 2022 17:15:25 +0100
* 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





Information forwarded to guix-patches <at> gnu.org:
bug#58989; Package guix-patches. (Sun, 06 Nov 2022 14:06:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Alexey Abramov <levenson <at> mmer.org>
Cc: 58989 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#58989] [PATCH] services: gitolite: Add local-code
 configuration option.
Date: Sun, 06 Nov 2022 15:03:38 +0100
[Message part 1 (text/plain, inline)]
Alexey Abramov via Guix-patches via <guix-patches <at> 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.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#58989; Package guix-patches. (Sun, 06 Nov 2022 14:06:02 GMT) Full text and rfc822 format available.

Added tag(s) moreinfo. Request was from Christopher Baines <mail <at> cbaines.net> to control <at> debbugs.gnu.org. (Sun, 06 Nov 2022 14:06:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#58989; Package guix-patches. (Mon, 07 Nov 2022 06:41:01 GMT) Full text and rfc822 format available.

Message #16 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alexey Abramov <levenson <at> mmer.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 58989 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#58989] [PATCH] services: gitolite: Add local-code
 configuration option.
Date: Mon, 07 Nov 2022 07:40:02 +0100
[Message part 1 (text/plain, inline)]
Christopher Baines <mail <at> cbaines.net> writes:

> Alexey Abramov via Guix-patches via <guix-patches <at> 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

[0001-services-gitolite-Add-local-code-configuration-optio.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#58989; Package guix-patches. (Mon, 07 Nov 2022 06:41:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#58989; Package guix-patches. (Mon, 07 Nov 2022 19:55:01 GMT) Full text and rfc822 format available.

Message #22 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Alexey Abramov <levenson <at> mmer.org>
Cc: 58989-done <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#58989] [PATCH] services: gitolite: Add local-code
 configuration option.
Date: Mon, 07 Nov 2022 20:54:04 +0100
[Message part 1 (text/plain, inline)]
Alexey Abramov <levenson <at> mmer.org> writes:

> Christopher Baines <mail <at> 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
[signature.asc (application/pgp-signature, inline)]

Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Mon, 07 Nov 2022 19:55:02 GMT) Full text and rfc822 format available.

Notification sent to Alexey Abramov <levenson <at> mmer.org>:
bug acknowledged by developer. (Mon, 07 Nov 2022 19:55:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 06 Dec 2022 12:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 255 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.