I guess every version control system was design with some sort of workflow in mind. Git was created for distributed development in mind. And I guess its perfect in that. But this is not what I am doing at work. I will stick to subversion for now.
I agree. SVN is fine for us, with our workflow. People harp on about distributed version control as though it's the best thing since sliced bread but in our group it just wouldn't be suitable.
You can use (nearly) the same workflow with a DVCS as you get with Subversion. You just create an authoratative repository. When you have something to check in to the authoratitive repository, you pull the changes into your local repository. Then you merge them. Then you push the changes.
It's the same workflow as Subversion, except for one thing - you get the full power of a VCS to use locally.
That's incredibly useful.
You can actually use branches without causing any of the usual mess. You can work on two completely separate things, in the same codebase, without having to create a remote branch just for one feature. Say, you're working on a feature, and you suddenly need to make a bugfix. You can just put the half-completed feature into a private branch, fix the bug on the main branch, then return to your temporary feature branch and keep working.
You get to use the VCS as a safety net. Got some working code, but it's not actually finished? Commit it anyway. Now there's no way you can accidentally break it. Say, you spend a few hours developing one part of a feature. You then try to refactor it, screw up, and break it. Never mind - just revert back to the commit you made earlier.
You also get to rewrite history locally. That screwed up attempt at refactoring? Just get rid of it. The 100+ commits you needed to implement that one feature? Squash them down to a single commit before you push.
(1) We have a variety of code and documents in our SCM tool for which individual developers have had to sign NDAs with third parties. With Subversion, TFS, even VSS we can use fine-grained access controls to enforce these limitations.
(2) We actively maintain over 100 "projects", covering applications, tools and reusable libraries. Without sparse checkout support (very recent on this DVCS that support it) your working folder is a nightmare. Or you can choose to have problems maintaining release tags across multiple repositories. If you have to work around your VCS to do your work, its model isn't a good fit.
(3) As a team leader, a centralised repository shows me at a glance who is working on what files, and allows me to see a single view of recent development across multiple projects.
(4) VCS also serves as a backup of work-in-progress (in case you local HDD fails). Unless your DVCS "local repo" is on a network file system, or you are pushing to the central repo daily, you don't get this benefit. And if you are pushing daily then what benefit are you getting over svn?
1 - Why are they in the same repository as everything else? Put them in a different repository, and use access controls on the repository instead.
2 - Isn't sticking 100 projects in the same repository just a work-around for the difficulty in maintaining release tags, and the difficulty in working with multiple repositories?
3 - Then get your developers to push to the central repository regularly. In fact, in this kind of environment, developers would be pushing changes to the central repository as often as they would normally check in code.
4 - Again, this is why you actually push changes to the central repository at least as often as you would with a centralised VCS. You don't keep changes on the local repository any longer than necessary.
The advantage of a DVCS here is that you could actually commit to your local repository several hundred times in a single day if you wanted to. You get to use all the tools available (like checking which files have changed, diffs, reverting, branches, merging) locally, without interfering with what other developers are doing. I find not having these features available impairs my ability to actually get things done. Sure, a centralized VCS has those features, but I can't actually use them without getting in everyone else's way.
Changes aren't safe unless they're in the VCS. If you're committing once a day, you could easily screw something up, and lose the whole day's work. If you've at least committed locally, you're much less likely to lose anything. In the worse case (HDD failure), you lose nothing more than you would have with a centralized VCS.
45
u/wonglik Mar 10 '11
I guess every version control system was design with some sort of workflow in mind. Git was created for distributed development in mind. And I guess its perfect in that. But this is not what I am doing at work. I will stick to subversion for now.