~abcdw/rde-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH rde] home-git-configuration: Always use quoted strings when serializing

Details
Message ID
<172965370533.21165.2965928877296684051-0@git.sr.ht>
DKIM signature
missing
Download raw message
Patch: +1 -1
From: Javier Olaechea <pirata@gmail.com>

According to the Syntax section of man git-config the quoting is optional, but
if we want to include characters like `#` or `;` as part of the configuration
value we need to quote the string.

Example of the configuration that results in an invalid git config before
applying this patch:

  (use-modules (gnu home)
               (gnu services)
               ((gnu home-services version-control)
                #:select (home-git-configuration
                          home-git-service-type)))

  (home-environment
   (services
    (list (service home-git-service-type
                   (home-git-configuration
                    (config '((core ((comment-char . ";"))))))))))

assuming the configuration above lives in foo.scm we can test it using guix
home container home-foo.scm
---
 src/gnu/home-services/version-control.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gnu/home-services/version-control.scm b/src/gnu/home-services/version-control.scm
index 6bfc81f9..981941f6 100644
--- a/src/gnu/home-services/version-control.scm
+++ b/src/gnu/home-services/version-control.scm
@@ -75,7 +75,7 @@
    (#f "false")
    ((? symbol? e) (symbol->string e))
    ((? number? e) (number->string e))
    ((? string? e) e)
    ((? string? e) (format #f "~s" e))
    ((lst ...)
     (raise (formatted-message
             (G_ "Git term should be a non-list value (string, \
-- 
2.45.2

[rde/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<D52V4U2ILIRY.BXKMU3KF2NWP@fra02>
In-Reply-To
<172965370533.21165.2965928877296684051-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
rde/patches/.build.yml: SUCCESS in 3m9s

[home-git-configuration: Always use quoted strings when serializing][0] from [~puercopop][1]

[0]: https://lists.sr.ht/~abcdw/rde-devel/patches/55599
[1]: pirata@gmail.com

✓ #1355258 SUCCESS rde/patches/.build.yml https://builds.sr.ht/~abcdw/job/1355258
Details
Message ID
<87y12fp94j.fsf@trop.in>
In-Reply-To
<172965370533.21165.2965928877296684051-0@git.sr.ht> (view parent)
DKIM signature
pass
Download raw message
On 2024-10-22 21:31, ~puercopop wrote:

> From: Javier Olaechea <pirata@gmail.com>
>
> According to the Syntax section of man git-config the quoting is optional, but
> if we want to include characters like `#` or `;` as part of the configuration
> value we need to quote the string.
>
> Example of the configuration that results in an invalid git config before
> applying this patch:
>
>   (use-modules (gnu home)
>                (gnu services)
>                ((gnu home-services version-control)
>                 #:select (home-git-configuration
>                           home-git-service-type)))
>
>   (home-environment
>    (services
>     (list (service home-git-service-type
>                    (home-git-configuration
>                     (config '((core ((comment-char . ";"))))))))))
>
> assuming the configuration above lives in foo.scm we can test it using guix
> home container home-foo.scm
> ---
>  src/gnu/home-services/version-control.scm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gnu/home-services/version-control.scm b/src/gnu/home-services/version-control.scm
> index 6bfc81f9..981941f6 100644
> --- a/src/gnu/home-services/version-control.scm
> +++ b/src/gnu/home-services/version-control.scm
> @@ -75,7 +75,7 @@
>      (#f "false")
>      ((? symbol? e) (symbol->string e))
>      ((? number? e) (number->string e))
> -    ((? string? e) e)
> +    ((? string? e) (format #f "~s" e))
>      ((lst ...)
>       (raise (formatted-message
>               (G_ "Git term should be a non-list value (string, \

Thank you for the patch, applied, updated commit message, pushed.

There are a few notes for whoever read this thread in the future and
would like to help: 

We need to:
- migrate git service to rde/home/services/
- implement serializer in a similiar way it done for rde home services.
- write tests for serializer. 

https://todo.sr.ht/~abcdw/tickets/21

-- 
Best regards,
Andrew Tropin
Reply to thread Export thread (mbox)