Version Control, Git and Xojo

Has anyone been successful using Git with Xojo? If so I’d greatly appreciate some pointers.

I’ve had no small amount of fun trying to get it to work with SourceTree. Git goes and puts these nice little Conflict Markers all through the Xojo files - corrupting them. This requires a manual fix every time which can be a big headache.

I’m not fussy about whether I use Git, SVN, Mercurial, etc so long as it works well enough with Xojo.

I’ve been using SourceTree and mercurial with Xojo since Xojo came out without any issues. I tried Git but didn’t care much for it. It seems like the only time I have issues with conflicts is if I forget to push my commits to bitbucket.org before going to my other computer and pulling down the changes. As long as I push/pull before making changes to the project file everything seems to go real smooth.

Thanks Johnny. Unfortunately I think that for me conflicts will be inevitable. There’ll be 3 people working on different parts at different times.

There must be people who use Xojo and version control in teams where conflicts happen regularly.

Xojo, inc uses Subversion themselves. They may know how that works.
I too uses SVN but I’m a sole developer so there’s not much conflicts here :wink:

We use Sourcetree/Bitbucket/Git. We only ever get conflicts if we both work on the same bit of the same method. Otherwise it’s lovely.

Correct me if I’m wrong, but it won’t matter which one you use…if you have 3 people working on different parts, any VCS is going to put those conflict markers in that need resolving manually, right? Although I thought SourceTree would let you edit those in the software…perhaps I’m wrong, I’m a one-man show so haven’t dealt with the conflicts.

Yes, I agree; no amount of source control is going to magically resolve conflicts if they exist. If you’ve really got three people working on the same bits of the code at the same time (which you may not have - it’s a little hard to tell from your original question) then I’d be looking at your business processes rather than the software which you use as a VCS.

I use SmartGIT on my MacOS using GitHub… I then use Arbed that integrates in with SmartGIT so I can see All of my Code Changes (Xojo Binary Format).

[quote=59176:@Joshua Woods]Thanks Johnny. Unfortunately I think that for me conflicts will be inevitable. There’ll be 3 people working on different parts at different times.

There must be people who use Xojo and version control in teams where conflicts happen regularly.[/quote]

Well I’ve used SVN on various projects over the years with team from three or four programmers up to twenty or so and conflicts are rear, perhaps one or two a month. But it really is not about the VCS, it is about the work flow - you need to organize yourselfs to reduce conflicts. At a minimum you need to go one person per file and on larger projects think about assigning entire features or modules working to standard interfaces and so on.

I’ve written about an alternative way to do Xojo with git: http://www.tempel.org/Arbed/SCM

I have a short blog post about using Xojo with Git here:

http://flightgeekjustin.wordpress.com/2013/04/30/using-git-tips-with-real-studio-xojo/

I’ve been using SourceTree most of the time for all of my Xojo projects and Git repos, and love it.

I didn’t see it mentioned so far, so I’ll say it here:

You’ll want to save your Xojo projects as “Text” (“Xojo Project” in the save project dialog) format and not in the “Xojo Binary Project” format to work with source code management/version control systems like Git and SVN.

External items can only be saved as XML currently versus just text. There’s a feedback feature request to allow external items to be saved in text format for easier use with SCMs for diff’s here:

<https://xojo.com/issue/3624>

Text format and GIT should already be showing you all your code changes
We’ve worked really hard to fix a number of the issues that existed so the only thing you see is what you changed
(and yes that sometimes includes view behaviour and tab order changes as you move a project forward through various versions of Xojo)
But those are important just as much as the code you write

Maybe slightly off the topic for this thread but, I (still) have trouble wrapping my head around Git and more specifically the need to view differences in Git or the like.

I will say it seems like differencing is what causes some of the troubles for Xojo users who are using Git or others. I like how Arbed is geared specifically for viewing differences in Xojo files as opposed to how they are displayed in other “general purpose” solutions. It seems like anything else is unusable by comparison. But what is a real world practical application for viewing differences? How are some of you using differencing in your day to day version control?

Also is merging really even possible under any circumstances for Xojo projects without a lot of manual work?

[quote=59341:@Norman Palardy]Text format and GIT should already be showing you all your code changes
We’ve worked really hard to fix a number of the issues that existed so the only thing you see is what you changed
(and yes that sometimes includes view behaviour and tab order changes as you move a project forward through various versions of Xojo)
But those are important just as much as the code you write[/quote]

Thanks for that update Norman. I haven’t tried the VCP format in a while since there are so many files it creates vs. the one Xojo Binary. I have been lazy and not because I had previous VCP issues. :slight_smile:

Thanks for all the answers. They’ve been very informative.

And yes it’ll be wonderful when external classes can be something other than XML.

No troubles here - diffs are easy to read

For us in SVN it lists
the file modified
who modified it
line preceded by - are ones being removed and replace by the following one preceded by +

AND - you can take that “diff” and apply it to another branch roll it back, hang on to it til some time later etc
Its stunningly easy once you do it

[quote=59353:@Joseph Morgan]I like how Arbed is geared specifically for viewing differences in Xojo files as opposed to how they are displayed in other “general purpose” solutions. It seems like anything else is unusable by comparison. But what is a real world practical application for viewing differences? How are some of you using differencing in your day to day version control?
[/quote]
We use SVN for all kinds of things
The IDE (obviously) and all our internal & external tools including images & other binary items etc
Our web site

Pretty trivially

And BEST of all with a tool like SVN when we have the inevitable situation where “Hey we found a bug & it appeared after check in # X” -I can very simply roll back to a version before that check in and then grab each new revision & see what caused the bug.
Having done this without GIT once upon a life time ago I cannot imagine doing this any other way with multiple engineers working on a single product ever again.
Even for a single developer its invaluable and if you’re NOT using text projects with some VCS yer missing out on saving your sanity

Anything else is too much work to do what these tools do VERY well

[quote=59368:@Joshua Woods]Thanks for all the answers. They’ve been very informative.
And yes it’ll be wonderful when external classes can be something other than XML.[/quote]
SVN subproject - look it up
Then it too can all be in text
A little work to set up initially but well worth it after that

Thanks Norman. I’ll check it out.

Or you save them in binary format, thereby neither losing breakpoints nor having complications with external items, and use Arbed to view the changes as I pointed out in my post above. I’ve been doing this for years and am still happy with it.