unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Clément Lassieur" <clement@lassieur.org>
To: Christopher Baines <mail@cbaines.net>
Cc: 31277@debbugs.gnu.org
Subject: [bug#31277] [PATCH 2/3] services: cgit: Improve handling of extra-options.
Date: Sat, 28 Apr 2018 13:19:04 +0200	[thread overview]
Message-ID: <87in8bino7.fsf@lassieur.org> (raw)
In-Reply-To: <20180426212309.10809-2-mail@cbaines.net>

Christopher Baines <mail@cbaines.net> writes:

> * gnu/services/cgit.scm (serialize-cgit-configuration): Add the extra options,
> one per line, before the scan-path, as this makes it possible to use the
> extra-options to affect the global behaviour for repositories.
> ---
>  gnu/services/cgit.scm | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
> index 8ef12cd5a..bacd6ca16 100644
> --- a/gnu/services/cgit.scm
> +++ b/gnu/services/cgit.scm
> @@ -642,13 +642,19 @@ for cgit to allow access to that repository.")
>      (not (memq (configuration-field-name field)
>                 '(project-list
>                   repository-directory
> -                 repositories))))
> +                 repositories
> +                 extra-options))))

                      ---^
Very small nitpick: could you put extra-options between project-list and
repository-directory there?  So that the order is the same with what
comes below.

>    #~(string-append
>       #$(let ((rest (filter rest? cgit-configuration-fields)))
>           (serialize-configuration config rest))
>       #$(serialize-project-list
>          'project-list
>          (cgit-configuration-project-list config))
> +     #$(string-join
> +        (append
> +         (cgit-configuration-extra-options config)
> +         '(""))
> +        "\n")

Could you put the serialization code in a dedicated function?
(e.g. SERIALIZE-EXTRA-OPTION)  So that SERIALIZE-CGIT-CONFIGURATION is
only responsible for the field ordering.

Also, I don't understand why you append '("").  If it's just to make
cgitrc look prettier, I'm not sure it's a good idea.  But maybe I missed
something?

Otherwise LGTM :-)

Clément

  reply	other threads:[~2018-04-28 11:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26 21:13 [bug#31277] [PATCH] cgit changes Christopher Baines
2018-04-26 21:23 ` [bug#31277] [PATCH 1/3] gnu: cgit: Fix included scripts Christopher Baines
2018-04-26 21:23   ` [bug#31277] [PATCH 2/3] services: cgit: Improve handling of extra-options Christopher Baines
2018-04-28 11:19     ` Clément Lassieur [this message]
2018-05-18 10:56       ` Christopher Baines
2018-04-26 21:23   ` [bug#31277] [PATCH 3/3] services: cgit: Make project-list permit a string Christopher Baines
2018-04-28 10:57     ` Clément Lassieur
2018-05-18 10:57       ` Christopher Baines
2018-04-28 11:30   ` [bug#31277] [PATCH 1/3] gnu: cgit: Fix included scripts Clément Lassieur
2018-05-18 10:55     ` Christopher Baines
2018-05-18 15:49       ` Clément Lassieur
2018-05-18 18:13         ` bug#31277: " Christopher Baines
2018-04-28 11:39 ` [bug#31277] [PATCH] cgit changes Clément Lassieur
2018-05-18 10:23 ` [bug#31277] [PATCH 1/3] gnu: cgit: Fix included scripts Christopher Baines
2018-05-18 10:23   ` [bug#31277] [PATCH 2/3] services: cgit: Improve handling of extra-options Christopher Baines
2018-05-18 10:23   ` [bug#31277] [PATCH 3/3] services: cgit: Make project-list permit a file-object Christopher Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87in8bino7.fsf@lassieur.org \
    --to=clement@lassieur.org \
    --cc=31277@debbugs.gnu.org \
    --cc=mail@cbaines.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).