News for hackers. Stuff that matters.
Re:Torvalds: git vs CVS by nearestneighbor on Friday April 16, 2010 @06:00PM (#1272071)
I program solo, and for fine-grained version control, I use comments and conditional compilation, which I remove when the time comes. I also take periodic tarball snapshots of my code just in case.

Before you downmod me to -∞ for my uncouth approach, consider this:

According to Linus, Git > tarballs > CVS > SVN (he made a statement about tarballs being better than CVS somewhere else). That leaves Git and tarballs.

Now, Visual Studio is my primary development environment, and it does not integrate with Git (as far as I know), and Git just isn't well-supported on Windows (there are some fragile solutions). Secondly, I probably spent a whole day playing with Git where it's supposed to shine (OS X with GitX), and I just find it kind of awkward and unintuitive for no benefit.

Re:Torvalds: git vs CVS by solutionyogi on Friday April 16, 2010 @06:05PM (#1272090)
I use Git on Windows with Visual Studio and I don't face any issues whatsoever.

Yes, Git is not integrated with VS but I have no trouble switching to explorer and commit my changes using TortoiseGit. TortoiseGit scans my working directory and presents list of all the changes made in a session.

And yes, to be on safer side, I copy and store my working directory + Git to a different location.

Re:Torvalds: git vs CVS by nearestneighbor on Friday April 16, 2010 @06:12PM (#1272107)
Check out these replies:

http://stackoverflow.com/questions/1500400/is-tortoisegit-re...

It's not just the fragility and lack of integration, but also I'm just not seeing much of a benefit to counterbalance the complexity and awkwardness.

Re:Torvalds: git vs CVS by solutionyogi on Friday April 16, 2010 @06:36PM (#1272159)
Well, I have been using it for 'production' work for last 6 months and I have not found any issues. I am not suggesting that everyone will have the same experience but I think you should give it a try before dismissing it outright based on someone else's experience.

Also, if you could provide some real details on the 'complexity and awkwardness', I could share my experience which could be helpful.

Re:Torvalds: git vs CVS by nearestneighbor on Friday April 16, 2010 @07:34PM (#1272258)
> give it a try before dismissing it

Giving it a try can only prove the presence of fragility, not its absence :-)

Generally, people are very reluctant to criticize "hip" tools like e.g. Clojure, Haskell, Google Go, Git or its accessories. So, when 3 out of 4 people say they had problems with it, to me it weighs very heavily on the negative side.

Re:Torvalds: git vs CVS by wvenable on Friday April 16, 2010 @09:06PM (#1272376)
For the record, I agree with you on Git (on Windows at least). It's improved at a rapid pace but it's still a bit awkward.

However, that's no reason to dismiss all version control.

Re:Torvalds: git vs CVS by nearestneighbor on Friday April 16, 2010 @09:31PM (#1272419)
I'm glad you agree, because for the rest of the equation (Tarballs > CVS > SVN), Linus agrees with me. So you see, I embody the combined wisdom of both of you, as far as version control goes.
Re:Torvalds: git vs CVS by wvenable on Friday April 16, 2010 @10:51PM (#1272502)
You have his equation wrong. He says in this article that SVN is still better than CVS. And really, I would agree that tarballs are better than CVS. So the equation is more likely SVN > Tarballs > CVS. Don't put words in Linus's mouth.

Also Subversion no longer stores it's data in a database so Linus's objection in this article has been resolved.

Finally, Linus's needs are pretty unique in the world. Linus isn't satisfied with Subversion for the same reasons it might work perfectly well for you.

Re:Torvalds: git vs CVS by nearestneighbor on Friday April 16, 2010 @11:23PM (#1272555)
> He says in this article that SVN is still better than CVS.

He says SVN is better, but is more fragile (which for source control, I interpret as being worse):

    SVN fixes (supposedly) those "implementation 
    suckiness" issues. ... 
    I think it's also a much more fragile setup and 
    there's apparently been people who lost their 
    entire database to corruption
Even if SVN = CVS, clearly Tarballs > SVN, according to him. His actual quote was Tarballs >> CVS. I can dig it up if you can't.
Re:Torvalds: git vs CVS by wvenable on Friday April 16, 2010 @11:54PM (#1272586)
Thousands of companies (and millions of developers) use Subversion. It's 10 year old. It's an Apache project now. It's solid. It's a simple and easy to use tool that will make your life better. That's all.

If you find that personally offensive, so be it.

Re:Torvalds: git vs CVS by nearestneighbor on Saturday April 17, 2010 @12:34AM (#1272630)
Why do you say that I find this personally offensive?! You are not making a lot of sense. I'm just quoting Linus who probably had more experience with various VCSs than any of us.
Re:Torvalds: git vs CVS by koenigdavidmj on Saturday April 17, 2010 @03:21AM (#1272755)
Linus was more ranting that Subversion uses a binary database. If it gets corrupted, you're screwed.

CVS's database is just RCS files, plus a little. Nice and easy to restore if Bad Things start to occur.

Re:Torvalds: git vs CVS by wvenable on Saturday April 17, 2010 @01:02PM (#1273315)
Subversion now use text files for storage too. You have the option of that or the Berkley DB.
Re:Torvalds: git vs CVS by ableal on Friday April 16, 2010 @06:09PM (#1272100)
I'd say that mercurial ( http://tortoisehg.bitbucket.org/ ) or bazaar ( http://doc.bazaar.canonical.com/migration/en/why-switch-to-b... ) might be good for you. Or even plain old tortoise-svn.

There's a certain peace of mind to be had knowing you can roll back to what was working yesterday at 17h30.

(P.S. it's easier than the tarball snapshot - right click on folder, commit, type a note. Been down that path ;-)

Re:Torvalds: git vs CVS by wvenable on Friday April 16, 2010 @06:35PM (#1272156)
Rather than being a competition -- each version control system has it's own advantages and disadvantages. Now on the scale of version control, you're at a zero. Almost anything is better than what you're doing now. Even a solo developer should be using version control. For you, I would highly recommend moving to Subversion. It's relatively simple and has great (and free) integration with Windows Explorer and Visual Studio. And if you want to move up to Git in the future, it's not a terribly difficult transition.
Re:Torvalds: git vs CVS by nearestneighbor on Friday April 16, 2010 @07:04PM (#1272206)
> Now on the scale of version control, you're at a zero.

After I went to all the trouble to explain that my system is the best one for me? :-)

What problem that I have will switching to subversion solve? Suppose I have two versions of a procedure and I can't decide whether the new version is faster and just as correct as the previous one. I keep both with

    #if 0
      // old one
    #else
      // new one
    #endif
And it's easy and intuitive to see them side by side and switch back and forth between them until I'm sure. The VCS just don't give me this simplicity, convenience and intuitiveness.
Re:Torvalds: git vs CVS by wvenable on Friday April 16, 2010 @07:30PM (#1272252)
> What problem that I have will switching to subversion solve?

You already have the problem (backups, multiple versions of code) you're just doing it the hard manual way. You could say the same thing about Visual Studio over Notepad -- what problem does it really solve? One is just a superior way to work. You're using stone knives and bearskins.

Version control doesn't prevent you from using conditional compilation. You really wouldn't have to change your work flow at all. But you already make tarball backups -- taking the two clicks to commit your code is going to be much simpler. And if you ever screw something up, you can always go back to a working version.

If you get around to branching and merging the full power of version control reveals itself. I'm currently working on a development branch of my software while the production branch continues to get bug fixes. When I'm ready to deploy, I just merge all those changes together.

Re:Torvalds: git vs CVS by nearestneighbor on Friday April 16, 2010 @07:43PM (#1272268)
> But you already make tarball backups -- taking the two clicks to commit your code is going to be much simpler.

And you are saying I'm not doing it right?

I have a 1-line script that does that, automatically adding time stamps to the name of the tarball. How is checking in your version simpler?

> If you get around to branching and merging the full power of version control reveals itself.

This attitude is unproductive, as I witness from other programmers' experience: they branch and then they branch - stuff gets inconsistent, bugs get fixed in one version, but not another, and the same bugs that were fixed before, get magically released to public 2 versions later (REAL STORY).

My philosophy is MAKE BRANCHING HARD.

Re:Torvalds: git vs CVS by wvenable on Friday April 16, 2010 @08:19PM (#1272313)
The extra click is so that you can add a description of the changes, but if you want to resist even that level of organization you could script it down to one click as well. Your system just gives you a big dumb useless tarball. For the exact same effort, you can view changes to past revisions, revert any single file to a previous version, see exactly what you changed and when. Why you wouldn't want that power for the same effort, I don't know.

> This attitude is unproductive, as I witness from other programmers' experience:

You said your are a solo developer so you're telling me if you had the power to branch and merge you wouldn't be able to control yourself? You'd just branch and branch and never merge and make a mess of the whole thing? Even though you could do that right now just using the file system?

The whole point of tracking your changes in version control is to prevent the very thing that you describe. I simply wouldn't be able to function without that ability. Our stable production version is live and we have big changes in development (over 5 months now). Without version control the bugs fixed in production would likely never make it into the new version.

Re:Torvalds: git vs CVS by nearestneighbor on Friday April 16, 2010 @08:42PM (#1272346)
> For the exact same effort, you can view changes to past revisions, revert any single file to a previous version, see exactly what you changed and when.

Tarballs let you do that as well.

> You said your are a solo developer

Right. Those people are working on their own code base (total disaster, much of it due to branching and following the VCS "methodology". I feel like slapping their lead whenever he mentions tagging or branching. That stuff ain't free! You only have one brain! /rant)

Re:Torvalds: git vs CVS by wvenable on Friday April 16, 2010 @09:14PM (#1272394)
> Tarballs let you do that as well.

No, they don't. I can right-click on any file and view all the changes as a diff, I can see exactly what I changed and when, and revert that file back to any previous version. You can't do that with a tarball -- at least not without significantly more effort. It's just better all around.

> Those people are working on their own code base (total disaster, much of it due to branching and following the VCS "methodology".

You're not required to use any particular methodology. I've seen people screw up with every technology in existence -- that's hardly a reason to head back into the woods and live like a cave man.

There are very few things in the field of computing science that are universally agreed on. There are dozens of development methodologies, thousands of different programming languages, IDEs, etc. The closest thing we have in this business to consensus is the use of version control (even if the exact tool to use is still under debate).

You're simply mistaken to assume not using version control is superior in any way to using it. There's nothing wrong with your own methods of development and backup but that isn't version control and it isn't incompatible with it either.

Re:Torvalds: git vs CVS by weavejester on Friday April 16, 2010 @11:30PM (#1272560)
> My philosophy is MAKE BRANCHING HARD.

You outline problem with branches that are long-lived, but the majority of branches created in a typical Git workflow are temporary, often lasting only a few days or less before they are absorbed into master.

Re:Torvalds: git vs CVS by FooBarWidget on Saturday April 17, 2010 @04:18AM (#1272806)
So with your system, how do you view the changes between one version and another? It's possible to view changes within a single file with diff, but what if you want to see the entire set of changes, e.g. in look for a regression?

What if you're working on an experimental feature that makes your program unstable while it's still being developed, and the feature spans multiple files? If you decide later on that the feature is useless, do you modify each of those files to remove all the #ifdefs? I make a temporary branch for this and delete the branch if I decide it's a failure.

Re:Torvalds: git vs CVS by prog on Friday April 16, 2010 @10:48PM (#1272500)
> I have a 1-line script that does that, automatically adding time stamps to the name of the tarball. How is checking in your version simpler?

The important question is, do you have unit tests for that script :)

Re:Torvalds: git vs CVS by pgbovine on Friday April 16, 2010 @07:07PM (#1272215)
what if you have more than 2 versions, or if your #ifdef's get nested and more hairy? slippery slope to preprocessor hell :)

with git, there's a nice 'bisect' feature that lets you quickly jump back-and-forth between different versions of your code (in a binary-search-like way), so that you can debug performance issues like the one you're using #ifdefs to manually do. just check in a bunch of versions of your code and use 'git bisect' to jump between them and test each out for performance (or correctness)

Re:Torvalds: git vs CVS by nearestneighbor on Friday April 16, 2010 @07:20PM (#1272240)
Realistically, you wouldn't normally have more than two versions: one "solid" and one "experimental". But if you do, there's #elif. I repeat: I see conditional compilation as a temporary thing. My code does not end up littered with them.

> with git, there's a nice 'bisect'

How does "bisect" know where the boundaries are? What if you change the original code a bit, like re-indent it or make another trivial change? How can you look at both versions, preferably right in the editor? What happens to time stamps when you switch between the versions? Versions cached in the IDE? Directories? (You may be surprised that Git leaves them around from previous versions)

It's all doable, but not very intuitive. Why bring complexity where there is enough of it already?

Re:Torvalds: git vs CVS by wvenable on Friday April 16, 2010 @07:44PM (#1272271)
If you're say, changing an API, and then you've modified all the code that uses that API that's a large number of files with defines in them, right?

Your work flow is limited to the method you've chosen not the other way around. To say it works for you sort of misses the point. Version control can free you to work in ways you can't yet imagine.

> How does "bisect" know where the boundaries are?

Clever algorithms.

> What if you change the original code a bit, like re-indent it or make another trivial change? How can you look at both versions, preferably right in the editor? '

The file gets flagged in your editor as having a conflict. Inside the file, any code parts that cannot be merged are included the file (both versions) and you pick which one you want (or edit the changes together manually). It's actually very easy, very intuitive, and works with your editor. In most cases, you won't have conflicts.

> Versions cached in the IDE? Directories?

I've never had a problem with versions cached in the IDE -- probably because almost everyone uses version control it's not something that usually goes wrong. With IDE integration, it's even better. Directories are handled pretty sanely in Subversion, at least.

Re:Torvalds: git vs CVS by nearestneighbor on Friday April 16, 2010 @08:47PM (#1272354)
> If you're say, changing an API,

You obviously take the snapshot before. No different from the more over-engineered approaches.

>> How does "bisect" know where the boundaries are?

> Clever algorithms.

Really?! You change two methods in a class, and "bisect" knows how to undo only one? No, you have to spoon-feed it, "staging" your changes (I did use GitX for a day). So it's not as simple as taking snapshots after all, is it?

Edit: typo, formatting

Re:Torvalds: git vs CVS by blasdel on Saturday April 17, 2010 @04:02AM (#1272792)
Yes, git asks that you make your commits actually make sense, instead of "oh I'm about to leave, better check in all the unrelated shit I did today"

Sounds like you'd fit in just fine with ClearCase users.

Re:Torvalds: git vs CVS by nearestneighbor on Sunday April 18, 2010 @01:19AM (#1274403)
Maybe you should have instead posted your retort when someone claimed that Git's commits are as simple as taking tarball snapshots?
Re:Torvalds: git vs CVS by FooBarWidget on Saturday April 17, 2010 @04:11AM (#1272799)
Git bisect is a binary search. You tell it what the last known good revision is, and then it'll perform a binary search for you between that revision and the latest revision. In each step of the binary search Git will ask you whether the current revision is good or bad, and in about O(log N) steps you'll know which exact revision introduced the regression.

> (You may be surprised that Git leaves them around from previous versions)

Git leaves directories around only if they contain files that are not checked in version control.

Re:Torvalds: git vs CVS by nearestneighbor on Sunday April 18, 2010 @01:17AM (#1274400)
You misunderstood the (already answered) question. I wasn't asking about binary search and its complexity.
Re:Torvalds: git vs CVS by suraj on Saturday April 17, 2010 @01:13AM (#1272658)
I have had wrong code delivered on more than one occasion because of workflow of using tarballs and/or backup folders.

If you are working on windows, there is no GUI better than TortoiseSVN. Give TortoiseSVN a try, it won't replace the #ifdef's; but it will certainly be better that tarballs for solo development.

Re:Torvalds: git vs CVS by RyanMcGreal on Friday April 16, 2010 @08:01PM (#1272292)
>Git just isn't well-supported on Windows

Msysgit is stable and fully functional. You can even install it so that the git commands are available on the 'DOS' command line.

Re:Torvalds: git vs CVS by prog on Friday April 16, 2010 @10:43PM (#1272495)
Irrespective of what Torvald says, I would probably choose svn over tarballs. But you should look also at bzr and hg. I don't think they integrate with Visual Studio but have good guis.
Re:Torvalds: git vs CVS by Locke1689 on Friday April 16, 2010 @06:06PM (#1272092)
Git is not supposed to shine on OS X. Git was written with the Linux kernel and subsystem in mind. OS X is UNIX, but it is not Linux.

Try Mercurial. Git's piss-poor cross platform support has all but removed it from my development routine. Well, that and I find Mercurial's interface far more comfortable to work with.

Re:Torvalds: git vs CVS by pak on Friday April 16, 2010 @06:29PM (#1272137)
How does git not shine on OS X? Installed via Fink or DarwinPorts, I can't find any area in which it doesn't perform equivalently to the linux builds. There is also the lovely GitX on OS X for visualizing repos and staging commits.
Re:Torvalds: git vs CVS by bsergean on Friday April 16, 2010 @06:47PM (#1272179)
Yep, and compiling git is a piece of cake (on machines with a decent gcc).
Re:Torvalds: git vs CVS by pgbovine on Friday April 16, 2010 @07:05PM (#1272210)
agreed, i totally hate going thru dependency hell, but on any OS X, if you install the developer tools from the installation DVD, that will give you gcc and the basic libs you need to compile git with no problems. ./configure; sudo make install