Subversion vs. Git: Myths and Facts
svnvsgit.com
svnvsgit.com
Totally misses the point that the expense of branching and merging in Subversion is all in the UI/UX. Not only is it horribly cumbersome, it's also much easier to get it wrong, not obvious that you are getting it wrong, and harder to recover once you've discovered you've got it wrong.
$ cd trunk-wc
$ svn cp ^/trunk ^/branches/my-topic # create my-topic branch
$ svn switch ^/branches/my-topic # switch working copy to my-topic
$ # Hack away
$ svn commit -m "My awesome new feature."
$ svn switch ^/trunk # switch working copy to trunk
$ svn merge ^/branches/my-topic ^/trunk # merge topic branch changes to trunk (a)
$ svn commit -m "Merge awesome feature from my-topic."
In step (a), resolve any conflicting files with svn resolve; to start over, do svn revert [-R] (granted, new files will be left behind and there's no git clean equivalent AFAIK). With the exception of svn cp, all the commands are self-describing (and with svn cp, someone argued in the BK open-sourcing thread that "a branch is a copy" model is fairly intuitive for even non-technical users).I concede that git is more powerful and supports different branch / merge workflows than svn, but svn's hardly horrible.
But my whole point is that there's far too much scope to get it wrong in ways that can be difficult to fix.
If you have multiple projects in your repo, svn cp and svn switch become cumbersome.
Many people check out the root folder with the entire structure and all the branches, and not just trunk.
I've seen projects that have nested branches/tags/trunk structures.
I've seen people check code in to two branches at once.
I've seen people "branch" by physically copying the files client-side then checking in the result. Losing the relationship between the branches that they need to merge successfully.
If you check in the merge then find you've messed it up, you can't roll back and start over without cluttering up your source history. And even then, how to do that is non-obvious and easy to get wrong.
And people DO make these mistakes repeatedly because svn treats branching and merging as an advanced technique. The first several times you do it, you invariably mess up, and leave a permanent record of how you messed up. Very often it's not you who learns that you've messed up but a colleague who does the merge. And once you learn to get it right, someone else on your team comes along and they get it wrong. The feedback loop is terrible.
Whereas with git it's a core competency so you learn you've messed up fairly quickly. And offline commits let you easily roll back when you do. The feedback loop is rapid and effective.
Instead of 32,647 commits, the number at the time I cloned it was 37,304 (`git rev-list --all | wc -l`), or 34,165 reachable from HEAD (`git rev-list HEAD | wc -l`), yet the total size was 162M (`du -hs .`) -- a bit smaller than the 169.7M cited in the article.
Further, if I re-compress everything (`git gc --aggressive`) then the total size decreases to 117M. That is a sizable difference to begin with -- and doubly-so given that it represents more commits than either of the repositories in the original comparison.
I could counter argue with many reasons why git/hg/perforce/cvs is superior but it misses the core point about any VCS. It's about team collaboration and different tools suit different teams.
Specifically if I am taking the train into work, connectivity is spotty, with git I can commit as many times as needed against my local offline repository then push it once I am online.
That didn't used to be true with Subversion, but it may have changed. Thus my question.
Shelving and checkpointing have been planned for Subversion for several years now and though they're currently slated for version 1.10, currently in development, work on those features hasn't started yet. Given that it's been bounced from 1.9 already, and that Subversion release cycles are measured in geologic eras, I'm not holding my breath.
[1] http://svn.apache.org/repos/asf/subversion/tags/1.9.4/CHANGE...
Being able to commit first and then care about conflicts second is my biggest selling point for DVCS (git/hg).
And sometimes there's another conflict...
The workaround is ridiculous. Trunk should be what's already deployed to prod and known to work.
More seriously, some interesting myth busting, but I still prefer a distributed model.
Don't you mean an outdated fact, since it was true.
> Certain workflow limitations exist.
Also true of SVN. I'd argue it is more true of SVN than Git, but whatever.
> Git history is not safe
You gave so much leniency to subversion for half-truths earlier, but you're going to come down on Git for this? `rebase` does not destroy history. `commit --amend` does not destroy history. `filter-branch` does not destroy history. The old commits are still there. You can easily find them with `reflog`. `reset --hard` doesn't even add new commits, just changes where a branch pointer points.
As identified by others in this thread, this is really cherry-picking the issues and totally ignoring some major flaws and drawbacks specific to SVN that led to DVCS's in the first place.
If it wasn't already obvious that this was a biased piece, you include only negeative experiences with git in your "further reading" section.
Sometimes it's OK to just say one thing is better than another.
[diff "the_file_extension"]
textconv = the_conversion_tool
binary = true
You just need to find/write the conversion utility you need. iconv could do that with `iconv -f UTF-16 -t your-terminal-encoding`What you can do is apply the binary filter I posted to all files and write a script which attempts to guess encoding and then translates that to utf16 with iconv. But expect funny failures from time to time (sometimes more than one decode may be valid)
“you can do is apply the binary filter I posted to all files and write a script” — yes, I know git is open source and very flexible. But Unicode is 20 years old standard widely accepted by the industry. Git should support Unicode out of the box, without my custom scripts.
Does this still hold true now that GitHub handles large binary files? https://github.com/blog/1986-announcing-git-large-file-stora...