r/programming • • Nov 16 '13

What does SVN do better than git?

http://programmers.stackexchange.com/questions/111633/what-does-svn-do-better-than-git
599 Upvotes

494 comments sorted by

View all comments

97

u/badsectoracula Nov 16 '13

SVN provides better control for the project, allowing locks (crucial when working - for example - on games where there are lots of binary files that should be touched only by a single person, who is usually "the owner" of the file). Also when you work with non-coders (in gamedev, that would be artists, sound engineers, musicians, etc) you really want your tools to be as frictionless as possible because if there is a possibility to do something wrong with the VCS, someone will do it. Finally Git can a a major PITA when working on huge (multi-GB working copies) repositories and would require frequent trimming to the head if your local copy is on a small SSD.

Of course this isn't specific to Git vs SVN, but more to DVCS vs CVCS and would work the same as a comparison between Hg vs Perforce.

At work (if you haven't guessed it already, i work at gamedev) we use a CVCS and while i'd really love to have the ability for DVCS features (especially doing short-lived branches for bug fixes or features), but the benefits that the CVCS gives outweight the negatives. Being able to save the artists from stomping over each other's work while working in the game editor by simply popping up a message that "you cannot modify this file because it is checked out by XYZ" or showing in the editor's asset browser that some assets are out of date because someone uploaded new ones is a good thing. Also linear versioning makes easier to communicate with the users/artists/designers ("the new feature that doesn't crash your editor will be available at 234783" -- the users know that any version number after that will also contain the feature).

Of course at home for my pet projects i just put everything into Fossil repositories. I tried to convert my local work copy (which has over 100GB of data) to Fossil at some point but Fossil was unresponsive for ~40 minutes before i decided to kill it :-P.

7

u/mpyne Nov 16 '13

you really want your tools to be as frictionless as possible because if there is a possibility to do something wrong with the VCS, someone will do it.

As a case in point, we at KDE recently had someone briefly break a git repository because they tried to git-revert a merge commit.

We had it cleaned up pretty quickly but those types of minor gotchas with a system as powerful as Git pop up from time to time. Overall the additional power is very useful to us in KDE but I can see why you'd want the dumbest possible software that gets the job done in other situations where you only need version control and not the additional features Git provides.

28

u/trezor2 Nov 16 '13

Of course this isn't specific to Git vs SVN, but more to DVCS vs CVCS and would work the same as a comparison between Hg vs Perforce.

Absolutely.

And for the people who haven't sat down and tried to comprehend how DVCS can work at all (because it's not obvious that it can), DVCS looks like a scary, scary thing with no rules and absolute potential for anarchy.

Now, you might say that this is narrow-minded, but it's easily the default mindset. And not everyone is a programmer yearning to be on the bleeding edge. Heck, not everyone is a programmer.

If you need a team of all kinds of participants to be able to work together efficiently, you want something which causes a minimum of confusion among the team members.

Designers, testers and project-managers writing specs, requirements and other documents needs to be able to work with this as well. I'm not going to try to teach them DVCS. To them, using regular CVCS is hard enough.

7

u/AnAge_OldProb Nov 16 '13

Of course this isn't specific to Git vs SVN, but more to DVCS vs CVCS and would work the same as a comparison between Hg vs Perforce.

That said there are even more specific reasons to go to particular technology.

SVN is FOSS, therefore cheap to run, and lots of people know it already.

Perforce is even better at managing the big files than SVN because you don't need to sink down the entire code base and is great for enterprise because you can permission parts of the depot.

6

u/BinaryRockStar Nov 16 '13

Perforce is even better at managing the big files than SVN because you don't need to sink down the entire code base

What do you mean by this? SVN lets you retrieve part of a repo, a single file, anything you want.

great for enterprise because you can permission parts of the depot

SVN can apply permissions from repo-level down to file-level. Again, what do you mean?

1

u/[deleted] Nov 16 '13

The same could be said for operating systems... You seem to still be using one of those.

10

u/contrarian_barbarian Nov 16 '13

Being able to save the artists from stomping over each other's work

Last day of work before going to a new job Hey Mr. Artist - I found out about a neat new git command. It's called push --force...

17

u/e40 Nov 16 '13

You can easily make force pushes rejected (by a general repo shared by all). We did it on day one.

→ More replies (3)

5

u/[deleted] Nov 16 '13

Regarding binaries: Git can't even handle large binary files well enough to make it worth using in game development. Source: see my username, when our Perforce server exploded I once tried to switch us to Git for a short period, but we frantically ran back after two weeks when Perforce came back online. Git just choked on large binary files, to the point it was unusable or outright failing.

The compromise is to have SVN for the artists and Git for the programmers, where the programmers push their changes to SVN from time to time.

2

u/civildisobedient Nov 16 '13

If you put everything in the same repo, sure. But couldn't you separate the code from those larger binary assets and put it in separate repos?

7

u/[deleted] Nov 16 '13

The problem is that when there's gigabytes of history data, every git clone has to fetch all of it, which ends up having a large space overhead. SVN doesn't do this, so ends up slightly nicer for working with large files.

Separate repos only helps the case where you don't actually want to get the file, not when you don't want the history of the file.

We've split off our source code and large files in to git/svn too, and works pretty well.

3

u/[deleted] Nov 16 '13

Git just can't deal with large binaries. It's an open bug, there's a patch available, but iirc, Linus refuses tointegrate it.

3

u/__orion__ Nov 17 '13

Linus isn't involved in the development of git anymore. Junio Hamano took over development and maintenance nearly 1 year after Linus released the first version of git.

2

u/[deleted] Nov 17 '13

This is why for large files you use git-media or git-annex, which are designed for large files.

→ More replies (7)

5

u/expertunderachiever Nov 16 '13

You realize with Git if you transition to a non-shared repo model you can have all these sorts of controls you're looking for right? See: Linux Kernel.

15

u/f2u Nov 16 '13

Not really, there is no locking in a truly distributed system, and of course no linear versioning.

19

u/moor-GAYZ Nov 16 '13

and of course no linear versioning.

That's not true. You can have linear versioning if you want.

5

u/seruus Nov 16 '13

And it isn't that hard to do if you ask all contributors to rebase before pushing the changes/sending a pull request.

→ More replies (2)

0

u/[deleted] Nov 16 '13

[deleted] — view deleted comment

8

u/[deleted] Nov 16 '13

I hear this "SPOF" argument all of the time but I just don't see it.

Let your ops people handle the redundancy and backup of your data, not the developers (consumers) of that resource.

3

u/LovelyDay Nov 16 '13

Veracity is a DVCS which has file locking.

Disclaimer: I haven't used it, so can't speak to how well it works.

2

u/Klayy Nov 16 '13

What do you mean by no linear versioning? If you only use one branch it's quite linear indeed.

I don't have much experience with locking in SVN - is it done automatically after someone modifies a file? Or do they have to lock manually?

5

u/[deleted] Nov 16 '13

The way that people typically use SVN locks is to set a per-file property that enforces locking. All such files will be set to read-only in an OS-specific way unless you own a lock on them. svn lock tells the server "hey, I want to lock file X" and allows you to write to the file. If anyone else locked it, you'll get an error stating so and you move on to something else.

You can also manually lock any file in which case they'll be read-only for everyone else after they next update. Manual locking generally isn't such a great idea because you have no guarantee that the other team members saw the lock; still, the server will prevent commits to those files, so it could be useful sometimes.

→ More replies (7)

1

u/[deleted] Nov 16 '13

Git hooks can help with a lot of these concerns.

→ More replies (12)