Lists of files in a project file are typically split across multiple lines, one file per line, with each line terminated by a backslash to continue the list. e.g.
If you add files using QtCreator, it maintains this, modifying the last line to add " \", then adding the new file on the next line.
This can cause problems in version control systems when two people add different files to the project. For example:
- In some VCSs, such as svn, it can cause merge conflicts because both people have to modify the trailing line.
- If the merge is done automatically, it is possible end up with invalid project file, such as:
It's trivial to avoid all these problems, by always adding a trailing slash to the end of the last line when you add the line:
We try to do this, and it makes merging much more straightforward, but it relies on every developer remembering to manually fix-up their project files before committing, and when people forget it's a nuisance.
It would be helpful if QtCreator had an option to always add a trailing slash when adding files to a .pro file.