felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Balazs Zsoldos (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-4844) Store configuration data in a diff-tool friendly way
Date Fri, 24 Apr 2015 21:36:38 GMT

    [ https://issues.apache.org/jira/browse/FELIX-4844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14511813#comment-14511813

Balazs Zsoldos commented on FELIX-4844:

Hi David,

after the patch, ConfigHandler will read the old files. I implemented the patch in the way

 - I modified the read functionality first to accept whitespaces, line breaks and line breaks
after backslash in arrays and vectors
 - I ran the tests (writing functionality still wrote the old formats)
 - Modified the write functionality to separate each element of arrays/vectors into new line

As I said, the write functionality now writes a backslash before the line break so the file
format is compatible with Properties. However, in this was older configadmins cannot read
the files that are generated witth the newer one. I think this is acceptable as there is no
reason not to upgrade to newer version of configadmin.

Additional notes about properties file format:

 - Line breaks are possible by putting a backslash before the line break
 - Any number of spaces in the beginning of the new line are ignored

That means that it could be also possible to create a patch to write and read multi-line text
properties into multiple lines so it would be more readable and editable by hand. However,
this can be a scope of another issue.

> Store configuration data in a diff-tool friendly way
> ----------------------------------------------------
>                 Key: FELIX-4844
>                 URL: https://issues.apache.org/jira/browse/FELIX-4844
>             Project: Felix
>          Issue Type: Wish
>          Components: Configuration Admin
>            Reporter: Balazs Zsoldos
> We store our configuration with the sources in the source-code control system (git).
It often happens that multiple developers work on the same project and they modify the configuration
parallel. It would not be a problem if the config files were diff-tool friendly. To achieve
this goal, two improvements would be necessary:
> *Store entries in ABC ordered list*
> In the config files, the entries should be stored sorted by ABC. It is easy to implement
by overriding HashTable in the same way that LinkedHashMap overrides HashMap.
> *Store array values in multiple lines*
> At the moment a setting with two values are stored like this:
> key=["value1", "value2"]
> Instead of this, I would store it in the following format (each entry on new line):
> key=[ \
>   "value1", \
>   "value2" \
>   ]
> *Question*
> Do you think that if I prepare a patch for this, that would be accepted?

This message was sent by Atlassian JIRA

View raw message