Advertisement

Git Visual Studio *.vcxproj.filters file merge problem

Started by June 26, 2016 10:33 PM
2 comments, last by ApochPiQ 8 years, 4 months ago

Dear gamedev users,

Our small team is having currently a huge problem related to the Git.

Several people are working on the project, which is being developed in the Visual Studio, pulling and pushing updates to the master branch in the git.

The problem is related with the merge particularly with the *.vcxproj.filters file, which includes in itself project filters and is basically an xml file.

When two developers work on separate header and cpp files, most of the time everything works out nicely, but as soon as two developers add new files (.h and .cpp) and filters, the git can't merge *.vcxproj.filters file for the developer who has been working on the project - latest.

So what happens:
Developer 1 writes: "git add .", "git commit -m'Message'", "git push", everything results fine.
If Developer 2 pulls down the content, everything works out well, except that mysterious *.vcxproj.filters file, that just does not want to merge.

We have tried push & commit and then pull --rebase, but this didn't work either, just resulted in merge errors which we had to fix manually.

Could you please tell us that can be done in this case - if possible step by step commands.

Thank you

Short answer: don't bother versioning the filters file. Those are the bits of the project file that got pulled out because they were related to non-code IDE state.

Advertisement

Short answer: don't bother versioning the filters file. Those are the bits of the project file that got pulled out because they were related to non-code IDE state.

What we did at the end with this problem: we did several other tests on those project and filter files, we still had to merge them somehow.

At the end we forced git to ignore them, but we wrote our own merging tool for these files.
The principle behind our custom merging:
Every developer gets it's own folder for his or her own filters and project files: dev1, dev2, devn folders.
There is also a configuration file that can be configured for each developer individually.

Each developer before starting any work writes git pull, this copies each individual developer project files into their corresponding folders, no merge errors here.
Then developer launches our merging tool, it compares each developer project and filter file with developers files and populates developers files if necessary.
After this quick procedure, the merging tool generates a new project and filters file and copies it into the right place.

A developer can start his work.
After completing his work, he or she must run merging tool, it will copy a new content what has been added from his project and filters files, and write this content into corresponding devx folder.
Then git pull command is applied to ensure that all work from other developers is up to date.

Another merging procedure is undertaken, to ensure that the developer filter files are up to date.
And the last thing is to push all the content into the git.

Everything is handled mostly automatically, we are still testing and polishing our tool.
So this is how we solved this problem, I might later provide a source code of the merging tool for those VS project files.

image.png









We don't bother editing project/solution files by hand. We have a build generation tool that creates the projects and solutions based on configurable inputs and whatever code files it finds in the selected paths. The end result is that we don't even have to use revision control on the projects; developers only worry about the code itself and generate local project files as needed. If you make a commit with a new file, it's easy to trigger regeneration of projects locally when someone else syncs your new code.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

This topic is closed to new replies.

Advertisement