[PATCH] cgit changes

  • Done
  • quality assurance status badge
Details
2 participants
  • Clément Lassieur
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal
C
C
Christopher Baines wrote on 26 Apr 2018 23:13
(address . guix-patches@gnu.org)
87efj1wu0c.fsf@cbaines.net
I recently managed to succesfully use the cgit service with the Gitolite
service that is available here [1]. I had to make some changes to the
Gitolite service, so that needs updating, but I also made some changes
to the cgit package and service to make some of the scripts included in
the cgit package work on GuixSD and make porting over the cgit service
configuation I was using on Debian a little easier.


Christopher Baines (3):
gnu: cgit: Fix included scripts.
services: cgit: Improve handling of extra-options.
services: cgit: Make project-list permit a string.

gnu/packages/version-control.scm | 32 +++++++++++++++++++++++++++++++-
gnu/services/cgit.scm | 18 +++++++++++++++---
2 files changed, 46 insertions(+), 4 deletions(-)
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlriQRNfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XfREBAArGxtEhEoMtjcNn5xrjM/VK0P1dpdnbqUgRsDbKPfnBu1ASDtE5WJmIMO
wPcHedewx46+PeftPy9kZB1u42/rI/p0uHKZbqZiz5ygAOYkzQv/uIOdIlusbY/1
LdWfm9ZTnJ0q7iFl6kVBwgPXXJaq+ArBTEECUWoHzqOuXZXtGgDdeIgUKc1SYhYk
krMi004+7sK9oGIWTYZLDNKa9MB+8WsG4Dd5Q+WVBannAYX8oK8mrqXrYNv+iZxO
/RgRqwcUlVPSUwOwxBLagCaAce2//fxy8U+vnZb+gWa/ppAyzhsXjwKocCQnliet
66xKOHZYBJjn3JZPgBMgKD+nmuJJ/106hXy55ubumZIxBJ6qFSPyGSxnVEl3JNc6
VZ6H3FHqQrqVLfY59G625JwCDQ95j6ildA3a2UvSbpd179oWqXGi8Fmkasmwn3rC
TXOi4WcfCojjpJ5USH7j5jmjScoRo+KfpZmQopnhGuhFiBvoVcZwao5ZUFCDBZYX
uFHRR/EQqkidR5rjgUzDn1kNn5LkctddeGtXvYlwNs50MXiPvdKhTGpvxJSnzeO/
7RPimRrEA0yK3bdyB1C88lPhcSwc6fpH5SuRHLC1SnWJvLbLP+O8edMU3FrrFNJq
m3jkvit92O7GIYIExVk93xJ9J38u7+TOtu1NFKkRmfCPzfHT6Wg=
=ISim
-----END PGP SIGNATURE-----

C
C
Christopher Baines wrote on 26 Apr 2018 23:23
[PATCH 2/3] services: cgit: Improve handling of extra-options.
(address . 31277@debbugs.gnu.org)
20180426212309.10809-2-mail@cbaines.net
* 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(-)

Toggle diff (27 lines)
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))))
#~(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")
#$(serialize-repository-directory
'repository-directory
(cgit-configuration-repository-directory config))
--
2.17.0
C
C
Christopher Baines wrote on 26 Apr 2018 23:23
[PATCH 3/3] services: cgit: Make project-list permit a string.
(address . 31277@debbugs.gnu.org)
20180426212309.10809-3-mail@cbaines.net
Instead of having the service manage the list, it's useful to be able to point
this at an existing file, for example, when using cgit together with gitolite.

* gnu/services/cgit.scm (project-list?): New procedure.
(serialize-project-list): Handle string values.
(<cgit-configuration>): Change the predicate for project-list to allow lists
and strings.
---
gnu/services/cgit.scm | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

