Why modules in Puppetfile should be sorted

December 30, 2019 

This is probably one of the shortest blog postings in the history of this blog. But as this topic does not seem to be covered in more generic articles about avoiding Git merge conflicts (e.g. this, this and this), here it goes.

Adding modules to the Puppetfile is a quite common task. When you or your team has multiple feature branches at the same time many of those branches may add new Puppet modules to the Puppetfile. This is fine, unless the new modules are added to the bottom of the Puppetfile: Git will get confused because it sees that multiple commits have changed the exact same place in the Puppetfile.

You can avoid this category of merge conflicts by simply sorting your Puppetfile. Or if you're not into sorting, just put the new modules anywhere except the end of the Puppetfile and you'll be good.

Samuli Seppänen
Samuli Seppänen
Author archive
menucross-circle