Live data from Hacker News

Bye Bye SVN, Hello Git

engineering.secondmarket.com

41–50 of 64 posts

Re: Bye Bye SVN, Hello Git

#41
post #11

Earlier quoted context omitted.

I was wondering if there was something new in here. Instead it's a tale of a company that's been living under a rock for the last four years.

Under a rock? Is git _that_ much better? I used to read about how it didn't need a central repository, yet this article, and github, seem to indicate everyone ultimately wants/needs a central repository. So git is worth switching just for branching/merging superiority? Maybe I don't do it enough, but svn has never let me down. Or maybe I'm not on a large enough dev team? Guess I'm really just trying to figure out if…

I agree. The entire Internet would have you believe that OSS just didn't exist before the advent of git. I like git and prefer it, but SVN gets the job done. My only real gripe with SVN is it makes it harder for those without commit privileges to commit. Within a company setting, that point is moot. A lot of the other anti-SVN sentiment is based around old versions of SVN. It still doesn't branch as fast as git, but it does have merge tracking.

At the end of the day, use what works best for you. If you want to test the waters, use git-svn. You can then work locally and then dcommit your changes when they're ready to go upstream. It'll give you a pretty good approximation of what git can do for you workflow-wise.

Re: Bye Bye SVN, Hello Git

#42
post #5

Is there a big performance boost for squashing when rebasing? Is it just housekeeping? I like what Paul Stadig had to say on the topic http://paul.stadig.name/2010/12/thou-shalt-not-lie-git-rebas...

It can make reverting a feature easier if the branch being merged had intermingled with master several times. You could avoid that by rebasing your topic branch before merging, but that's lying too. I personally never rebase unless I need to fix a commit message and I only squash merge if I had a series of ping-pong commits while trying to fix something.

Re: Bye Bye SVN, Hello Git

#43
post #33

Earlier quoted context omitted.

I've only just made the switch. Like most people I was stuck with SVN due to my employer using it, and refusing to update. Now I'm freelance I've had the time to put into learning Git and I'm glad I did, but the point is there are still a lot of people using SVN, some of whom will switch to Git in the future, and posts like this can be very useful to them.

> and refusing to update. How true this is. I spoke with one sysadmin who told me that even if 100% of the developers were using git-svn he would never allow git as the official location to store code on the servers and it must be pushed back to svn. I am not sure how to respond to people like that. Edit: When pressed for more details it was clear that he was happy with his svn server setup and didn't want to change…

"didn't want to change and have to learn something new"

Resistance to change might be an authority thing - you could just walk around this troll's bridge and see what happens. Try talking to his boss or higher about source control, casually. If his manager asked him to change to GIT he would do it. He might have dismissed you because he believes you're not in a position of power over him or the work required to switch is mundane.

Re: Bye Bye SVN, Hello Git

#44
post #3

It's 2012, not 2008. Why is the #2 story right now about a company that switched from SVN to Git?

It only shows that there are many development shops who have not migrated to a more powerful DVCS (either git or mercurial) and we ought to spread word about how inadequate centralized version control systems are.

I regularly run into dev shops (with code as the product!) that barely use "old style" VCS properly (e.g. CVS, SVN or TFS), and just refuse to look at git for a litany of reasons, largely boiling down to "our tools are magic, we are afraid of this new magic".

Re: Bye Bye SVN, Hello Git

#45
Historically with SVN, branching was skittish.

Really? How? I've always found Subversion branching to be painless, reliable, fast enough, and merges often go flawlessly, and it's really not been that hard to resolve merge conflicts.

Re: Bye Bye SVN, Hello Git

#46
post #3

It's 2012, not 2008. Why is the #2 story right now about a company that switched from SVN to Git?

I just started a new job, at it's the first time in a fairly long career I have had to use git instead of svn. The company I joined only recently switched to git too.

Thing is, I understand svn. I get it, and I have used it for years and know, almost instinctively now, what will happen when I use the various commands.

Git for me just feels overly confusing. I suppose it's just because I'm used to "the old way" but just take a look online at how many articles that are out there trying to explain how git works. Why are so many needed? It feels like there are many more than there are explaining how svn works.

By the way, I can see the benefits of git and I feel I'm getting the hang of it quite well now, but I still like svn :)

Re: Bye Bye SVN, Hello Git

#47
post #35

Earlier quoted context omitted.

I'd be more interested to hear about companies who switched from Perforce to Git. Perforce seems to be entrenched in more corporate environments.

