We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
git or SVN with Processing? (Read 3894 times)
git or SVN with Processing?
Jul 3rd, 2009, 9:59pm
 
Hello,

So everything I've learned so far about coding I've learned through Processing first. I think the next thing I should figure out is some kind of revision control system (git has been recommended over SVN).

Do people use git with Processing? How do I get started?

(Sorry, this isn't so much a suggestion, but I figured it was better here than in the Syntax forum.)
Re: git or SVN with Processing?
Reply #1 - Jul 4th, 2009, 12:49am
 
Excellent topic! Although indeed it is not really the right place, perhaps Integration would have been a better place.

I won't recommend a VCS (version control system) over another, as it depends on needs, taste, system you use, etc. I will try and give some (a bit biased...) advices for choosing.
But I heartily recommend using a VCS, whatever your choice, to allow you to do mistakes and go back, compare your code to older one, share it over several computers, etc.

I am on Windows, I needed a SCM (source control management, that's the same thing! let's make keywords for searches...) as single developer, needing sometime to share my source between several computers (or at least to access it).

I tried TortoiseSVN, the tool to integrate SVN to Windows Explorer. It isn't bad, but there were some shortcoming so I didn't use it as much as I should. Something that annoyed me was to have a .svn directory in each of my sub-directories of my source, with mirror copies of my files, making searches (with grep-like tools) harder... That, the fact to have also central copy of the sources, the uncomfortable renaming of files, etc.
I abandoned it but still have command-line SVN executable handy to checkout sources like Processing one: it is still a widely used system.

I then have heard (again) of DVCS, distributed VCS, with the great trial of Git vs. Mercurial vs. Bazaar to manage the source code of Python (the language).

These DVCS have only one directory (the repository) at the top of the branch (your source directory -- I have to simplify / abuse some terms, sorry for the purists!), and no central place. Their philosophy is to allow branch usage without being connected to a central server, and even cloning of source directories to allow testing funky ideas, to be integrated later or deleted if unsuccessful.

I searched a lot the Net, comparing the three.  Warning: always look at the date of the articles you can find: DVCS are (relatively) young and rapidly evolving, so some shortcomings you might see might have already disappeared or reduced.

I discarded Git, widely used, created to manage Linux kernel source, because it had a reputation of complexity and high learning curve. Plus I was put off by the partial support of Windows at the time. I didn't felt it was suited for a nearly beginner like me -- although I use another VCS at work: Perforce. Centralized (too much for my taste/needs), powerful, commercial (free for open source software).
Git is said to be very fast, being written in C and is quite widely used.

I briefly tried Mercurial (Hg), written in Python with C parts for speed. It is nice, have good doc., but I was uncomfortable because it was putting heavily the accent on multiplying the branches for development, a workflow I don't feel suited to my habits.
It is used by numerous projects (I kept Mercurial binaries for that) and has a number of sites proposing Mercurial hosting.

Then I discovered Bazaar (Bzr), and I was seduced by some advantages over their concurrents: they manage directories as other files (they are just containers for other systems), gracefully handle renaming and moving (it is often a double operation in other systems: delete old name, create new name...), can handle dumb servers (with FTP).
As I read the excellent documentation, I was also seduced by the various workflows they proposed: individual programmer (my case), team with or without control of what goes on the main source, central scheme or distributed one, etc.
I liked the flexibility and overall philosophy. As I wrote above, it just fits my needs, but it is worth for you to take a look at all offerings.

Bazaar is written in pure Python (good for portability), with a cost on speed, although it appears they made giant steps in improving the gap with the other VCS. It is evolving very fast (nearly a new version each month), and has a lot of nice plugins. One of them, very young but promising, is Bazaar Explorer, a GUI to help managing repositories. There is also a Tortoise version for all the above SCMs, but on old computers like those I use, they slow down Windows to a crawl, or even crash it.
One downside of Bazaar is that you will find much less public hosts (to manage your source online) than with Mercurial or Git, but the main one, Launchpad, is excellent: I can use it for my small Processing sketches (and my JavaFX, Java, Lua, etc. experiments, too) without creating an official project (but they have to be public, though, if I don't pay for that. That's not a problem for me). Thus I have a central place allowing me to synchronize my computers. I can do that on a simple USB key too.

For the record, there are some other alternatives, less used, like Monotone, Darcs, Fossil... Some of them are one executable only, making them handy for use on USB key...
Re: git or SVN with Processing?
Reply #2 - Jul 4th, 2009, 1:59am
 
I am using svn with the processing and arduino ide
works quite well, simply import the sketch and set
the generated folders like "applet" or "applcation" on ignore
Re: git or SVN with Processing?
Reply #3 - Jul 9th, 2009, 10:22am
 
I also use SVN (through the tortoise client) and it's alright. I set up my own server with apache because I was doing web development at the time but I know there are easier ways to set up a server on a Windows machine. On Linux it's even easier.

I like the sound of Bazaar though, I need to try that!
Re: git or SVN with Processing?
Reply #4 - Jul 10th, 2009, 4:47am
 
When I tried SVN, TortoiseSVN took care of the server part, it was quite "transparent". I was reluctant quite some time to use a VCS because of this "server" stuff, as it sounded like I needed a separate computer or something rather heavy to manage...

WebDext wrote on Jul 9th, 2009, 10:22am:
I like the sound of Bazaar though, I need to try that!

What is nice with Mercurial or Bazaar, is that they are not intrusive: you can even have a repository in parallel with SVN or other!
For example:
> cd <tip of your source>
> bzr init
> bzr add --dry-run # to see what will be versioned
> bzr ignore *.bak # for example, or edit .bzrignore
> bzr add
> bzr commit -m "First version of code"

And you get a .bzr repository at the top of the source hierarchy.
You can play a bit with code, then do:
> bzr status # See what files has changed
> bzr diff Foo/Foo.pde # See what lines has changed
> bzr add # Add new files
> bzr rm Junk # Remove bad stuff
> bzr mv Notes.txt Tips.txt # Handle renaming nicely
> bzr commit -m "Bug fix and reorganization"
> bzr log # See the summary of last changes

Note: after the rm, you can restore Junk, of course, that's what a VCS is for! Likely, you can cancel your changes before commit, or go back to an older version, etc.

For example:
> bzr diff -r6.. I18nTest.java # See diff between current version and the one at revision #6 (commit nb)
> bzr revert -r6 I18nTest.java # It was better, go back
# You have to commit the revert or you can cancel it, etc.

And if you feel that this VCS isn't for you, you just delete .bzrignore file and .bzr directory, and your source is as clean as before! (but of course in the latest state you left it...)

Note: Bazaar for Windows comes with qbzr, a GUI for most operations. TortoiseBzr is still light on features (compared with TortoiseSVN) but bzr-explorer is promising.

Of course, you also have a central server, or just another branch, on local disk, another partition or an USB key, and push/pull (or checkout) from there.
Re: git or SVN with Processing?
Reply #5 - Feb 6th, 2010, 9:20am
 
I have found SVN with processing much better when it comes to coding. I still remeber the first application I created to book hotels online. If I did not know how to use properly SVN that would have been almost impossible!

Git is ok but strongly prefer SVN.
Re: git or SVN with Processing?
Reply #6 - Feb 6th, 2010, 9:23am
 
I totally agree! Processing with SVN is much more viable than git...
Re: git or SVN with Processing?
Reply #7 - Mar 16th, 2010, 4:17am
 
i can only suggest to take a few hours to walk through the first chapters of the git book:
http://book.git-scm.com/
there's even a video tutorial at the bottom of most pages.

once you have gotten to know it you really don't want to back to svn (which for me caused lots of trouble, even without any branching).
plus you have github, which is really fun to use.
Page Index Toggle Pages: 1