[BUG] Minor: config list adds a semi-colon to lists with a single item until set

classic Classic list List threaded Threaded
2 messages Options
Ian Ian
Reply | Threaded
Open this post in threaded view
|

[BUG] Minor: config list adds a semi-colon to lists with a single item until set

It seems on first config some settings are listed by "config list" with a semicolon suffix even if they are a single item. If they are subsequently set to another/the same single value they will then appear in config list WITHOUT the semicolon suffix. See output below. This is a very minor inconsistency but has affected one downstream script: https://github.com/mturquette/ghar-email/issues/6.

---------------------------------------
$ notmuch config list
...
search.exclude_tags=spam;                       <-- Semi-colon
...
$ notmuch config get search.exclude_tags
spam
$ notmuch config set search.exclude_tags spam
$ notmuch config get search.exclude_tags
spam
$ notmuch config list
...
search.exclude_tags=spam                        <-- No semi-colon
---------------------------------------



_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] Minor: config list adds a semi-colon to lists with a single item until set

Ian <[hidden email]> writes:

> $ notmuch config list
> ...
> search.exclude_tags=spam
>
> ;
>
> <-- Semi-colon
> ...
> $ notmuch config get search.exclude_tags
> spam
> $ notmuch config
>
> set
>
> search.exclude_tags spam
> $ notmuch config get search.exclude_tags
> spam
> $ notmuch config list
> ...
> search.exclude_tags=spam                        <-- No semi-colon

Thanks for the report. It looks like two issues. The main one is that
"notmuch config list" is not sanitizing the input sufficiently, so if
extra ';' are added, they show in the list output. The second is that
notmuch setup is adding ; to single item lists.

d

PS. For better or worse, HTML is bound to get mangled this list.

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch