CVS Server Administration Tips?
Twintop asks: "The company I'm working for has asked me to take over administration of their CVS server for a decent sized project. The current setup of the CVS server needs to be wiped clean and started fresh. The only times I've ever used CVS (and used it poorly at that) was with a few SourceForge.net (An OSTG Site) projects. What are some suggestions on reference materials for a newbie to CVS (but not to Linux) and methods of administration that have worked for you in the past?"
If you have an opportunity to, chuck it and use Subversion instead.
Need a Python, C++, Unix, Linux develop
1) Switch to SVN
Oh, come on, don't be lazy, Google is your friend. You want free advice for something you are getting paid to do and for which you do not want to spend a couple of hours researching and learning. Why was this question even approved? Is this news for nerd or news for lazy newbs?
The CVS Book is a free download. You can order a dead-tree version, as well.
tasks(723) drafts(105) languages(484) examples(29106)
Cut the guy some slack! Sure he can Google! But he's looking for nuggets of wisdom from all you experienced developer guys! Or perhaps you don't have any knowledge about this? Than maybe shut up.
"Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
awww, I'm sticking my neck here, it can't be said enough times: switch to SVN.
Migrate to svn and learn how to use it. Sorry, but asking for pearls is going to get you nowhere unless you've got very specific scenarios to query against.
Cederqvist, the "official" manual, is surprisingly well-written, and worked wonders teaching me about CVS. Highly recommended, and available for free in a variety of formats at the CVS web site.
Christian Jones
Medicine. Mathematics. Mediocrity.
this way, any files created/modified within that directory will retain their group writable permissions. you'll need to set the CVS_UMASK variable for each user as such in the shell of the remote machine they'll be using CVS from.
you'll need to set the CVS_RSH variable to ssh, so it tunnels:
and your cvs home will look something like:
to make it even more convient, i suggest you research ssh-agent/ssh-keygen and use keys. no more passwords, with security and group protections
- tristan
here
The CVS book already mentioned will tell you how to setup a minimal server, if not google is your friend.
Once the server is up and running your developers can import their own modules - you will just need to setup logins/passwords/SSH keys for them.
Honestly little maintainance is required after that.
The only things I've ever needed to do are:
More specific questions might help, but really CVS is a low-maintainance tool. Once it's setup it just keeps working.
Be sure you're not exposing it externally if you're not needing to and make sure you track security updates via bugtraq/the CVS homepage and you're done.
I've used CVS for about a dozen years with pretty good luck for a small community (~20) users on one project.
Things that made life go better: encourage developers to do:
- cvs update after their grand upgrade of the source to incorporate other's changes in the interim; this avoids doing messy conflict resolution at commit time
- test your new version on all the test problems (it sure better compile at a very minimum)
- only then do the cvs commit with concise commit log message
The repository stayed in pretty good shape, even after we manually hacked files in the CVSROOT directory instead of doing what we were supposed to do and checkout and checkin changes to files in that directory.Occassionally, we'd have problems with users of the "wrong" group id checkin and make it hard for others to check out. That problem might be fixable with a sgid sticky bit on the repository directory. We even limped past the Y2K thing with an old version of CVS that tells people that it's 19105 right now.
Do not branch. We never have but have heard of hair being pulled out when people do that.
If you can build a script system to cvs export -D now a snapshot to do automated build testing and feature testing you and your developers will sleep better at night. Even better if you can do multiple platforms and show the results on an updated web page.
Occassionally it's good to tag a release. A major bump in the release number helps morale, too.
CVS does work, but I'm seriously looking into subversion for my next repository.
"Provided by the management for your protection."
BRL-CAD is a very large scale project with over 20 years of history in RCS and CVS. The CVS repository now lives on SourceForge with pretty much the entire revision history preserved (the project only recently released as open source). You can see one of the oldest files, for example here (bool.c). If you look to the end of the file, you'll see something like: Wed Apr 18 02:19:43 1984 UTC (20 years, 9 months ago) by mike
Several years ago, many of the current CVS practices were written down and organized into a rather detailed generic CVS policy. It basically all boils down to being able to guarantee a certain level of functionality, being very careful about naming directories, and coming up with good tag naming conventions. Likewise, depending on how many developers you have and how active development is, more or less control may be required for branches and validation.
Those last two restrictions are mainly due to limitations of CVS -- it does not directly manage directories or maintain history of directory changes, so you're left up to tracking those changes by policy conventions. (It's rather annoying that a CVS checkout does not prune empty directories by default!) If your directory structure is likely to change frequently (e.g. a new large project starting up), then something like SVN may be less painful. that said, BRL-CAD's history has easily endured CVS's inadequacies quite successfully.
Cheers!
Sean
There are several books about CVS. Oreilly publishes a nice one.
My advice is to buy a book and read it.
Religion is poison to rationality, and we lose sight of that at our own peril. -- Lurker2288
You are the reason people do not like to ask questions. And I am not talking just about /.. You have this superiority complex that if you know the answer, or do not like the question, the person asking it must be stupid. Read the original post again. Did he ASK for you to do his job? No. Did he ask you to teach him to be a guru CVS admin in 21 minutes? No. He admitted that he did not know something but needed to learn quickly. He asked for directions on GOOD places to look for answers.
You are right that there is nothing that beats personal experience. Yet you belittle people for asking to learn from the personal experience of others.
I hate to break this to you, but Google is not always your friend. There is a lot of good information and a lot of garbage there too. One must sort out the garbage from the good. But if you don't know enough about the information, how do you tell the garbage from the good? He could spend weeks trying to sort out the info. Which is the option you want people like him to choose. Just as long as it doesn't take any of your precious time. You may be an expert in the field and know the good from the garbage at a glance. Not everyone is. If you are an expert, you may know which are the best terms to use in the search. Is "CVS Administration" better than "Administering CVS?" Perhaps "Best Practices CVS Administration" is a better search term. But someone not knowing CVS could spend way too much time just trying to refine the search to bring up the needed info, let alone actually learning from the best info.
People like you do a lot to lower the average intelligence of humanity. I hope that you never have children. They would learn to be afraid of asking questions. They would learn that it is better to be ignorant than to try to learn.
If you think that a question is stupid, you have the right to that opinion. However, once you have the reputation of a blowhard, there is little point in talking, since few listen to the wind. I, for one, will not listen to the wind anymore.
The current setup of the CVS server needs to be wiped clean and started fresh. The only times I've ever used CVS (and used it poorly at that) was with a few SourceForge.net
If you've rarely used CVS properly, what makes you think it needs to be wiped clean and refreshed? I think you'd be better off recommending they get somebody who knows what they're doing to do a proper analysis of fixing it up.
--------- Beware the dragon, for you are crunchy and good with ketchup.
For Windows developers, TortoiseCVS is highly recommended (as well as it's subversion equivalent, TortoiseSVN). For Java users, Eclipse has built in CVS support, which also works quite well.
The best advice I can give when administering a CVS server, is...Trust No One(TM).
Assume the absolute worst possible scenarios will occur and plan for them.
This means make sure that your system is secured and updated as possible, especially the CVS software.
Force ssh access, don't allow pserver access at all.
Ensure that a daily backup occurs and that you have backups for at least a week.
Triple-check your permissions on all the CVS directories.
Don't run the CVS server as root unless you absolutely have to (and I don't think you have to).
ditto the previous poster who said "use SSH". The only way to access the server should be via SSH. Every user who needs write access should be in the "cvs" Unix group. The directories should be set so they get owned by that group. That will make things simpler AND eliminate security problems.
This goes for Subversion too (I don't really get excited about subversion, it just seems bloated and overengineered inside). Use the apache module over HTTPS or use SSH.
Also, learn how to get the logs out of CVS (cvs history). That's something you'll need to do a lot. I can hardly ever remember the flags though.
Someday you might also have to break a lockfile (subversion fanboys: berkeley DB gets wedged too. and when it does it's worse.) or do backups... you'll learn that when you need to.
For books, try the O'Reilly CVS book. It's not written very well but it has all the information you need. There is also the Pragmatic Programmers guide but that's suited more toward users than admins I think.
Other recommendations:
1. Keep the directory structure relatively flat, makes updates faster and output easier to scan.
2. Separate different domains into different CVS modules. What I mean is, you shouldn't have to update all the tests and all the documentation, just to update your source tree.
i agree with the "backup the repository and test always" mantra but clearly not the "do not branch" part of it. I think that you will be missing an important aspect of CVS. Branching is a must for multi-team projects - specifically when they are independently developing different product features.
If you have the chance to do it the way you wan't: Don't use CVS. Use Subversion instead. SVN in short: CVS done right. I think it's even being developed by the original CVS developers.
Judging by your posting history, Anonymous Cowherd X, it's clear you grabbed a new name due to shitty Karma. Go figure!
You got a few pointers here but no one that commented seems to have run a larger environment - cause there you have very very different issues. Some of them sound trivial but in a 600+ people shop its the small things that kill you.
First of, don't do symlinks even though they are possible... They always end up in a mess.
Then make sure you provide them with a good way of changing their passwords (no matter what access method you're using) and see if you can't arrange it to force changes - otherwise people will share ids and its a pain.
If nessecary, create functional IDs - that way you at least know its not one person but a group.
Keep cvs on a Tru64(advfs) or Linux box... HP-UX or Solaris is a lot slower... solaris10 with zfs might be close but haven't tried that yet.
Look for a few frontends (like cvsweb and so on) - they will help a lot for users that are new.
Send out an email with the cvsbook link (link is on cvshome.org) and make sure you remind people that's a good reference.
Offer them wincvs - windows users will not only have trouble adapting to command line but will screw up bigtime and after all its your job to fix it...
Peter.
there's always the possibility that there may be some horrible bug waiting there, but if in general you can always checkout your code and you keep regular backups, there should not be a problem.
CVS's little idiosyncracies seem to cause a lot of problems for my developers. Things like commits not being atomic, for example. Granted, working around CVS' limitations is not rocket science, but I'm already asking them to know so many different things, CVS just seems to be just one more stumbling block for them. I'm going to be testing out SVN soon to see if the developers have an easier time. We an always go back.
Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
Well, of course the obvious advice is to use SVN if possible. This will save you pain in many ways, the most important IMO being individual atomic changesets which track all files affected by one change, so you don't need to ask yourself, "Now what ELSE did the developer commit as part of this fix?" Yes there are ways around this in CVS. But they're not convenient nor are they guaranteed to always work.
That disclaimer out of the way, here are the basic common-sense rules we use for CVS:
1. Make sure you do your builds directly from CVS, not from any development machine. This means that you can guarantee that you have a record of the exact contents of a build and aren't getting any artifacts from a developer system.
2. On a related note, every time you release a version, tag the source with a non-branching tag for later tracking.
3. Whenever you release a product that you will need to maintain separately from your development line (e.g. you ship a product to a client, or release your product to the production web server, or whatever), then create a separate branching tag for it.
4. Periodically review the repository and chastize users who do not use descriptive commit messages or who aren't careful and commit files with only minor (think whitespace) changes.
5. If you are able to use Subversion, look into TRAC (http://www.edgewall.com/trac/) to see if it can help you. It's a godsend.
Heard? Then you actually haven't tried it? I've always heard branching didn't work very well in CVS also, however we implemented it on a large (2000 plus classes), several branches in fact, and it worked fine.
Get this book http://www.amazon.com/exec/obidos/tg/detail/-/0974 514004/104-4752216-1590345?v=glance
It is very short but tells you 99% of what you need to know to use CVS.
(as for all those \. ass-monkeys telling you to use Subversion -- sure, if your IDE of choice provides Subversion integaration to match its CVS integration. Eclipse (for example) doesn't.
I have discovered a wonderful
Check out the Essential CVS book from O'Reilly: http://www.oreilly.com/catalog/cvs/. It's concise and told me almost all I needed to know to manage my company's first CVS server for the last two years.
Bonsai is the best tool I've seen for digging through CVS's not-so-friendly history output. It's web-based, and provides a nice interface for creating pointed queries to see who did what and when. The setup is a little bit arcane, but once you've got it going, it's very handy to have in your toolbox.
That's rich. If companies actually did this, oh man. I can't stop laughing.
If your company can afford it, consider Perforce. If it cannot, consider a free revision control system that allows atomic commits (Subversion?). The company I work for went to Perforce and I am glad. The ability to group changes together, check in symlinks, and other niceties make this system great. Your entire CVS revision history can be imported to Perforce going back to the beginning of your project. In addition, the software is well documented.
I am strongly considering using the free version of Perforce for my home projects.
Braches work and branching cannot be avoided if you have real life project with installed base of old releases that have to be supported.
But you must be careful with the branches and understand how branching and merging work. Good idea is to write and to rigorously follow very hands down branching guidelines for your project with all the updates and -d's and -P's in place so that even the more experienced have no excuse for not doing it right ('oops, I forgot to cvs -xyz foo -bar').
One thing I found out when doing XP (Agile nowadays?) style development was that it is good to use very short lifespan on most branches i.e. use temporary branches for each implementation unit and merge the changes to the development branch when the unit is finished.
Long lived branches should be used when updating old and developing new releases, one per release.
The temporary braches should be really temporary with lifespans as short as 30 min and never leave them hang around to the next day.
Of cource the standard XP practice of running unit tests each time you build running "make" or "ant" and passing them all before you "commit" the merge is also quite recommendable.
It is also a good idea to require all working in the same release branch to update each time a merge (or "integration" in XP) is done.
- What kind of company turns over their "decent sized" code repository to someone who has to ask slashdot how to administer it?
- Why are you wiping the repository clean and starting fresh? Who determined that would be necessary? You?
- If you are wiping clean, as others have suggested, see if switching to subversion will fly.
Good luck, man!"Avoid employing unlucky people - throw half of the pile of CVs in the bin without reading them." -- David Brent
http://opencvs.org/ :)
It fixes some annoying problems with CVS, and benefits from additional security as well.
I haven't used it yet (waiting for release) but I'm looking forward to that day!
No need to switch to another revision control system, just fix the old dog so it works the way it's supposed to.
We use CruiseControl for this. Works great.
CruiseControl Home
There's also DamageControl. I checked it out, but got scared off by the need to install and use Ruby. I work with too many languages as it is, and am teaching myself Python, I don't need another especially just for one tool.
379955903618604798669887 --MarkusQ
I had heard the same thing, so I stayed away from branching until I got here. We're a bunch of branching fools here, and it's actually not as bad as I was led to beleive. For the most part, CVS handles branching pretty well. The biggest area we had trouble with was figuring out how to specify branches in all the different tools (command line, Eclipse, wincvs, etc. etc.) that our people insisted on using. A couple of things that we've learned the hard way, though:
Proud neuron in the Slashdot hivemind since 2002.
how's that encoded?
- tristan
*smile* Decimal. It sure is a Bignum, isn't it? --MarkusQ
arg lol. i give up. i can get that num as binary: 10100000111010101110011011010000010000001110111011 01000011000010111010000111111
but then it's 79 chars long. i tried padding it to 80 bits with a 0 on the front, but the chars are out of range. same with a 4 bit char instead of an 8 bit char.
- tristan
Yeah, 1010000011101010111001101101000001000000111011101
Or just try:
ruby -e 'n=379955903618604798669887;puts (1..10).collect {i=n % 256;n=n/256;i.chr}.reverse.join' --MarkusQ