Using Version Control software with Xojo

Given that Xojo project code (text) files are in an undocumented format, and editing them is discouraged, how do people here handle using Version Control software merges (like when using Git or Mercurial) that call a merge/diff editor to let you handle the merges? Do you allow the merge/diff editor to alter the Xojo project code (text) files?

There shouldn’t be any problem with merge/diff. It recreates the original file so you’re technically not editing/modifying it.

Hmmm … when I do a 3-pane merge with diff software (called by SourceTree, e.g.), the resulting third (merge) file (after I edit in the merge/diff app) can have bits of each of the files in the other two panes (old and new file comparison), and that new file is the one returned to Xojo to use in the next version of the project. But the merge/diff editor leaves all the stuff that was the same alone. At least that’s how it looks when I use Mercurial/SourceTree with Xojo.

I’m not sure what the issue is here…

Well, in another conversation ( I was cautioned by Norman about editing Xojo source files.

I’m sure that’s not what he meant. The text format is specifically meant for version control and plays well with diff and merges.

Probably was just cautioning me against playing with the format of the source files.

I use Git and regularly branch off master and I’m able to merge back in without any issues using Xojo Project (text) format files.

He’s cautioning you about editing them manually.

Well, even using git, a merge can lead to a source file that the IDE won’t load. This can happen when the merge inserts or removes (or even duplirates) some of the “#tag” lines, primarily.

The difference to editing source files in a plain text language (C, Java usw.) is that an IDE would still be able to open such a corrupted file, and then the compiler or syntax checker would alert the user, and the user could then edit the text. The trouble with Xojo is that you can’t even open the project in the IDE at that point any more, so you need to figure out what broke without the assistance of the IDE or the compiler.

But that’s really rare to happen. But it can.

So, when you merge Xojo source files, pay special attention to the #tag borders, and try to make changes only with those #tag blocks, not across them.

Do you mean make changes only between those #tag markers?

Oops. Yes.