GIT and Xojo help

Im starting to learn git, ive setup a repository in bitbucket (from MAC 1), cloned the repository in MAC 2. Then modified the project in MAC 1, and MAC 2 (no branching, both still working on master branch) pushed changes from MAC 1 with no problems. Then following this guide
http://www.atlassian.com/git/workflows#!workflow-centralized
from MAC 2 to push my changes
git push origin master (with the obvius errors, because the modifications made in MAC 1)
git pull --rebase origin master (some conflicts here)
git add -A (solved conflicts, and adding to stage, some of the conflicts where in the main rbvcp file, simply stagged the local rbvcp)
git rebase --continue (apparently everything ok)

before pushing, i checked the project fom inside real studio, and the thing is as follows
The sad thing, when i open the project in real studio in MAC 2, i see some duplicated objects in the project (i guess the ones not touched in MAC 2) the files are not duplicates, only the objects inside the project, it seem like some weird thing is happening to my rbvcp file.

Please help, this thing is driving me nuts, i really want to use real studio with git

by the way, i applied the dos2unix to the project files before working with them on git, also followed this guide
http://kellerfarm.com/life/rbvcp/

I use git with my RB/Xojo projects for years with this setup:

  1. I do not use the commandline but a GUI app, SmartGit, which gives me more control over what’s happening.

  2. I do not use the textual VCP project format but the binary format, because that ensures that I cannot accidentally damage the project file as it’s possible with the textual formats (and which you probably had happening).

  3. I use a program I wrote specifically for this that shows me the changes between versions, along with merging them in a safe manner (= keeping the projects intact): Arbed.

I’ve described the entire setup here, give it a try to see if that suits you better:

http://www.tempel.org/Arbed/SmartGit

The only downside of this solution: In order to merge changes with Arbed, you’ll need to buy a $59 “basic” license for Arbed from me. But even without that, you can still merge changes by hand, it’s just more work. Note that this merging is only necessary if you create conflicts, i.e. if you make changes on both Macs without first pushing/pulling them to the other side.

Thanks for your kind answer Thomas, but i need a workflow for a team development. I was using git as a lone developer with no problems at all. The conflict arose when we tried to make it work for a team of 2 developers.

Do somebody has team experience using GIT an real studio, what kind of workflow do you use?, and do you had the same problem as me (duplicated objects in the project)?

For MacOSLib and Windows Functionality Suite, we use GitHub as the central repository. I also use the standalone GitHub app, but that’s not strictly necessary, I just find it simple in its basic functionality. And we’ve never seen these errors.

Personally, the workflow I use is as follows: I cloned the master repo to my own repo, then branched it. The two branches I have (using MacOSLib as the example) are “master” and “macoslib-master”. When I make changes, I make them to “master”, then send a “pull request” to the master repo. After someone merges my changes, I do a pull request from the master repo to my “macoslib-master” branch. Since that branch is only ever updated from the master repo, there are never any errors.

Finally, I merge “macoslib-master” into “master” and deal with any errors locally (there shouldn’t be any, but just in case). If there are any changes to the master repo while I am in the midst of my own changes to my “master” branch, I pull those changes into “macoslib-master” and merge them into my changed “master” first. By doing it this way, everyone can deal with the errors on their own ends with their local copies.

Huh? I didn’t say you can’t do that with my proposal. All I said is that you may have to pay $59 for Arbed to enable the feature you’ll need for this to work well. :wink:

Your workflow was not wrong. What was wrong was that you trusted git’s automatic merging to get it right. It can’t, always. If you mix vcp files on the source level, especially the main vcp file, you’ll easily end up with this mess.

But you’d have the same happen with any text files. Not just with RB.

That you need to do is not use the cmdline for merging of conflicts. Instead use a tool that helps you resolve the conflicts manually. That’s where tools like SmartGit or SourceTree come into play.

The problem with RB’s VCP format is that it’s not well enough structured and organized to prevent these duplications that you’re seeing.

Here’s an simplified example. Imagine the items a to d being paths to files in your vcp project, e.g. to other class files.

File 1:

a b c d
File 2:

a d b c

As you can see, d just got moved (that’s one of the flaws I was speaking of - the IDE does this often).

Now, if you merge this automatically, you’ll get this:

a d b c d
You end up with TWO “d” items in your project (sadly, the IDE won’t spot this mishap, either, but even if it did, it wouldn’t know how to solve it).

Instead, if you use the conflict merger provided by SmartGit, it’ll highlight for you these two different “d” lines, and you’ll have to spot that they’re not both added but just moved, letting you choose to keep only one and remove the other, then save and thus resolve the conflict.

(Note again: The above is not a true example - this one might, in fact, properly be resolved, but once there’s a few more factors coming in, it’ll go wrong nontheless.)

Now, if you’d use the RBP format and therefore used Arbed for merging of such conflicts, Arbed would take care of keeping the project structure intact for you, not allowing such nonsense even to occur, because Arbed looks at the entire project like the IDE, not like a text editor that doesn’t know anything about the code.

I’ve never seen the IDE arbitrarily move items in the VCP manifest without some kind o user interaction to cause it.

Not without user interaction, right. But just delete an item and hit Undo - does it reappear in the same position as expected? No.

But I have to admit that I confused the IDE’s behavior with Xcode, where this happens more easily (i.e. when I thought of the example, I actually thought of the many cases where this happens to me in Xcode, not in RB).

I’m using a Raspberry Pi as a central Git server. I’m also using SourceTree to manipulate the local Git repository on my development machines. SourceTree is available for Mac and PC for free and it nicely handles the git-flow branching model.

Hi Eric, I want to setup my VPS on www.digital ocean.com as Git server. how do i go about it. I already install git there but have no idea how to proceed after that.

I create a empty bare repository on the server and then I clone it in every machine I will be working on with this project.
The creation on the server side is done in command line:

mkdir myNewProject.git cd myNewProject.git git init --bare
The last line should return the path of the repository needed to build the SSH URL.

And then in SourceTree I clone it via SSH with its URL:

ssh://user@serveraddress/home/user/git-repo/myNewProject.git

Of course, you may have to adapt the URL depending of your configuration.

So, if the flow im using is ok, why i end with this mess?. Ill start the repository from scratch to do some test. Thanks for all your kind answers.

thanks… eric… will try it out…

thanks Rric… got it working with my rbp

I’m glad to hear it.