diff mbox series

[bug#65152] services: Modify cgit-configuration fields

Message ID 20230808163710.22801-1-thomas@thomaslabs.org
State New
Headers show
Series [bug#65152] services: Modify cgit-configuration fields | expand

Commit Message

Thomas Albers Raviola Aug. 8, 2023, 4:37 p.m. UTC
* gnu/services/cgit.scm (cgit-configuration)[root-readme]: Accept
'file-object' instead of only 'string'
---
 gnu/services/cgit.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ludovic Courtès Aug. 21, 2023, 5:22 p.m. UTC | #1
Hi,

Thomas Albers <thomas@thomaslabs.org> skribis:

> * gnu/services/cgit.scm (cgit-configuration)[root-readme]: Accept
> 'file-object' instead of only 'string'

[...]

>    (root-readme
> -   (string "")
> +   (file-object "")
>     "The content of the file specified with this option will be included
>  verbatim below the \"about\" link on the repository index page.")

I think it’s a good idea but (1) we should preserve backward
compatibility for users passing a string (file contents), and (2) update
the docstrings and its copy in the manual.

Could you send a second version to address these?  Let me know if
anything’s unclear.

Thanks,
Ludo’.
Thomas Albers Raviola Aug. 22, 2023, 9:18 a.m. UTC | #2
Hi,

in this context `file-object' is defined to be either a `file-like'
object or a `string'. As such this wouldn't break backward compatibility
but include a superset of possible values.

Also the original string is not used as the contents of the readme file
but as a file path.

However if you still think something should be changed I can send a
second patch addressing any further issues.

Greetings,
Thomas
Ludovic Courtès Sept. 9, 2023, 10:32 a.m. UTC | #3
Hi,

Thomas Albers Raviola <thomas@thomaslabs.org> skribis:

> in this context `file-object' is defined to be either a `file-like'
> object or a `string'. As such this wouldn't break backward compatibility
> but include a superset of possible values.
>
> Also the original string is not used as the contents of the readme file
> but as a file path.

Oh right, my bad, I had misunderstood that.  So it’s all good, applied!

Eventually we should probably replace ‘file-object’ by ‘file-like’,
unless there’s a clear use case for passing out-of-band file names (a
use case would be passwords, but probably not ‘README’ files).

Thanks!

Ludo’.
diff mbox series

Patch

diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index e33cb9e7db..684ab73f76 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -581,7 +581,7 @@  (define-configuration cgit-configuration
    (string "a fast webinterface for the git dscm")
    "Text printed below the heading on the repository index page.")
   (root-readme
-   (string "")
+   (file-object "")
    "The content of the file specified with this option will be included
 verbatim below the \"about\" link on the repository index page.")
   (root-title