Anything in particular you would like to know? I have done it twice. First at Trolltech where Qt was moved over (I want to say there are a handful of public blogs on this) and I have helped with a bunch of perforce/git migration/integration at RIM and consulted with various other companies.

Can you describe your largest migration, in terms of users affected and the repository size?

Did you experience some of the issues Facebook has?

See:

http://thread.gmane.org/gmane.comp.version-control.git/18977...

Re: Bye Bye SVN, Hello Git

#50

Earlier quoted context omitted.

Yes, git is THAT MUCH BETTER. I wish I had time to get in all the details about why git is better but I will leave you with two questions to ask your existing version control system: 1. How fast is your version control system? Unless you have tried git, you will not realize how painfully slow SVN (or any other VCS which has to talk to server) is. 90% of my git operations take less than a second. Now, you may say that…

I use SVN at home and in a 9-5. It's works fine. 1) Fast enough? I have tried git. It's pretty cool, but the difference between 5 seconds and 1 second is minimal at best to me. I don't think I've found myself dying for a faster SCM, though I usually make maybe 1 - 5 commits per day. Git on Win32 is meh compared to git on Linux, so that doesn't really convince me any further either. Git is also a PITA to compile on !L…

"1-5 commits per day"

Have you ever thought about why do you only have 1-5 commits a day? I do 70 to 100 commits a day. I commit each and every semantic change. I do not commit changes so that I have a backup of my code, I create a commit so that I can track my 'semantic code change'.

Let me give you an example:

Let's say I have a working website. The website has header/footer/content style. I spend one hour to customize my website layout by modifying html/css.

When I am done with header, I commit my HTML/css.

When I am done with footer, I commit my HTML/css.

When I am done with content, I commit my HTML/css.

During my work, I found a bug in CSS which fixes float in IE and I created another commit for this particular bug fix.

The most important point being that each of my commit is 'independent' and represent a meaningful unit of work.

You may ask, why create 4 commits instead of one? The reason is that git will let me use these commits anyway I chose.

It's 2.30pm and my manager stops at my desk and tells me that I have to fix the float but in IE 'RIGHT NOW' before the 3pm meeting. I am only needed to fix the float bug and nothing else because the website has to match with printed material for the meeting. How do you do it? Easy. git will let me 'cherry-pick' my last float bug commit and merge it in to current production branch. After merging the one particular commit, I test everything to make sure nothing is broken and I am all set before the 3pm meeting.

Obviously, this was a simple case. There will be cases where you can not just pick one commit as it depends on other commits. You will have to do more work to get the fix in. Git is the helping hand which can let you play with the commits to get the answer you want. SVN can not do that.

Going back to my point, I think you may not realize that you do far fewer commits than you should because your subconscious brain knows that commits are slow. Once your brain will realize that commit can take less than a second, you will automatically commit more often.

To give a unrelated example: Back in the day when we didn't have access to high speed Internet, we would consult local documentation only because searching online was slower than finding it locally. Now, with Google and high speed Internet, I have stopped downloading documentation locally and rely on Google to find it for me.

'caring about rename history'.

Again, this is dependent on the way you code. I like to re-factor my code a lot. I rename my classes whenever I find a better name. I move my code around in different folders as I find better way to organize my code. And as I re-factor a LOT, I DEFINITELY care about my code history. Git can track renames/folder movement and still show you the file history. You may not care about rename history now but you may care about it in future. With SVN, you have no choice. Git offers you that choice.

Now to your workflow comment. The beauty of git is that it is a 'content tracking' tool. You can use it to FIT any work flow you like. git does not force you to use any particular workflow. You can use it in the exact same way you currently use SVN. Or you can come up with your own workflow which no other team in the world uses. It's all fine.

Finally, the revision number comment. Generally, I haven't had a need to figure out which revision came first based on 'revision numbers' alone. But once again, git has an answer. You can use git describe command. It will give you something like:

"git describe gives you a version description like the following: v2.0-64-g835c907. The v2.0 part is the name of the latest annotated tag preceding the commit, 64 is the number of commits after that, and 835c907 is the abbreviated commit id. It is basically there to identify any revision in an exact and convenient (although technical) way."

From: http://stackoverflow.com/a/1817099/92414

And that's the beauty of git. Git already has a way to address your common concerns and if it doesn't, you have enough meta data to make it work the way you want to.

Once again, I really understand where you are coming from because I was on that side once. But I sincerely believe that git is a much better tool and it will change your life as a developer. It has definitely changed mine.

Please, please, do yourself a favor and at least experiment with git before dismissing it.

Post reply on HN