Toggle diff (37 lines)
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index bacd6ca16..240d4d8d9 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -115,6 +115,10 @@
(define (serialize-file-object field-name val)
(serialize-string field-name val))
+(define (project-list? val)
+ (or (list? val)
+ (string? val)))
+
;;;
;;; Serialize <nginx-server-configuration>
@@ -167,7 +171,9 @@
(if (null? val) ""
(serialize-field
'project-list
- (plain-file "project-list" (string-join val "\n")))))
+ (if (string? val)
+ val
+ (plain-file "project-list" (string-join val "\n"))))))
(define repository-directory? string?)
@@ -543,7 +549,7 @@ disabled.")
"Flag which, when set to @samp{#t}, will make cgit omit the standard
header on all pages.")
(project-list
- (list '())
+ (project-list '())
"A list of subdirectories inside of @code{repository-directory}, relative
to it, that should loaded as Git repositories. An empty list means that all
subdirectories will be loaded.")
--
2.17.0
C
C
Christopher Baines wrote on 26 Apr 2018 23:23
[PATCH 1/3] gnu: cgit: Fix included scripts.
(address . 31277@debbugs.gnu.org)
20180426212309.10809-1-mail@cbaines.net
Fix the about-formatting.sh, syntax-highlighting.py and html-converters files.

* gnu/packages/version-control.scm (cgit)[arguments]: Include
about-formatting.sh and the html-converters in the patch-absolute-file-names
phase and add a wrap-python-scripts phase to wrap syntax-highlighting.py and
the md2html converter.
[inputs]: Add groff, python, python-docutils, python-markdown and
python-pygments.
---
gnu/packages/version-control.scm | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)

Toggle diff (59 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index b82abaf9e..f75900d28 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -551,6 +551,21 @@ collaboration using typical untrusted file hosts or services.")
(quoted-file-name (assoc-ref inputs "bzip2") "/bin/bzip2"))
(("\"xz\"")
(quoted-file-name (assoc-ref inputs "xz") "/bin/xz")))
+
+ (substitute* "filters/about-formatting.sh"
+ (("$\\(dirname $0\\)") (string-append (assoc-ref outputs "out")
+ "/lib/cgit/filters"))
+ (("\\| tr") (string-append "| " (which "tr"))))
+
+ (substitute* "filters/html-converters/txt2html"
+ (("sed") (which "sed")))
+
+ (substitute* "filters/html-converters/man2html"
+ (("groff") (which "groff")))
+
+ (substitute* "filters/html-converters/rst2html"
+ (("rst2html\\.py") (which "rst2html.py")))
+
#t))
(delete 'configure) ; no configure script
(add-after 'build 'build-man
@@ -569,7 +584,17 @@ collaboration using typical untrusted file hosts or services.")
;; to get it stripped.
(rename-file (string-append out "/share/cgit/cgit.cgi")
(string-append out "/lib/cgit/cgit.cgi"))
- #t)))))))
+ #t))))
+ (add-after 'install 'wrap-python-scripts
+ (lambda* (#:key outputs #:allow-other-keys)
+ (for-each
+ (lambda (file)
+ (wrap-program (string-append (assoc-ref outputs "out")
+ "/lib/cgit/filters/" file)
+ `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
+ '("syntax-highlighting.py"
+ "html-converters/md2html"))
+ #t)))))
(native-inputs
;; For building manpage.
`(("asciidoc" ,asciidoc)
@@ -588,6 +613,11 @@ collaboration using typical untrusted file hosts or services.")
(base32
"1r2aa19gnrvm2y4fqcvpw1g9l72n48axqmpgv18s6d0y2p72vhzj"))))
("openssl" ,openssl)
+ ("groff" ,groff)
+ ("python" ,python)
+ ("python-docutils" ,python-docutils)
+ ("python-markdown" ,python-markdown)
+ ("python-pygments" ,python-pygments)
("zlib" ,zlib)))
(home-page "https://git.zx2c4.com/cgit/")
(synopsis "Web frontend for git repositories")
--
2.17.0
C
C
Clément Lassieur wrote on 28 Apr 2018 12:57
Re: [bug#31277] [PATCH 3/3] services: cgit: Make project-list permit a string.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 31277@debbugs.gnu.org)
8736zfd2er.fsf@lassieur.org
Christopher Baines <mail@cbaines.net> writes:

Toggle quote (8 lines)
> Instead of having the service manage the list, it's useful to be able to point
> this at an existing file, for example, when using cgit together with gitolite.
>
> * gnu/services/cgit.scm (project-list?): New procedure.
> (serialize-project-list): Handle string values.
> (<cgit-configuration>): Change the predicate for project-list to allow lists
> and strings.

Hi Christopher,

Good idea! But could you replace 'string?' with 'file-object?', so that
the file can be in the store?

And could you update the documentation? There is a helper
(generate-cgit-documentation) that might help you do it.

Otherwise it looks good to me. Thank you!
Clément
C
C
Clément Lassieur wrote on 28 Apr 2018 13:19
Re: [bug#31277] [PATCH 2/3] services: cgit: Improve handling of extra-options.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 31277@debbugs.gnu.org)
87in8bino7.fsf@lassieur.org
Christopher Baines <mail@cbaines.net> writes:

Toggle quote (19 lines)
> * 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.

Toggle quote (12 lines)
> #~(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
C
C
Clément Lassieur wrote on 28 Apr 2018 13:30
Re: [bug#31277] [PATCH 1/3] gnu: cgit: Fix included scripts.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 31277@debbugs.gnu.org)
87h8nvin4g.fsf@lassieur.org
Christopher Baines <mail@cbaines.net> writes:

Toggle quote (70 lines)
> Fix the about-formatting.sh, syntax-highlighting.py and html-converters files.
>
> * gnu/packages/version-control.scm (cgit)[arguments]: Include
> about-formatting.sh and the html-converters in the patch-absolute-file-names
> phase and add a wrap-python-scripts phase to wrap syntax-highlighting.py and
> the md2html converter.
> [inputs]: Add groff, python, python-docutils, python-markdown and
> python-pygments.
> ---
> gnu/packages/version-control.scm | 32 +++++++++++++++++++++++++++++++-
> 1 file changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
> index b82abaf9e..f75900d28 100644
> --- a/gnu/packages/version-control.scm
> +++ b/gnu/packages/version-control.scm
> @@ -551,6 +551,21 @@ collaboration using typical untrusted file hosts or services.")
> (quoted-file-name (assoc-ref inputs "bzip2") "/bin/bzip2"))
> (("\"xz\"")
> (quoted-file-name (assoc-ref inputs "xz") "/bin/xz")))
> +
> + (substitute* "filters/about-formatting.sh"
> + (("$\\(dirname $0\\)") (string-append (assoc-ref outputs "out")
> + "/lib/cgit/filters"))
> + (("\\| tr") (string-append "| " (which "tr"))))
> +
> + (substitute* "filters/html-converters/txt2html"
> + (("sed") (which "sed")))
> +
> + (substitute* "filters/html-converters/man2html"
> + (("groff") (which "groff")))
> +
> + (substitute* "filters/html-converters/rst2html"
> + (("rst2html\\.py") (which "rst2html.py")))
> +
> #t))
> (delete 'configure) ; no configure script
> (add-after 'build 'build-man
> @@ -569,7 +584,17 @@ collaboration using typical untrusted file hosts or services.")
> ;; to get it stripped.
> (rename-file (string-append out "/share/cgit/cgit.cgi")
> (string-append out "/lib/cgit/cgit.cgi"))
> - #t)))))))
> + #t))))
> + (add-after 'install 'wrap-python-scripts
> + (lambda* (#:key outputs #:allow-other-keys)
> + (for-each
> + (lambda (file)
> + (wrap-program (string-append (assoc-ref outputs "out")
> + "/lib/cgit/filters/" file)
> + `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
> + '("syntax-highlighting.py"
> + "html-converters/md2html"))
> + #t)))))
> (native-inputs
> ;; For building manpage.
> `(("asciidoc" ,asciidoc)
> @@ -588,6 +613,11 @@ collaboration using typical untrusted file hosts or services.")
> (base32
> "1r2aa19gnrvm2y4fqcvpw1g9l72n48axqmpgv18s6d0y2p72vhzj"))))
> ("openssl" ,openssl)
> + ("groff" ,groff)
> + ("python" ,python)
> + ("python-docutils" ,python-docutils)
> + ("python-markdown" ,python-markdown)
> + ("python-pygments" ,python-pygments)
> ("zlib" ,zlib)))
> (home-page "https://git.zx2c4.com/cgit/")
> (synopsis "Web frontend for git repositories")

Great! LGTM :-)

Clément
C
C
Clément Lassieur wrote on 28 Apr 2018 13:39
Re: [bug#31277] [PATCH] cgit changes
(name . Christopher Baines)(address . mail@cbaines.net)(address . 31277@debbugs.gnu.org)
87fu3fimq6.fsf@lassieur.org
Oh, and please could you add copyright lines?

Thanks!
Clément
C
C
Christopher Baines wrote on 18 May 2018 12:23
[PATCH 3/3] services: cgit: Make project-list permit a file-object.
(address . 31277@debbugs.gnu.org)
20180518102339.26480-3-mail@cbaines.net
Instead of having the service manage the list, it's useful to be able to point
this at an existing file, for example, when using cgit together with gitolite.

* gnu/services/cgit.scm (project-list?): New procedure.
(serialize-project-list): Handle file-object values.
(<cgit-configuration>): Change the predicate for project-list to allow lists
and file-objects.
---
doc/guix.texi | 2 +-
gnu/services/cgit.scm | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)

Toggle diff (50 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 005c0597a..81ad4f48f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19241,7 +19241,7 @@ Defaults to @samp{#f}.
@end deftypevr
-@deftypevr {@code{cgit-configuration} parameter} list project-list
+@deftypevr {@code{cgit-configuration} parameter} project-list project-list
A list of subdirectories inside of @code{repository-directory}, relative
to it, that should loaded as Git repositories. An empty list means that
all subdirectories will be loaded.
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index 3183535d4..3289d3733 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -116,6 +116,10 @@
(define (serialize-file-object field-name val)
(serialize-string field-name val))
+(define (project-list? val)
+ (or (list? val)
+ (file-object? val)))
+
;;;
;;; Serialize <nginx-server-configuration>
@@ -168,7 +172,9 @@
(if (null? val) ""
(serialize-field
'project-list
- (plain-file "project-list" (string-join val "\n")))))
+ (if (file-object? val)
+ val
+ (plain-file "project-list" (string-join val "\n"))))))
(define (serialize-extra-options extra-options)
(string-join extra-options "\n" 'suffix))
@@ -547,7 +553,7 @@ disabled.")
"Flag which, when set to @samp{#t}, will make cgit omit the standard
header on all pages.")
(project-list
- (list '())
+ (project-list '())
"A list of subdirectories inside of @code{repository-directory}, relative
to it, that should loaded as Git repositories. An empty list means that all
subdirectories will be loaded.")
--
2.17.0
C
C
Christopher Baines wrote on 18 May 2018 12:23
[PATCH 2/3] services: cgit: Improve handling of extra-options.
(address . 31277@debbugs.gnu.org)
20180518102339.26480-2-mail@cbaines.net
* 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.
(serialize-extra-options): New procedure.
---
gnu/services/cgit.scm | 7 +++++++
1 file changed, 7 insertions(+)

Toggle diff (41 lines)
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index 8ef12cd5a..3183535d4 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -169,6 +170,9 @@
'project-list
(plain-file "project-list" (string-join val "\n")))))
+(define (serialize-extra-options extra-options)
+ (string-join extra-options "\n" 'suffix))
+
(define repository-directory? string?)
(define (serialize-repository-directory _ val)
@@ -641,6 +645,7 @@ for cgit to allow access to that repository.")
(define (rest? field)
(not (memq (configuration-field-name field)
'(project-list
+ extra-options
repository-directory
repositories))))
#~(string-append
@@ -649,6 +654,8 @@ for cgit to allow access to that repository.")
#$(serialize-project-list
'project-list
(cgit-configuration-project-list config))
+ #$(serialize-extra-options
+ (cgit-configuration-extra-options config))
#$(serialize-repository-directory
'repository-directory
(cgit-configuration-repository-directory config))
--
2.17.0
C
C
Christopher Baines wrote on 18 May 2018 12:23
[PATCH 1/3] gnu: cgit: Fix included scripts.
(address . 31277@debbugs.gnu.org)
20180518102339.26480-1-mail@cbaines.net
Fix the about-formatting.sh, syntax-highlighting.py and html-converters files.

* gnu/packages/version-control.scm (cgit)[arguments]: Include
about-formatting.sh and the html-converters in the patch-absolute-file-names
phase and add a wrap-python-scripts phase to wrap syntax-highlighting.py and
the md2html converter.
[inputs]: Add groff, python, python-docutils, python-markdown and
python-pygments.
---
gnu/packages/version-control.scm | 33 +++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)

Toggle diff (67 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index b41529d4f..f53d0f4fa 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -19,6 +19,7 @@
;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
;;; Copyright © 2017 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
+;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -551,6 +552,21 @@ collaboration using typical untrusted file hosts or services.")
(quoted-file-name (assoc-ref inputs "bzip2") "/bin/bzip2"))
(("\"xz\"")
(quoted-file-name (assoc-ref inputs "xz") "/bin/xz")))
+
+ (substitute* "filters/about-formatting.sh"
+ (("$\\(dirname $0\\)") (string-append (assoc-ref outputs "out")
+ "/lib/cgit/filters"))
+ (("\\| tr") (string-append "| " (which "tr"))))
+
+ (substitute* "filters/html-converters/txt2html"
+ (("sed") (which "sed")))
+
+ (substitute* "filters/html-converters/man2html"
+ (("groff") (which "groff")))
+
+ (substitute* "filters/html-converters/rst2html"
+ (("rst2html\\.py") (which "rst2html.py")))
+
#t))
(delete 'configure) ; no configure script
(add-after 'build 'build-man
@@ -569,7 +585,17 @@ collaboration using typical untrusted file hosts or services.")
;; to get it stripped.
(rename-file (string-append out "/share/cgit/cgit.cgi")
(string-append out "/lib/cgit/cgit.cgi"))
- #t)))))))
+ #t))))
+ (add-after 'install 'wrap-python-scripts
+ (lambda* (#:key outputs #:allow-other-keys)
+ (for-each
+ (lambda (file)
+ (wrap-program (string-append (assoc-ref outputs "out")
+ "/lib/cgit/filters/" file)
+ `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
+ '("syntax-highlighting.py"
+ "html-converters/md2html"))
+ #t)))))
(native-inputs
;; For building manpage.
`(("asciidoc" ,asciidoc)
@@ -588,6 +614,11 @@ collaboration using typical untrusted file hosts or services.")
(base32
"1r2aa19gnrvm2y4fqcvpw1g9l72n48axqmpgv18s6d0y2p72vhzj"))))
("openssl" ,openssl)
+ ("groff" ,groff)
+ ("python" ,python)
+ ("python-docutils" ,python-docutils)
+ ("python-markdown" ,python-markdown)
+ ("python-pygments" ,python-pygments)
("zlib" ,zlib)))
(home-page "https://git.zx2c4.com/cgit/")
(synopsis "Web frontend for git repositories")
--
2.17.0
C
C
Christopher Baines wrote on 18 May 2018 12:55
(name . Clément Lassieur)(address . clement@lassieur.org)(address . 31277@debbugs.gnu.org)
87lgch44i2.fsf@cbaines.net
Clément Lassieur <clement@lassieur.org> writes:

Toggle quote (15 lines)
> Christopher Baines <mail@cbaines.net> writes:
>
>> Fix the about-formatting.sh, syntax-highlighting.py and html-converters files.
>>
>> * gnu/packages/version-control.scm (cgit)[arguments]: Include
>> about-formatting.sh and the html-converters in the patch-absolute-file-names
>> phase and add a wrap-python-scripts phase to wrap syntax-highlighting.py and
>> the md2html converter.
>> [inputs]: Add groff, python, python-docutils, python-markdown and
>> python-pygments.
>> ---
>> gnu/packages/version-control.scm | 32 +++++++++++++++++++++++++++++++-
>> 1 file changed, 31 insertions(+), 1 deletion(-)
>>

...

Toggle quote (4 lines)
> Great! LGTM :-)
>
> Clément

Thanks for taking a look Clément, I've now sent another set of patches
with some changes.
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlr+sTVfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XcEJw//VQXABJ5ORmmXDUDqh3HSyGWER8Je2Cjd48iO4LCvfjvK9ogWHnjKME7p
WYn+0CQnKceER8xxpWunI54dOThEjWL52TMk9K2iWP1JMaMq2z5IVlYgoGwb1jqg
hJsWEC9LgtSS6CnOhvCQIWK8V/iV31seqQkWQidANloqJJV3YBrEcQziHkZTm7uc
h0xkHzdW0lUlOaGIss7FCup5zwW/qVWjbbUBUB0JiGJaSYp6DcitmosEmy10GKyu
6QzkUczzg0IB6XXa6gzM+cG+GmQg4AgYZxwC4UKlEdXTGj3HLmof0fhloTr05LG4
sOM2UjWmnC7JjVbGFV/wljOMFahUxRzoH7k+BMOecAM8ur4Jpcv0te/q1DoCrq/u
dFBHYuDGpa67Zr3nV5VydCfUZWxLogeGU1BnHUZcaA0jVO1fLYmwIl84VaUqYlDH
YoYroHDImOoYlNHTL2wriy7tcORHfPPEvbMNfyEchWEKEkT7gL9XiVeFS30mrAXx
/qylmLGeh8OX8ov9QuMPhN56EYING9qjENA2FU7pPPfgsjPKcVf7xDKwN395AJcM
CVKRbooSJcjU8io/MMvNILIdNkQqn0HcpRNZxhoB3OaPr3LqokhMR92Pgj2UiP+/
T5Ssjtqn7hwXZc4gGS3ydzdZy4gkmlP+cuVZkrxAoFaw7UByRyM=
=Xdbb
-----END PGP SIGNATURE-----

C
C
Christopher Baines wrote on 18 May 2018 12:56
Re: [bug#31277] [PATCH 2/3] services: cgit: Improve handling of extra-options.
(name . Clément Lassieur)(address . clement@lassieur.org)(address . 31277@debbugs.gnu.org)
87k1s144gj.fsf@cbaines.net
Clément Lassieur <clement@lassieur.org> writes:

Toggle quote (26 lines)
> 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.

Sure, this should be fixed now.

Toggle quote (16 lines)
>> #~(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.

Done.

Toggle quote (4 lines)
> 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?

The '("") was to add an extra newline effectively. I've replaced this by
using the 'suffix option of string-join in the updated patch.
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlr+sWxfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XeMfg//Q3G0JDRriOWoBX51ubpLmqidrDeZ+KmIhpw172nV9QVa7pb22SO9skPL
eSmeq14LhY0Slivf/w0k7/0jkfRJBQZyR8aJQ/EFySFKpG6XB6DwVZK0p4ksujOG
U6RQ0zoHCYed4Ygxmf+kRKgtUwFWGRuFraCkwjIenaNv4kcXDhSYkbQCl6rGuDKW
/JldwjaBMV0O6JOrwgTmtNTMg18ZY2vlo8AfjEJeUbPEw8k7McKBbT39liMydm8o
3FqrBpl29pC1rimdHOrxx4kmCme0UcqsPfT5ZqHJBvQ1/bWYa+awjoE9BOsHKW4u
ZXVbtvoalS036SsAJPtMR6NluVs85ukWR2bGTV4vYSc+r5RbqLnY9DqNDlDAz0/K
klYq0v3nT0LHe5ZJeqes7niQzLgsjZPM1PbTxQ22Aj1qb+uCgzccVAe4QJ27Ii8J
eWdp+ijahUU+uSxid1vbJzTJCuI0f1yacvIj53WV1dhjmWnXtau2ayx9Nv9ZokpD
DXXNwkSkTXHENn1sJ92Kk+2dA9DKxT0BocZoErqhoLNHqKqAKLlbFUdsn8T17L2P
7XmaXI6IVqs60BpaB73YQVaW7nUgHxlfvMvL+R24R3lJ60qj9SQySi35vaUH1mLd
s54RPotQlBiohjWZ8mqEyE0VUE2RuaezIMDJe1oxt0DKT/siyeU=
=n6jj
-----END PGP SIGNATURE-----

C
C
Christopher Baines wrote on 18 May 2018 12:57
Re: [bug#31277] [PATCH 3/3] services: cgit: Make project-list permit a string.
(name . Clément Lassieur)(address . clement@lassieur.org)(address . 31277@debbugs.gnu.org)
87in7l44fx.fsf@cbaines.net
Clément Lassieur <clement@lassieur.org> writes:

Toggle quote (18 lines)
> Christopher Baines <mail@cbaines.net> writes:
>
>> Instead of having the service manage the list, it's useful to be able to point
>> this at an existing file, for example, when using cgit together with gitolite.
>>
>> * gnu/services/cgit.scm (project-list?): New procedure.
>> (serialize-project-list): Handle string values.
>> (<cgit-configuration>): Change the predicate for project-list to allow lists
>> and strings.
>
> Hi Christopher,
>
> Good idea! But could you replace 'string?' with 'file-object?', so that
> the file can be in the store?
>
> And could you update the documentation? There is a helper
> (generate-cgit-documentation) that might help you do it.

Both should be done now :)
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlr+sYJfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9Xcacw//dP/rUJZDQQZnv3g3mEgEY0xJMK8CWat04UWiOAGC20p5xzUrzsihUVDA
8Zru4p+L+LRKFpxlyM9uBQ2F7/M9dt+Dg8ocewQy2TZopdRBdPHyxypDE4SBY91a
8DZN1U3d/ifbvc2S29A6Emkcjw8g2SwBFsSWpyztkLRooNOcfEnkGEw3YIYX2j3f
Llc6FSuDJ4CQJXxe6oKcP/4GSxkUffb32fz41qfJIOOz2O8d32mzOkyFYl9mxcS4
DonAYXulr+t7zw3OJWh9wKuUorp7EkQFThxFPHcBNamf99QXo57f9cKw8Qn1vqHC
NokIgACEepaKsl7ZylFYrkBJMTXCz2JRvKu0a7Nyzfg3appQ+fRXYWHCz9RlGqf9
rvo3HDAM8S7DDOf4Wz49bwAlSdbnxqK7qMLHdOHDAc1gbzTW6TcBuQqT7arz4ayv
mACVZHYgQ85C1+FN/E/ZrLYgptKpoMmJrR9zNnnaniKCGkeGGBntToSHDnnL3l+j
rEeVDe3tDCoLhtDo6t/npyuM1v4DDXcFCGFehLJyGtgyVra9NpedMIDubr+1fDXk
Rgy8Kg3SYWkEAt6alI8T3oCYgFFSWjgNGNeW7tl3+JN2xRkcf61wFRyFiUwkQcZM
I4/GqNr0B+GZ1I6146oqh+v1OiuWhrum3BvYod0MP52GN0WuYFs=
=7YNO
-----END PGP SIGNATURE-----

C
C
Clément Lassieur wrote on 18 May 2018 17:49
Re: [bug#31277] [PATCH 1/3] gnu: cgit: Fix included scripts.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 31277@debbugs.gnu.org)
87lgch9d5t.fsf@lassieur.org
Christopher Baines <mail@cbaines.net> writes:

Toggle quote (26 lines)
> Clément Lassieur <clement@lassieur.org> writes:
>
>> Christopher Baines <mail@cbaines.net> writes:
>>
>>> Fix the about-formatting.sh, syntax-highlighting.py and html-converters files.
>>>
>>> * gnu/packages/version-control.scm (cgit)[arguments]: Include
>>> about-formatting.sh and the html-converters in the patch-absolute-file-names
>>> phase and add a wrap-python-scripts phase to wrap syntax-highlighting.py and
>>> the md2html converter.
>>> [inputs]: Add groff, python, python-docutils, python-markdown and
>>> python-pygments.
>>> ---
>>> gnu/packages/version-control.scm | 32 +++++++++++++++++++++++++++++++-
>>> 1 file changed, 31 insertions(+), 1 deletion(-)
>>>
>
> ...
>
>> Great! LGTM :-)
>>
>> Clément
>
> Thanks for taking a look Clément, I've now sent another set of patches
> with some changes.

Ok, thank you! LGTM then :-)
C
C
Christopher Baines wrote on 18 May 2018 20:13
(name . Clément Lassieur)(address . clement@lassieur.org)(address . 31277-done@debbugs.gnu.org)
87efi8g7d7.fsf@cbaines.net
Clément Lassieur <clement@lassieur.org> writes:

Toggle quote (30 lines)
> Christopher Baines <mail@cbaines.net> writes:
>
>> Clément Lassieur <clement@lassieur.org> writes:
>>
>>> Christopher Baines <mail@cbaines.net> writes:
>>>
>>>> Fix the about-formatting.sh, syntax-highlighting.py and html-converters files.
>>>>
>>>> * gnu/packages/version-control.scm (cgit)[arguments]: Include
>>>> about-formatting.sh and the html-converters in the patch-absolute-file-names
>>>> phase and add a wrap-python-scripts phase to wrap syntax-highlighting.py and
>>>> the md2html converter.
>>>> [inputs]: Add groff, python, python-docutils, python-markdown and
>>>> python-pygments.
>>>> ---
>>>> gnu/packages/version-control.scm | 32 +++++++++++++++++++++++++++++++-
>>>> 1 file changed, 31 insertions(+), 1 deletion(-)
>>>>
>>
>> ...
>>
>>> Great! LGTM :-)
>>>
>>> Clément
>>
>> Thanks for taking a look Clément, I've now sent another set of patches
>> with some changes.
>
> Ok, thank you! LGTM then :-)

Great, I've pushed these patches now :)
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlr/F7RfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XfY0g//YRoWTmVqYrNZTk3bA0EFrlkOzdY30idvv8hsv2dqW2CMdygePKYSZivx
enG25QPUMlos+SYmOs5kCnoA30m2NE8QXUKpTSdb3PuXRYgLnmn/Bb6+hJ4NRVnH
t939qw3etFo/adobKRtccviYDQClKoF7jjLqzkUMSsSA97qkId1d9sO/G/IcJ5Zy
o18XBLffDdfW/m5p+Poh7Usd77in+Ft7fn9oE4DfrrRReTixJeL+aRqSIN0QMSg3
FE4v1vzlTPLjzEqKc0VC3+WMw8Rt4mXyKzEn468xv4tnQk4aui349SAanAU+9aLJ
5gMBG8UEOT7fKMpRWTHzT2Qp2lWw9X5/HCxp0fwA5T9Ygq7aTxPcZZCX7MwagDP7
yn9aaSh1bpnAbcXZEbBdvICngzxSyCYctqxVXqndykSp9rSLX237OmZJeO1AA6Er
XQaS5R4xIPEoDtgEXObZSMgdArk8MeNeXjW3JNNGuXFr/eJSNrF8Z1pcAdRsAtuO
unOeYVhTOaOFq17Q9v57dnKJVWVm7G9JOtjLRRbgUghqJeeseH2jn3KnIRvh7hCG
IZZY4aTU0V+oSATqLEax/pESjq7B/Hpz3UP7p7ye+yHG9HPpTT9cAKe1/vThYTiB
rQT4l4z2xl+UeTEkF4FY/gGNTUN3tQXve9TvxvthgoIdUqSPxaU=
=z7DY
-----END PGP SIGNATURE-----

Closed
?