-3

Similarly to Git best practice for config files etc - preferably using git - what is a best practice to release the updated default configurations (actually a bunch of files), without overriding the user's already customized ones?

The only idea that came to my mind is the following approach, using couple of branches:

master (releases only) --- 1.0 -- 2.0 ---------------- 3.0 --------- 4.0 -- "and so on" 
                            |      |                    |             |
custom                     1.1 -- 2.1 -- 2.2 -- 2.3 -- 3.1 -- 3.2 -- 4.1 --

merging the released default configurations onto the custom branch, trying to get new default properties without losing the customized ones, with least (auto) merge conflicts.

Sometimes the ours merge strategy - with git merge -s ours master - seems to minimize possible conflicts, but this is not always the case.

Is out there another possible approach, to better achieve my goal?

NOTE imagine that in practice custom branches may be a very large number and that the sketched merge procedure is achieved with a batch job (bash scripts with git commands). The aim is to minimize users intervention.

andreagalle
  • 620
  • 6
  • 17

1 Answers1

1

We use template files like config_template.ini. After an update the user can diff their local config.ini with the current config_template.ini. If they only see differences in the values, then that is probably just a usual customization. If they see a new value in the template, they should come up with an apropriate value for their installation. And if the template is missing a value they have in their local config that means this value is no longer needed.

SebDieBln
  • 3,303
  • 1
  • 7
  • 21