Posts Tagged version control
Git time!
Posted by visual77 in programming, visual77 on September 1, 2011
In the past few weeks, I finally have had the chance to start using Git. I’ve been mildly interested for about a year now, ever since a coworker of mine left the company and began using Git at his new company, but the sheer momentum of my company’s Subversion repositories was a big hurdle to overcome.
I was finally forced to move something onto Git when I put my statepicker module onto drupal.org, and Git was their only available VCS. After making the switch, and learning Git, I definitely agree with the general consensus that Git simply is better than Subversion. Having a DVCS just adds an incredible amount of flexibility to how repositories are set up, maintained and shared.
So on that note, I’ve begun to actually use the github account I set up a few months ago. The first thing I’m putting onto it is the repository for my Drupal rebuild of visual77.com. As far as future projects on it, the only other thing that I still want to do at some point is my Team Liquid Browser Extension. I’ve been unable to touch that since I first mentioned it because I’ve had very little time lately, but that isn’t a stillborn concept.
Lately, I’ve been having a hell of a time with Subversion
Posted by visual77 in programming on June 26, 2009
When I first got into source control, it was with a team who had no experience with any form of source control. We initially chose CVS, but over the past year, we eventually migrated to Subversion due to it’s more elegant setup with branches, tags and revisions. In this time, we have four main projects on Subversion: corporate intranet, main website, client software, Septuro. The last two are pretty traditional setups, where our file tree looks something like this:
/software
/trunk
/releases
/1.0
/1.1
/branches
/restructuring
/tags
/1.0.0
/1.0.1
/1.1.0
/1.1.1
Anyone familiar with Subversion will recognize this setup as a very normal setup. We use trunk to add new features, branches to do major work that will destabilize the project for awhile, releases for maintenance work and tags for snapshots of individual releases. This system works fine when you are actively maintaining multiple releases – where the software is being deployed to a large number of sites.
However, our intranet and main website repositories have to be laid out differently, due to them not having multiple releases. Each system is deployed to exactly one location – the local web server. This has caused some issues with how we should lay out our repository. As of right now, it looks like this:
/intranet
/trunk
/release
/branches
/front-eod
This system ditches the traditional releases folder setup and uses a single folder called release in its place. This folder is where we keep our maintenance, and at any time, the web server is updated to the newest revision of this folder. This system works okay, until it comes time for releasing new content – unlike a traditional releases setup, we don’t simply clone trunk to a new folder and label it, since the previous folders would be completely unneeded as they are never being used. Instead, we try to merge changes on the trunk over to release, but this is sometimes problematic.
The big problem, however, is how to deal with large projects that should go on a branch. When dealing with branches, you want to make sure they don’t stray too far from one another, or from the trunk, so later merges are as painless as possible. You lay out your milestones (points where it is convenient to merge back into trunk without breaking trunk) and make sure you periodically merge from trunk back into the branch. This gives you time to make sure the branches play nicely, as well as get bug fixes from your maintenance branch onto your feature branches.
What happens when you are working on a large feature change, and halfway through the project, a smaller feature must be quickly pushed through and made live? You can’t just do a new release, because it may have some milestones from that incomplete project! How do you make sure that each branch never strays far, yet there is no sign of a new feature until it is done and approved? That dilemma is what my team is trying to sort through.
Our current idea is to get rid of the release branch and make all milestones disabled by default. Instead of using a release branch, just keep the webserver running from trunk and put all new features in branches. We will lay out milestones out as usual, but all of the new features will be disabled in these milestones – new menu options are hidden, changes in processing is not implemented, etc. The final milestone will be a change that will enable all of these new features. This will allow each branch to keep up to date with each other, but keep incomplete features from being put on the webserver.
I hope this system works. It is our current attempt, but far from our first attempt. I ‘ll keep you updated on what happens.
My department is finally off CVS and on pure Subversion
Posted by visual77 in programming on May 14, 2009
As of about 30 minutes ago, my department at my day job is now completely off of CVS. We started our version control on CVS about a year ago, but over the course of the past month, we have fully transitioned to Subversion. Most of the switchovers were fairly easy, since only one project had an outstanding feature branch that needed to be carried over, but I brought over those changes yesterday thanks to the diff and patch functions.
It was actually quite easy. I did a cvs export of that branch at it’s tip and at it’s branch point, ran diff between the two to get what changes were made throughout it’s lifetime and saved that as a patchfile. I then went into the Subversion working copy, ran svn copy on trunk to create this new branch, and used the patch tool to apply the changes in that patchfile. I made sure all worked and committed. With that (and some work today on our last project that was still on CVS), we now are completely done with CVS.
I really could not be happier about this change. Subversion is a far superior system, and best of all, very command line friendly. With CVS, we all worked through a GUI (CrossVC was our GUI of choice), but with Subversion, we just run everything through command line.
My only gripe with Subversion (although CVS is no better) is the inability to commit chunks of files, rather than whole files. I’ve begun developing a workaround that I will post this weekend that involves a temporary checkout, running diff between the working copy and the pristine copy, modifying the patchfile to only contain the areas of interest, and applying the patch to the temporary checkout. You then commit with your note, remove the temporary checkout, update the real working copy, and you’re set. I’m having some issues with patch not liking the modified patchfile, but once I work that out, I’ll post a tutorial on how to do this.
Subversion – I love you
Posted by visual77 in programming on May 5, 2009
I first began using version control just about a year ago. I jumped into CVS initially, although I’ll be damned if I can remember why. I had just been promoted to development manager at my company and we had no version control, none of the three devs knew any version control, but I knew we needed to use it. I picked CVS for some reason long forgotten, probably more random than anything, thinking any version control was better than none (which is true).
About a month ago, I switched the department to using Subversion. I can’t believe how superior it is to CVS. Branching and tagging is done in a more sensible way, where each branch is just a folder on the tree, access through Apache is easier to set up and and easier to use, and command line interaction is way more friendly on Subversion than CVS. My department uses Linux exclusively for development machines and servers, so ease of use on the command line is quite nifty.
I also prefer the way subversion does its revision numbers. Each file having a revision is a bit non-sensical, since often times a file will remain revision 1.1.1.1 for nearly the whole life of a project. I like this revision number applying to the entire tree, instead. It gives you a better view of changesets, and if you make each revision a single, discrete unit of change, reverse integrations from release to trunk and back to branches is super easy.
Subversion, I love you.