Note that there are some explanatory texts on larger screens.

plurals
  1. PODiff/merge-friendy human-readable configuration file format
    text
    copied!<p>My users want to store my app's settings in a version control system.</p> <p>(The app targets developers and designers, and allows per-folder settings. Users often ask me to store those settings inside the folder itself, so that they can commit them to VCS.)</p> <p>The settings are modified from the app's UI and are thus <strong>saved programmatically</strong>, but I want the resulting file to be human-readable. My first choice would be a pretty-printed JSON, except that it's a funny thing to merge (think those forbidden trailing commas).</p> <p>That got me thinking: <strong>what is the most diff/merge-friendy human-readable text format I can possibly use?</strong></p> <p>I know many version control systems support external merge tools, but I don't want to burden the users with additional setup. <strong>My goal is to minimize accidental conflicts</strong> while keeping a reasonable, readable format and <strong>without any additional effort from the user</strong>.</p> <p>The data I store is basically a list of rules, and each rule has a number of user-configurable properties. Like this:</p> <pre><code>rules: - type: compile source: *.less destination: *.css compiler: LESS 1.x - type: compile source: *.coffee destination: *.js compiler: CoffeeScript 1.3 sourceMaps: true </code></pre> <p>A line-based YAML looks like a reasonably good choice. An OpenSSH-style config format may work even better.</p> <p>So two questions:</p> <ul> <li><p>Has someone tried to solve this problem before and maybe did a write up of their experience?</p></li> <li><p>Anything off the top of your head that I should consider when formatting the output file?</p> <p>E.g. will it help to add 2-3 empty lines between the rules to defeat the diff context and minimize conflicts in case two users both add a new rule at the end (a pretty typical case)?</p></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload