views:

320

answers:

11

Hi all,

I will be implementing a version control system in C++ for my final year project.
I would like to know:

  1. What are the features a version control system should must support.
  2. What features do you consider are missing in existing implementations (so that my version control system does more than just reinventing the wheel )
  3. References(if any) to start with.

Thanx a ton,

A: 

You can't create a full version control system as your final year project. And in C++, it's close to impossible in a 4-6 Month timeframe even for a full team. ( I think FYPs normally have a 4-6 month timeframe).

What you should be aiming at is creating a subset of a good version control system. Look at SVN for a start and try developing a subset of it. e.g., SVN MINUS Branching Support should be way more than enough.

And Why C++? Try doing it in some other language which has a better support of libraries e.g., C#. Remember, C# applications ship quicker :)

Aamir
git was written by Linus Torvalds in _4 weeks_... Most other contemporary VCSs were probably brought to a working state in the same amount of time. Don't automatically think of overengineered SVN when you hear 'version control system'
I can't see your point. Maybe he is more proficient in C++ :)
AraK
-1 condescending
@mmutz: You really need to read this: http://www.codinghorror.com/blog/archives/001284.html . Developing a software is one thing and developing a working software with all its features working in a proper way is an altogether different thing. I would love to see a scalable source control system written in 4 months by a single person which has all the features working in a proper way. I am pretty darn sure that nobody, how good he is, can do this. And did I mention that this solution should be Scalable?
Aamir
@AraK: He is a student which normally means that he is learning technologies right now. That's why I gave him the suggestion of using a language with a better set of libraries so that his work becomes easier and he doesn't have to reinvent the wheel for all the trivial things.
Aamir
Git is written in C not in C++. Watch out what you say otherwise you will attract Linus' anger: http://thread.gmane.org/gmane.comp.version-control.git/57643/focus=57918, ;-).
fco.javier.sanz
well obviously he wants to do such a system and it is intended as an educational journey so don't be so negative. Who knows, maybe he finds a way to do it faster or have some new revolutionary idea? Stranger things have happened.
Anders K.
But he also states he wants to add features that are not in any current VCSs (SEE point 2 in the OP's question), so that implies a more than fully featured VCS. I have to go with Aamir here.
Colin
just because you're not so proficient in C++ doesn't mean everyone else is, and for your comment - he might as well write it in Ruby, 'cos they ship quicker than anything. Doesn't quite follow does it. Now try answering his question instead of telling him how to do it.
gbjbaanb
@gbjbaanb: I have already answered his question in my original reply where I said that he should implement SVN MINUS Branching support. That was an honest answer which told him really what is practical for him. Don't get me started on why C# applications ship quicker, there are already numerous threads here on SO on this. I have done sufficient work in both C++ and C# to make this claim that development in C# is way quicker than that in C++. As far as developing a full VCS in 4 months is concerned, I still stand by my point that it can't be done by a single person in C++ in 4-6 months.
Aamir
@ Aamir .. my final year project is a year long.. :)
Neeraj
+3  A: 

If you want to do something different / innovative, then I'd reccommended looking into targeting your revision control at something other than source code. There are other application where revision control could be useful (e.g. revision control for documents) and source control has been extensively done already - your unlikely to cone up with an innovation that doesn't already exist in some other source control already.

Kragen
Revision control for pictures might be interesting.
Nixuz
Araxis merge has an image difference feature: http://www.araxis.com/merge/topic_comparing_image_files.html too bad its not OSS and can be put into Winmerge :)
gbjbaanb
+1  A: 

I admire your ambition, your course may be different from mine, but you tend to get more marks for your report rather than the code, so it's important to know what you can archive given that writing the report will take 2,3 times the time for coding.

You probably need to try to implement a few other ideas extremely roughly to give yourself an idea of the difficulty of each one before you commit.

Linus Torvalds may well have developed the core of git in four weeks, but it took many others a lot longer to make it really usable, and he is Linus Torvalds!

Chris Huang-Leaver
It was 12 days actually, from the beginning of the design phase to one of the largest software projects on the planet running on it. But, yeah, your point is valid.
Jörg W Mittag
You are, of course, correct. That will teach me to blindly trust another post!
Chris Huang-Leaver
+4  A: 
  1. What are the features a version control system should must support.
    Core features: Create Project, Check in, Check out, Branch, Get Latest/Previous, View History, Compare, Rollback
  2. What features do you consider are missing in existing implementations (so that my version control system does more than just reinventing the wheel )
    Auto Build, Code Analysis, Email Notification, In-place editor, Database based storage
Ramesh Soni
I don't think Auto Build, Code Analysis and Email notification should be part of your VCS. Simply let the VCS provide hooks so you can launch your own processes when checking in, etc. This will provide you with all the flexibility you need.
Sardaukar
Compare is the most useful feature it has missed in the above list.
Kthevar
@Kthevar: Sorry I missed that. (Added now)
Ramesh Soni
@Sardaukar: you are right. But these are the features which are missing in version control system. They are just nice to have and not mandatory.
Ramesh Soni
You contradict yourself. You agree with me *and* you say that these features are nice to have and not mandatory.I'm simply saying that the VCS should provide hooks (which is a must-have feature in my opinion) and should NOT provide Autobuild, Code Analysis, etc.
Sardaukar
Autobuild, code analysis, and the like tie the VCS into particular environments, which make it less useful. Subversion and Mercurial are perfectly usable in a multi-platform shop, but the MS systems aren't.
David Thornley
+4  A: 

Ignore the people who say it cannot be done. In their seminal book "The Unix Programming Environment" Kernighan and Pike develop (a very basic) one using shell scripts, diff and sed in a very few lines of code. I'm sure you can do something similar.

anon
I'm sure he can do it. However many Computing Degree's have an element of 'gaming' to them, you get more marks for what you say about a particular subject than what you actually do. So if you spend the whole time coding something then rush the report, your final grade might be lower. Maybe :-)
Chris Huang-Leaver
A: 

One thing many miss is the ability to shelve changes - ie check files in as a temporary commit, so you can save your working copy regularly (eg every night in case your computer gets stolen/broken) but without these 'in-progress' changes showing up in the main list of changes. When you've finished working on them, you then check them in to commit them as normal and the temporaries are removed (as you don;t want to fill your VCS with irrelevant versions).

Another thing many fail to do is automatically notify the user of changes. eg. svn you have to run svn update to get any changes made by team members, it'd be nice to have that automated so changes were retrieved on every operation (eg. save a list of changes since and send a highly optimised data block to the client after every result)

Try a better way of storing binary files, most SCMs are designed to handle text, and work on binaries only by chance (and not very well usually).

In many ways I'd suggest starting with an existing open source SCM and extending it with your changes. That way, you do get the benefit of the basics for free leaving you to concentrate on the fancy features but at a cost of learning how to develop that SCM. Subversion, git, mercurial, bazaar are all good reference SCMs.

gbjbaanb
Something like "git stash" (and "bzr shelve", etc.)?
Jakub Narębski
There are times when I absolutely don't want to import changes for a day or two. Auto-updates should be configurable, and I would always keep that configured to "Turn this on and I'll break your thumbs".
David Thornley
git stash - remember my spec, if you stash your changes then lose your laptop, do you still have your changes? If you push it upstream, hasn't that removed the 'temporary' nature of them? But otherwise, yes, like git stash.
gbjbaanb
+3  A: 

#2 Nice user interface!

+1  A: 

The number one feature should be:

MERGING

If you wrote a complete VCS and your merging sucks, you will not use that feature. And your VCS is now simply a glorified backup-system.

Merging is also probably the most difficult part to implement.

Sardaukar
Take a look at http://revctrl.org/ where different difficult problems related to merging are described. You should ***at least*** cover repeated merge, and it would be good if you cover criss-cross merge. Also dealing with renames in merges would be a good thing.
Jakub Narębski
+2  A: 

The ability to search an entire codebase for instances of a chunk of text. This gets really important as the codebase gets older (or as new people join a project and are learning the codebase). SourceSafe has it but some others don't. Yes, Sourcegear Vault, I'm looking at you.

Granted, it's one of the few things that SourceSafe does right, but it needs mentioning.

Bob Moore
Something like "git grep", or something like 'pickaxe' search "git log -S'string'"?
Jakub Narębski
+1  A: 

Stand on the shoulders of giants. What about contributing to an existing version control system, adding new features and/or fixing bugs better than reinventing the wheel?

Depending on the language you prefer, you will probably find a good open source written with that language.

Python > Mercurial, C > Git, C++ > Monotone

Mahmoud Kassem
+1  A: 

Take a look at article by Tom Preston-Werner, cofounder of GitHub: The Git Parable, describing how a Git-like system could be built from first principles. Worth reading.

Try also to avoid traps other fell in, for example design file formats and network protocols with extendability in mind, to not have to hack it if the format changes; either provide version number or a list of capabilities. But that is more advanced thing, and it assumes that you want for this VCS to go beyond term project.

Jakub Narębski