views:

145

answers:

5

Basically, I'm doing a lot with Visual Studio lately and in my quest to get a simple version control system that I could host myself, I just thought to myself: how difficult could it actually be to write some VCS that just supports the Visual Studio interface? (And which will be used by just one person, anyways...) (And which will be hosted on my own website as a web service or whatever.)

No, I'm not a beginner. I've been programming for over 30 years now so yes, I know it would be difficult, even for a veteran developer. I just like the challenge. And yes, I could just use one of the many existing solutions but sometimes it's just fun to re-invent the wheel. It's more just a challenge for my skills than something I really need. Just practice that could turn out to become quite useful.

So, to start with, I need a good definition of how Visual Studio 2008 communicates with a version control system. Writing code it the easy part. Knowing what it needs to do at a minimum is what I need to know.

So, any useful hints, tips and links?

+2  A: 

Linus Torvalds apparently wrote Git over couple few weeks. It's responsible for managing the Linux Kernel source repository.

I, however, can't iterate enough that you would be much better off learning an existing version control system. The number of features are invaluable.

Finally, you can use local repositories for Subversion, so you can "host it yourself" with no problem. There are plenty of visual SVN interfaces for Windows if that's your hang-up.

Nolte Burke
To be honest: git took a lot longer than a few weeks to get to a state where the average programmer could use it as well. The first versions were pretty much written with a target audience of exactly 1 ;-)
Joachim Sauer
I was trying to be supportive before I crushed his dreams.
Nolte Burke
I think you're missing the point. He wants an interesting, challenging project to do for fun. It's the process, not the product that he's mainly interested in.
tvanfosson
Yeah, it's just a fun project, nothing serious. If I create something good, I might start to use it myself, possibly even share it somehow as open-source. If it sucks, I'll just go find some other challenge. :-)
Workshop Alex
+4  A: 

I think you're attempting to do two things at once:

  • produce a new version control system
  • produce an interface to Vistual Studio for that VCS

I'd keep to one task at a time, since both are probably multi-year projects on their own.

So if you want to get a good, self-hostable VCS that matches your conception and is integrated with Visual Studio, then I'd search for a good, self-hostable VCS that matches your conception and isn't integrated with Visual Studio yet. Then add the integration. Of course, if you find one that's integrated as well, that would be nice, but it takes away all of the challange, doesn't it?

Apart from the problem becoming much more complex when you attempt to do both steps at once, I'd argue that it can seriously harm the design of your software if you try to implement backend and frontend at the same time.

Chances are that you run into a trap that a lot of software does where the UI and the logic is so tightly bound to each other that you can't easily change any of the two or even separate them out later on.

Joachim Sauer
I'd say this is good advice for any software project.
Nolte Burke
I think that you'll do more harm to your project to develop the backend without any concept of what the frontend requirements are. If I were doing this I'd look at the frontend requirements (from the SDK API) and let that drive the design of the backend, building one interface component at a time.
tvanfosson
Comment completely ignored the question asked and went off on one about even doing something like this!
marcus.greasly
@marcus.greasly: yes, and if someone asks me how to build a spaceship that can dig a tunnel as well, then I'd give a similar response. Also the question explicitly asks for tips. My tip is to reduce the scope of the project to increase the chance of completing it.
Joachim Sauer
@tvanfosson: I agree that completely ignoring the other parts can be just as damaging.
Joachim Sauer
@tvanfosson If you are using the interface to determine design requirements you're doing it wrong. These sorts of things need to be planned up-front. Look at how UNIX architecture is designed. You can have two totally separate teams working on the back-end and the front end, and since you adhere to a certain design requirement--you meet up in the middle having accomplished all the required tasks. The "separation of concerns" is paramount to having quality, reliable, and extensible code.
Nolte Burke
I've learned long ago to keep UI and business logic separate. I have a tendency to write all new projects in multiple layers already, keeping them as independant as possible. Asl I said, I am quite experienced. But for this project, I just want to focus on supporting just the methods that Visual Studio expects from a VCS and not a single bit more. (Unless absolutely required.)
Workshop Alex
@Nolte -- but you can't do them in isolation. The back-end needs to support the front-end requirements. The front-end needs to know what is/isn't possible from the back-end. Saying that you should go and develop the back-end, then work on the front-end is just another example of waterfall and won't work. Better to develop them both in tandem -- using separate teams or not -- incrementally so you get feedback from the front-end requirements as you go along.
tvanfosson
+4  A: 

A simple VCS is not that difficult to write. Kernighan and Pike in their great book The UNIX Programming Environment describe a simple one built using diff and awk, which may be worth looking at (see Chapter 5).

Building a realistically useable one though is a lot of work, and something that requires extreme levels of testing. You have to have absolute trust in your VCS, otherwise you simply won't use it.

anon
Actually, it doesn't need to be realistically usable. I first wants something that works within Visual Studio for a single developer. Once that's done, I'm re-evaluating the project again to see if I'm going to improve it and how. I'm just looking for a programming challenge for veteran developers. :-)
Workshop Alex
I don't understand why people looking for a "programming challenge" always seem to reinvent the wheel (see all the FTP and IRC clients out there). Why not create something new? Surely much more of a challenge?
anon
Well, re-inventing the wheel? Not really. Just trying to get a much better experience with/knowledge of version control systems. For me, I just need this challenge to keep my skills up-to-date. And it keeps me a bit more independent from existing products.
Workshop Alex
Why do you see independance from existing (almost all free, open source) products as being a good thing? To me, it simply reduces your employability.
anon
+5  A: 

MSDN has a section in the Visual Studio SDK documentation on how to create a source code control plugin. This should give you what VS expects from the plugin.

Have fun.

tvanfosson
Finally someone posts something that is an answer to the question asked instead of knocking the poster for trying this despite the explanation provided!
marcus.greasly
Good answer! With this information I can now start to set up the first designs, determining what it needs to contain as a minimum. Not expecting to write code any moment, now. I now have to start studying the client interface and then draw some possible designs.I now also wonder how I missed this when doing a Google search. :-)
Workshop Alex
A: 

You might want to try looking at the AnkhSVN source if you want a good example of how they do it with Subversion.

Dave Markle