[
https://issues.apache.org/jira/browse/FELIX-4844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14508088#comment-14508088
]
ASF GitHub Bot commented on FELIX-4844:
---------------------------------------
GitHub user balazs-zsoldos opened a pull request:
https://github.com/apache/felix/pull/16
FELIX-4844 - Store configuration data in a diff-tool friendly way
The entries are written in sorted order. Arrays and collections are written
in the following format:
StringArray=[ \
"one", \
"two", \
"three", \
]
- There is a backslash on the end of each line to be compatible with
ordinary properties file format
- Every element is on a new line with two space indent
- There is comma after the last element, too. In Java it is also possible
to define inline arrays in this way to ease editing and merging code
After the changes, the config files that were generated with older versions
will be read. However, due to the backslash on the end of the line, older
versions of configadmin would not able to read this format.
Other choice would be to leave the backslash from the line breaks. Parsing
would still work, but it would not be a properties file format then.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/balazs-zsoldos/felix FELIX-4844
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/felix/pull/16.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #16
----
commit cd55293cfd236ef242847ca6a4f580c6798e548d
Author: balazs.zsoldos <[email protected]>
Date: 2015-04-18T10:46:40Z
FELIX-4844 Sort the keys of the properties before storing in file
commit 0318f21552af6d2402a93d9656cc4814ef176cdd
Author: balazs.zsoldos <[email protected]>
Date: 2015-04-22T19:16:59Z
Merge remote-tracking branch 'felix/trunk' into trunk
commit a422addfd3d53db78ed064001aa45ff25c63d8fa
Author: balazs.zsoldos <[email protected]>
Date: 2015-04-22T22:40:53Z
Configadmin: Array and Vector are stored in diff tool friendly way
- Every element and closing char is on new line with two space indent
- There is comma after each element
----
> 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
(v6.3.4#6332)