Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Home Directory In CVS

timothy posted more than 10 years ago | from the good-ideas dept.

Data Storage 414

shamir_k writes "Joey Hess has come up with an innovative solution to a problem we have all faced. He's put his whole home directory in CVS. Not only can he move between multiple computers easily, he also has automatic distributed backups."

cancel ×

414 comments

Sorry! There are no comments related to the filter you selected.

Ugh... (-1, Troll)

Leomania (137289) | more than 10 years ago | (#7448931)

Obligatory "I hate CVS" message. Can't wait for Subversion to come of age.

- Leo

Re:Ugh... (0)

Anonymous Coward | more than 10 years ago | (#7448981)

I hate CVS, and I have my Debian home directory on Subversion without data loss or another problem.

Subversion rocks! (2, Interesting)

Anonymous Coward | more than 10 years ago | (#7449027)

Obligatory link to Subversion [tigris.org] , since this new-fangled hypertext media allows it.

(With a hint of sarcasm for you mentioning it but not linking!)

From personal experience it seems to be quite usable already. Although I did find it hard to install and get everything set up properly (path problems, etc) partly because I'm a Visual SourceSafe refugee. I'm still not quite used to the pathing schemes and checkin model and am still confused by wanting to assign a VSS-style 'working directory' to a Subversion folder and not knowing what to do about that.

Re:Subversion rocks! (1)

Leomania (137289) | more than 10 years ago | (#7449042)

Yeah yeah, it was a fast post. Like this one. Thought about it but decided to hit the "Submit" button.

Thanks for taking up my slack.

- Leo

FP for teh GNAA (-1, Troll)

Anonymous Coward | more than 10 years ago | (#7448935)

I just heard some sad news on talk radio - Server/Alternative OS *BSD was found dead in it's primary server this morning. There weren't any more details. I'm sure everyone in the Slashdot community will miss it - even if you didn't enjoy its work, there's no denying its contributions to Slashdot trolling. Truly an American icon.

Family members of the BSD community ask that people send donations to their favorite Open Source project in lieu of sending soap.

propz to my GNAA niggaz

I just heard some happy news on talk radio... (-1)

Fecal Troll Matter (445929) | more than 10 years ago | (#7448984)

The short lived pimply faced coalition of asexual preteens, the self proclaimed "GNNA" has been officially disbanded. Upon receiving the news, Hemos was comforted by a close-knit circle of family and friends as CmdrTaco and Michael held an all-night drunken homosexual fuck-fest. Even if you weren't aware of the GNNA, (which most of us aren't) their contributions to the Slashdot community truly prove them as shitheads.

wooo (-1, Offtopic)

led_belly (150152) | more than 10 years ago | (#7448936)

wooo

brilliant (-1, Troll)

Anonymous Coward | more than 10 years ago | (#7448939)

freaking brilliant, i have no idea what CVS is or how putting you hiome DIr in there will solve a problem, but hey it's in /. and thererfore must be brilliant!

I keep my life in a CVS repository (0)

Anonymous Coward | more than 10 years ago | (#7448941)

WTF, can he travel back to previous versions also?

Re:I keep my life in a CVS repository (5, Funny)

Rosco P. Coltrane (209368) | more than 10 years ago | (#7448991)

No. But you can do this right now:

cvs commit suicide

Comma Delimited??? (1, Funny)

Anonymous Coward | more than 10 years ago | (#7448943)

How does that work?

oh, i, get, it,

CVS, not CSV idiot. (0)

Anonymous Coward | more than 10 years ago | (#7448969)

ibid.

Joke, not serious comment ,idiot (0)

Anonymous Coward | more than 10 years ago | (#7449004)

You missed a comma by the way. Ironic in an Alanys Morisette way perchance?

Re:Comma Delimited??? (0)

Anonymous Coward | more than 10 years ago | (#7448970)

Darn Dyslexia.

Described in Linux Journal months ago (2, Interesting)

HuguesT (84078) | more than 10 years ago | (#7448951)

This is innovative but not new, the LJ article is dated September 2002.

Waky, waky editors?

Re:Described in Linux Journal months ago (3, Funny)

kajoob (62237) | more than 10 years ago | (#7449018)

I like ragging the editors as well, but come on, the blurb said 'innovative' and that is all. There's nothing about "new" mentioned anywhere in there, you pulled that out of your ass just so you could complain. Now quitcherbitchin and just read the kewlness that is home directies in cvs. ;)

Re:Described in Linux Journal months ago (0)

Anonymous Coward | more than 10 years ago | (#7449026)

wacky, as in races or wakey as in wake up?

Re:Described in Linux Journal months ago (1)

LiquidCoooled (634315) | more than 10 years ago | (#7449035)

maybe now its reached v1.0 ?

should have chose xls (-1)

circletimessquare (444983) | more than 10 years ago | (#7448953)

then he can make powerpoint slides out of it too

Re:should have chose xls (0)

Anonymous Coward | more than 10 years ago | (#7449134)

How is it you can post mostly thoughtful comments to "the other site" (or more accurately, the site for which this site is "the other site") and yet turn into a drivel spouting troll here?

Re:should have chose xls (1)

DavidLeblond (267211) | more than 10 years ago | (#7449204)

Seeing how its CVS not CSV, shouldn't you say "he should have chosen XSL?"

Here's a piece of advice (5, Funny)

Rosco P. Coltrane (209368) | more than 10 years ago | (#7448959)

Don't forget the -kb switch when you do "cvs add pr0n.avi", otherwise you'll be disappointed when check the file out again.

Re:Here's a piece of advice (3, Funny)

Anonymous Coward | more than 10 years ago | (#7449083)

CVS will also be a great help when you download pr0n that have the same file names.

like: untitled.bmp and untitled.bmp - even though they're two different pictures! It'll save the time to rename whole directories!

And, you can hide all your pr0n from prying eyes too! OOooooo Ahhhhhh!

Unless, you've named your tree - jerkoff_material.

Pun Intended... (5, Funny)

Vaulter (15500) | more than 10 years ago | (#7449100)


"Hold on a minute, I've got to check out this porn."

Re:Here's a piece of advice (-1, Flamebait)

Anonymous Coward | more than 10 years ago | (#7449158)

Okay, here's a piece of advice. Get a fucking life. Seriously, if you have any idea what anything in this article is about, then you are a loser. Period.

Hackable (0)

Anonymous Coward | more than 10 years ago | (#7448960)

Great, let's go hack it now! :)

Old news, good read (0, Redundant)

lastberserker (465707) | more than 10 years ago | (#7448963)

Sorry to break you, but I was doing it (albeit on a smaller scale) for years ;-P Good reading though.

Re:Old news, good read (1)

lastberserker (465707) | more than 10 years ago | (#7448994)

Oh, and the real beast is that CVS is negligent to chmod stuff. Move on, nothing to see here...

Not Innovative (0, Redundant)

Anonymous Coward | more than 10 years ago | (#7448964)

Innovative? I don't think so. I would imagine that many people who are familiar with CVS are doing this.

What's next? Keeping system configuration in CVS?

Re:Not Innovative (5, Funny)

TheZax (641389) | more than 10 years ago | (#7449114)

What's next? Keeping system configuration in CVS?

Slow down, I can only patent so quickly...

Note to self:

1. Patent home dir in CVS

2. Patent system configs in CVS

3. Patent pr0n in CVS (note -kb)

CVS takes files? (5, Funny)

cuppm (691831) | more than 10 years ago | (#7448967)

Man, I have a hard enough time trying to get them to accept my insurance card for prescriptions. Hats off to him for getting them to take his files...

My favorite directory to put in CVS (4, Interesting)

Beryllium Sphere(tm) (193358) | more than 10 years ago | (#7448968)

/etc

Have a checkin comment for why a configuration change got made. Be able to roll back a failed experiment reliably. Find out when a change happened.

Or just RCS (2, Interesting)

A nonymous Coward (7548) | more than 10 years ago | (#7448986)

I put RCS subdirs all over, check files in and out.

It also makes complete OS upgrades easier, I use the RCS subdirs to tell what I changed from the base install.

Re:My favorite directory to put in CVS (4, Funny)

Rosco P. Coltrane (209368) | more than 10 years ago | (#7449113)

My favorite file to put in CVS : /dev/hda1. Takes a while to recover an old file though ...

Obligatory Duplicate Article Post (0)

Anonymous Coward | more than 10 years ago | (#7448971)

Wasn't this exact same article posted a few months back? I remember thinking it was a cool idea, but I never got around to it.

Anonymous Kev
Proudly posting as AC since 1997

Great idea (-1)

Anonymous Coward | more than 10 years ago | (#7448974)

This is a great idea. Unfortunately CVS is too hard for most Joe users to administer though, so it would be nice to see this functionality adapted and integrated transparently into a major Linux. This could be the sword that severs Microsofts head of desktop dominance.

I wonder..... (4, Interesting)

The One KEA (707661) | more than 10 years ago | (#7448977)

Has anyone tried this with BitKeeper [bitmover.com] ?

Re:I wonder..... (4, Informative)

Kourino (206616) | more than 10 years ago | (#7449030)

You wouldn't do this in Bitkeeper if you were a privacy freak. Remember, the Bitkeeper liscense requires that you maintain open logging. Realistically, this means that info about what files you change get transmitted across the network; I don't know if it's encrypted or not. It's not that big of a deal, but I'm sure someone here would care.

That being said, doing it in BK would be a compelling alternative if you wanted to use the same /home repo across (say) three or more machines, since you could take advantage of its more complex merge operators. Arch or SVN also might be good ideas. (Don't have any experience with Subversion, though.)

Re:I wonder..... (1)

Cramer (69040) | more than 10 years ago | (#7449205)

For the free license, the repo itself would have to be public. Open Logging does not send the changes, just a summary of the files changed and comments. And as of a few weeks ago, you couldn't browse the openlogging tree anyway :-) So, openlogging isn't the problem.

And no one has pointed out the obvious: what do you do when the CVS server dies? CVS is not distributed. There is exactly ONE copy of the repo. You cannot restore the repo from a checked out copy as it only carries one version of the file(s). BK is distributed; one works from a clone of the repo that can be used to restore a lost server.

[Personally, I prefer clearcase for my SCM needs. But it's not distributed either. And there's no flavor of it that's even remotely free. Hmm, a home dir as a clearcase dynamic view??? That'd be tricky.]

Why just home? (5, Interesting)

AuMatar (183847) | more than 10 years ago | (#7448979)

I asked this on a local linux mailing group recently- what do people think about the idea of a version control file system? Disk space is cheap these days, we can afford it space wise. Think of all the problems it would solve.

*Made a mistake in your config file? Revert it
*User deleted the file? Revert it
*Want to see why you made a change to any given file? Check the comments (commenting would be optional, of course)
*Your system was exploited? Revert the entire system to before the exploit
*Upgraded an app and regret it? Revert the files

And so on. I'm not sure if CVS would be the best method (I'm not a SCM specialist), but I'd see this as an extremely useful feature who's time has come.

Re:Why just home? (0)

Anonymous Coward | more than 10 years ago | (#7448997)

I remember back in college whatever filesystem VMS uses had auto versioning of files that were denoted with a semi-colon followed by a number attached to the end of the filename.

Re:Why just home? (0)

Anonymous Coward | more than 10 years ago | (#7449141)

It's so fun, we are using this convention at work on every OS we deliver. Kinda scary.

Re:Why just home? (4, Informative)

PhilipPeake (711883) | more than 10 years ago | (#7449033)

Ever hear of VMS ?

It had a filestore with file versioning - about 30 years ago.

VMS file versioning was fantasic (0)

Anonymous Coward | more than 10 years ago | (#7449062)

... until you needed to recover something

Re:Why just home? (1)

AuMatar (183847) | more than 10 years ago | (#7449063)

Before my time. Heck, before my birth (I've hear of the OS, but never experienced it). Perhaps its time to revive that feature, then.

Re:Why just home? (0)

Anonymous Coward | more than 10 years ago | (#7449090)

Sure did, and it was fucking amazing.

Re:Why just home? (2, Informative)

Jim Hall (2985) | more than 10 years ago | (#7449173)

Ever hear of VMS ? It had a filestore with file versioning - about 30 years ago.

Not just VMS. Apollo DOMAIN had something like this, too. -jh

Re:Why just home? (5, Informative)

Jellybob (597204) | more than 10 years ago | (#7449056)

I'll get modded down to oblivion for mentioning an MS product in a positive light, but Windows XP+2003 Server supports this already.

Users can rollback to previous revisions of files that they've saved to the 2k3 server, saving the sysadmins the time of restoring *another* accidently deleted file from the backup tapes.

Re:Why just home? (1)

BiggerIsBetter (682164) | more than 10 years ago | (#7449094)

Hasn't Novell had this functionality for years?

Re:Why just home? (1)

Jellybob (597204) | more than 10 years ago | (#7449120)

Very possibly - I wouldn't know though, since I work is an MS shop, and home is Linux based.

Re:Why just home? (1)

soundbyt (515293) | more than 10 years ago | (#7449142)

Yes, since at least 4.x (When I became familar with it.)

Re:Why just home? (0, Troll)

mastropiero (258677) | more than 10 years ago | (#7449193)

Users can rollback to previous revisions of files

Including the local copy of the Worm of The Week (TM), too! :)

Re:Why just home? (0)

Anonymous Coward | more than 10 years ago | (#7449060)

Amen, why are we still using shitty filesystem that

1) don't index their contents effectively (Reiserfs being a counter-example).

2) don't version all changes (doesn't VMS do this to some extend)?

This would be something cool for open source to do, but I fear Microsoft will beat us to it.

Re:Why just home? (1)

metlin (258108) | more than 10 years ago | (#7449068)

If I'm not mistaken, MS is trying something like this with their Filesystem for LongHorn (the enterprise edition).

Not too sure, though.

Re:Why just home? (1)

TClevenger (252206) | more than 10 years ago | (#7449096)

Novell's had it since at least version 4. Accidentally deleted or corrupted a file? Go back and recover any of the last few saves.

Re:Why just home? (5, Insightful)

pclminion (145572) | more than 10 years ago | (#7449069)

The basic problem with versioning in the file system is deciding when to commit. Do you commit for every byte written? Of course not, that would be a massive waste of time and disk space. Do you commit once for every write() call? That suffers the same problem, because sometimes writes are very small, and you can never predict in advance how large a write will be.

You can't automatically commit after every xxx bytes of data written, because that means there will be a bunch of intermediate states on disk, most of which are probably bogus (this argument applies to the above two options as well).

The only thing that even remotely makes sense is to commit on close(), but that doesn't make sense for applications like text editors which keep the file open for the entire duration. You want each SAVE to be a commit, not each CLOSE.

What this boils down to is that there must be application level support for the commit operation (i.e., a new commit() syscall). The application has to specifically be coded to tell the operating system "Ok, I'm done with the revision, commit this now." And that means every application on the system will have to be tweaked to make the necessary commit calls, not to mention the thought that goes into deciding WHEN it is appropriate to commit. I would wager that a lot of maintainers wouldn't bother to make those changes, and as a result those applications wouldn't support versioning.

I agree that a versioned file system would kick ass, and there are even some out there already (Google for "versioning filesystems"). But they tend to be special purpose. I don't see how it could be cleanly and transparently integrated into a general purpose system such as Linux.

Note that I didn't bother to check CiteSeer to see if there is academic work on this before posting this comment. So if anyone knows of any work toward that end, I'm sure a lot of us would appreciate a pointer to it.

Re:Why just home? (1)

AuMatar (183847) | more than 10 years ago | (#7449128)

Hmm. But a save would be a commit with a save on close. Look at the disk API- fopen, fread, fwrite, fseek, fclose. THere is no fsave. To do a save, you open the file in write mode, write the data, then close it every time. So that would work. You would have more commits than necessary (for those of us who save every few minutes), but thats better than too few.

We would, however need a new system call close_with_comments that comments a commit (the old style close would not comment, thus allowing backward compatibility).

Obviously, it would need work, especially on the version control side. But I think its workable, I don't expect a working spec after 1 slashdot discussion and a few seconds thought.

Re:Why just home? (4, Informative)

AuMatar (183847) | more than 10 years ago | (#7449156)

To make this more legible- a text editor, for example, does not have the file open the entire time waiting for input. It opens the file, reads it, then closes it at startup. When the user hits save (through keyboard commands, mouse click, whatever), the editor opens the file again, this time in write mode, writes the data, and closes it. By this model, close could be the commit function, and open could be the checkout function.

Re:Why just home? (1)

santiago (42242) | more than 10 years ago | (#7449206)

The easiest solution is probably to do an automatic commit of everything every 24 hours or so, with the option to do a manual commit of select files whenever you want. It gives you reasonable rollback ability without active user intervention and allows users to demarcate specific points that they want to be able to return to. Most importantly, it doesn't require any changes to existing programs and file-access models.

um outdated ? Hell I have the paper print of this. (0)

Anonymous Coward | more than 10 years ago | (#7448980)

Posted on Sunday, September 01, 2002 by Joey Hess

It is a great article, don't get me wrong... it is just a little over a year old.... news ?

Re: an innovative solution (4, Funny)

Anonymous Coward | more than 10 years ago | (#7448990)

... quick, patent it!

Ugh! (0)

Anonymous Coward | more than 10 years ago | (#7448992)

Who has been checking in these skanky whores to ~/porn ?

Don't forget... (-1, Troll)

Anonymous Coward | more than 10 years ago | (#7448993)

...to pay your $1499 licensing fee you cock-smoking teabaggers.

Remember, the price went up November 1st.

Re:Don't forget... (0)

Anonymous Coward | more than 10 years ago | (#7449119)

SCO$699/$1499FeeTroll posts are always successful first posts. Don't tarnish the image you cock-smoking teabagger.

Re:Don't forget... (0)

Anonymous Coward | more than 10 years ago | (#7449157)

Pay up, cock-smoker.

Ehhh, again, years behind NT. (0, Flamebait)

GlassUser (190787) | more than 10 years ago | (#7448995)

I've been doing this for almost two years on NT. Keep a roaming profile on a DFS root. I keep a backend server separate so I always have a replicated backup. It also keeps replicated with other sites (work and the other office). Sigh.

Re:Ehhh, again, years behind NT. (1)

FuzzieNorn (203503) | more than 10 years ago | (#7449061)

Did you miss the bit where CVS keeps version changes?

slashdotted... (0)

jazznjava (639633) | more than 10 years ago | (#7449002)

I guess he forgot to put his website on CVS

Re:slashdotted... (2, Informative)

cuppm (691831) | more than 10 years ago | (#7449039)

Joey shows you how to keep track of everything with CVS.

I keep my life in a CVS repository. For the past two years, every file I've created and worked on, every e-mail I've sent or received and every config file I've tweaked have all been checked into my CVS archive. When I tell people about this, they invariably respond, ``You're crazy!''

After all, CVS is meant for managing discrete bodies of code, such as free software programs that are worked on and available to a lot of people or in-house projects that are collaboratively developed by several employees. CVS has a reputation of being a pain to deal with, and it has a lot of crufty bits that regularly drive users up the wall, like its mistreatment of directories. Why inflict the pain of CVS on yourself if you don't have to? Why do it on such a scale that it affects nearly everything you do with your computer?

I get three major benefits from keeping my whole home directory in CVS: home directory replication, history and distributed backups. The first of these is what originally drove me to CVS for my whole home directory. At the time, I had a home desktop machine, two laptops and a desktop machine at work. Rounding this out were perhaps 20 remote accounts on various systems around the world and many systems around the workplace that I might randomly find myself logging in to. I used all of these accounts for working on the same projects and already was using CVS for those projects.

I'm a conservative guy when it comes to my computing environment (I've used the same wallpaper image for the past five years), and at the same time I'm always making a lot of little tweaks to improve things. Whenever I go to work and something wasn't just like I had tweaked it the night before, I'd feel a jarring disconnect, and annoyingly copy over whatever the change was. When I sat down at some other system at work, to burn a CD perhaps, and found a bare Bash shell instead of the heavily customized environment I've built up over the past ten years, it was even worse. The plethora of environments, each imperfectly customized to my needs by varying degrees, was really getting on my nerves. So one day I cracked and sat down and began to feed my whole home directory into CVS.

It worked astonishingly well. After a few weeks of tweaking and importing I had everything working and began developing some new habits. Every morning (er, afternoon) when I came into work, I'd cvs up while I read the morning mail. In the evening, I'd cvs commit and then update my laptop for the trip home. When I got home, I'd sync up again, dive right back into whatever I'd been doing at work and keep on rolling until late at night--when I committed, went to bed and began the cycle all over again. As for the systems I used less frequently, like the CD burner machine, I'd just update when I got annoyed at them for being a trifle out of date.

It only took a few more weeks before the advantage of having a history of everything I'd done began to show up. It wasn't a real surprise because having a history of past versions of a project is one of the reasons to use CVS in the first place, but it's very cool to have it suddenly apply to every file you own. When I broke my .zshrc or .procmailrc, I could roll back to the previous day's or look back and see when I made the change and why. It's very handy to be able to run cvs diff on your kernel config file and see how make xconfig changed it. It's great to be able to recover files you deleted or delete files because they're not relevant and still know you've not really lost them. For those amateur historians among us, it's very cool to be able to check out one's system as it looked one full year ago and poke around and discover how everything has evolved over time.

The final major benefit took some time to become clear. Linus Torvalds once said, ``Only wimps use tape backup: real men just upload their important stuff on FTP and let the rest of the world mirror it.'' I'm not a real enough man to upload my confidential documents to ftp.kernel.org though, so I've been wimping along with backups to tape and CD and so on. But then it hit me: take, for example, one crucial file, like my .zshrc or sent-mail archive: I had a copy of that file on my work machine, and on my home machine, and on my laptop and several other copies on other accounts. There was another copy encoded in my CVS repository too.

I'm told that the best backups are done without effort--so you actually do them--and are widely scattered among many machines and a lot of area so that a local disaster doesn't knock them out. They are tested on a regular basis to make sure the backup works. I was doing all of these things as a mere side effect of keeping it all in CVS. Then I sobered up and remembered that a dead CVS repository would be a really, really bad thing and kept those wimpy backups to CD going. But the automatic distributed backups are what keep me sleeping quietly at night. Later, when I left that job, the last thing I did on my work desktop machine was: cvs commit ; sudo rm -rf /. And I didn't worry a bit; my life was still there, secure in CVS.

A full checkout of my home directory with all the trimmings often runs about 4GB in size. A lot of that will be temporary trees in tmp/ and rsynced Ogg Vorbis files (so far, I have not found the disk space to check all of them into CVS). My CVS repository currently uses less than 1GB of space, though it is steadily growing in size. I keep some 13,000 files in CVS, and so a full CVS update of my home directory is a sight to see and takes a while.

These days I'm often stuck behind a dial-up connection, and I mostly just use one laptop, so I might go days between CVS updates. Other better-connected systems have automatic CVS updates done via cron each day. I cvs commit whenever I want to make a backup of where I am in a file or when I am at the point of releasing something. I still also do a full commit of my home directory every day or so. I confess that some of my CVS commit messages are less than informative--``foo'' has been used far too many times on some classes of files. I even do some automatic CVS commits; for example, my mailbox archives are committed by a daily cron job.

There are other benefits of course. I attend many tradeshows and other events that require me to sit down at some computer out of the box, use it for an hour or a day and never see it again. I can check out the core of my CVS home directory in about five minutes, and after that it is just as comfortable as if I'd SSH'd home and was doing everything there. I even get my whole desktop set up in that five minutes. In a chaotic tradeshow environment, there is nothing more reassuring than having your familiar computer setup at your fingertips as you demo things to the hordes of visitors.

Keeping your home directory in CVS is not all fun though. Anyone who's used CVS in a large project probably has had to resolve conflicts engendered by two people modifying the same file. At least you can curse the other guy who committed the changes first while you deal with this annoying task. Most of you have probably not had to resolve conflicts between the file you modified at home and at work, then cursing at yourself.

Then there are CVS's famous problems: poor handling of directories and binary files. The nearly nonexistent handling of permissions, which is not a big deal in most projects but becomes important when you have a home directory with some public and some private files and directories in it. A slow, bloated protocol, hindered even more by the necessity of piping it all over SSH; the pain of trying to move a file that is already in CVS, or much worse, a whole directory tree, again hits you especially hard when you're using CVS for the whole home directory. And those damn CVS directories are always cluttering up everything. I've developed means of coping with all of these to varying degrees, but like many of us, I'm hoping for a better replacement one day (and dreading the transition).

Perhaps it's time that I get down to the details of how I organize my home directory in CVS. I've always managed my home directory with an iron hand, and CVS has just exacerbated this tendency. Let's look at the top level:

joey@silk:~>ls
CVS/ GNUstep/ bin/ debian/ doc/ html/ lib/
mail/ src/ tmp/

Yes, that's it. Well, except for the 100-plus dot files. Most people use their home directory as a scratch space for files they're working on, but instead I have a dedicated scratch directory, the tmp directory, which I clean out irregularly. In general, when I start a new file or project, I will be checking it into CVS soon, so I begin working on it in the appropriate directory. This document, for example, is starting its life in the html directory and will be checked into CVS soon to live there forever. Of course, sometimes I goof up and then I have to resort to the usual tricks to move files in CVS. And so the first rule of CVS home directories is it pays to think before starting and get the right filename and location the first time. Don't be too impatient to check in the file.

CVS is a great way to ensure that you have a nice, clean, well-managed home directory. Every time I cvs update it will helpfully complain to me about any files it doesn't know about. Of course, I make heavy use of .cvsignore files in some directories (like tmp/).

If I go to another machine, the home directory looks pretty much the same, though various things might be missing:

joeyh@auric:~>ls
CVS/ GNUstep/ bin/ tmp/

I use this machine for occasional specific shell purposes. I don't administer the system, so I don't want to put private files there. The result is a much truncated version of my home directory. It's perfectly usable for everything I normally do on that machine, and if I want to, say, work on this document there at some point, I can just type cvs co html and a password and be on my way.

The way I make this partial-checkouts system work is by using CVS modules and aliases. I have modules defined for each of the top-level directories and for the home directory (dot files) itself. For example, the entry in my CVSROOT/modules file for the stripped-down version of my home directory looks like this:

joeyh -u cvsfix -o cvsfix joey-cvs/home &bin

For more complete home directories, I use this instead:

joey -u cvsfix -o cvsfix joey-cvs/home &src &doc
&debian &html &lib &.hide &bin &mail

Notice the .hide module. It results in a ~/.hide directory when I check it out. This directory is where I put the occasional private file that I don't want to appear in home directories--like the one on auric--that are on systems not administered by me. The files in .hide get hard-linked to their proper locations if .hide is checked out, so I can put confidential dot files in there and only check those dot files out on trusted systems. I also have, for example, my Mozilla cookies file in .hide.

It's important to distinguish between such files that I need to put in .hide and the entire set of private directories, like my mail directory. Yes, I keep my mail in CVS (except for just-arrived spooled mail, which I keep synced up with a neat little program called isync that is smarter about mail than CVS is). But it's all in its own mail/ directory, so I can omit checking that directory out to systems that I don't trust with my mail or that I don't want to burden with hundreds of megabytes of mail archives.

While I'm discussing privacy issues, I should mention that I make some bits of my home directory completely open to the public. This includes a lot of free software in debian/ and src/, and some handy little programs in bin/. This is accomplished by permissions. I have to make sure that most directories in the repository (or at least the top-level directories like mail/) are mode 700, so only I can access them. Other top-level directories, like bin/, are opened up to mode 755. This allows anonymous CVS access and browsing at cvs.kitenet.net/joey-cvs/bin/.

This leads to the second rule of CVS home directories: don't import $HOME in one big chunk; break it up into multiple modules. The structure of your repository need not mirror the structure of your actual home directory. Modules can be checked out in different locations to move things around and control access on a per-module level. There's a layer of indirection there, and such layers always make things more flexible and more complex.

Some of the projects I work on have their own CVS repositories that are unconnected to my big home directory repository. That's fine too; I simply check them out into logical places in my home directory tree as needed. CVS can even be tweaked to recurse into those directories when updating or committing.

Another thing to notice in those lines from my modules file is the use of -u cvsfix to make the cvsfix program run after CVS updates. That program does a lot of little things, including ensuring that permissions are correct, setting up the hard links to files in .hide and so on.

One last thing to mention is the issue of heterogeneous environments and CVS. Most of my accounts are on systems running varying versions of Debian Linux on a host of different architectures, but there are accounts on other distributions, on Solaris and so forth. Trying to make the same dot files work on everything can be interesting. My .zshrc file, for example, goes to great pains to detect things like GNU ls, deals with varying zsh versions, sets up aliases to the best available editor and other commands and so on. Other programs, like .xinitrc, check the host they're running on and behave slightly (or completely) differently. I've even at one point had a .procmailrc that filtered mail differently depending on hostname, though the trick to doing that is lost somewhere in one of the innumerable versions stored in my repository. I've even resorted in a few places to files with names of the form filename.hostname--cvsfix finds one matching the current host and links it to the filename. Branches are also a possibility, of course, but despite my heavy use of CVS, I still find some corners of it a black art.

Well I guess that's it. I'd be happy to hear from anyone else who keeps their home directory in CVS, especially if you have some tricks to share. In the future I'd like to try checking /etc into CVS too, and if you've successfully done this, I'd love to talk with you. Now I'm off to commit this file.

Sourceforge (5, Funny)

Smitty825 (114634) | more than 10 years ago | (#7449003)

I'll put my home directory on Sourceforge! Everyone can now help me maintain it!

Re:Sourceforge (5, Funny)

AvantLegion (595806) | more than 10 years ago | (#7449149)

I patched your political science essay.

I fixed all the anti-Bush bugs.

How does he handle renaming and erasing in CVS? (5, Interesting)

Anonymous Coward | more than 10 years ago | (#7449008)

'cause CVS loses the history in these operations.

CVS, eh? (4, Informative)

Kourino (206616) | more than 10 years ago | (#7449010)

I wonder why CVS, and not something more advanced, like Arch [gnu.org] or Subversion [tigris.org] ? Especially since he outright complains about common limitations in CVS, like moving files and dealing with directories at all. If he's hoping, as he says, "for a better replacement some day", why not see what the present has to offer?

I mean, that's not to say that alternative systems are perfect, either. I'm going through the process of learning arch now. There's a learning curve, but not nearly as big as it's made out to be. Still, using something else (almost anything else) would probably help on things like the merging issues, especially since he mentions that sometimes it's a pain keeping things in sync between three of his machines.

Re:CVS, eh? (1)

ka9dgx (72702) | more than 10 years ago | (#7449055)

I'm going to guess, and say it's because CVS farm more is likely to be installed on a given machine. I could be wrong.

--Mike--

Re:CVS, eh? (4, Informative)

self assembled struc (62483) | more than 10 years ago | (#7449104)

well,

have you every tried to install and set up subversion?

plus, after years and years of development, it's still point-oh-something and specifically states they can only guarentee that your repository can be read with x number of versions after the version that created it.

as for arch, i've been looking into it, but it's still a hack onto cvs.

subversion gets some of it right, but at my old company we used perforce and honestly, i'm spoiled and i've been trying to find a free (just as in beer, free as in speech would be nice, but i just want to get my work done quickly and without hassle) source control client that can mimic the functionality and stability of perforce, and i've yet to find one.

too bad my new place won't shell out the $650/seat for the license...

Re:CVS, eh? (1)

Kourino (206616) | more than 10 years ago | (#7449188)

Heh. I have heard that Subversion archives are just awful to get set up right.

How do you mean that "arch is a hack onto CVS"? (I guess I had forgotten about archive format stability, though.)

reiserfs (1)

Space cowboy (13680) | more than 10 years ago | (#7449014)

Isn't this the sort of plug-in thing that Reiserfs is supposed to make a lot easier to do at a fundamental level ?

As I understand it, you register callbacks on the atomic operations of the FS, and your code gets run with appropriate parameters before/after whatever. A bit like SQL triggers...

Simon.

Innovative solution? (0, Troll)

matt-fu (96262) | more than 10 years ago | (#7449016)

While this is a cool idea, it's not even remotely innovative. Can we please put up some kind of first year Unix user filter for story submissions?

auto-backups the plan9 way (4, Interesting)

DrSkwid (118965) | more than 10 years ago | (#7449023)

Plan9 has the mantra : "file creation is forever"

Automated incremental backups are a way of life.

With Venti [bell-labs.com] one can even back up two windows/linux machines and *not* use up disk space for commonly used blocks, so backing up 100 machines wont use up the usual 1Gb each for the duplicate libs/windows directories.

The yesterday [bell-labs.com] command give you the power to browse back through your life

Find what has changed in the C library since March 1:

yesterday -d -0301 /sys/src/libc/port/*.c

When did you say this guy did the innovation again?

Re:auto-backups the plan9 way (5, Funny)

Rosco P. Coltrane (209368) | more than 10 years ago | (#7449180)

Right, so on plan9, you can recover all your previous file versions, for example, letter_to_boss.txt :

v1.0: "You stupid fuck, why don't you give me a raise some day?"

v1.1: "You tight-pocketed capitalist, isn't it high time you gave me a raise?"

v1.2: "Hey Boss, I really think I deserve a raise, I've been working on this project for so long."

v1.3: "Hello Boss, I respectfully request that you should consider giving me a raise, as I think have proven to be a reliable, hard-working employee. Please?"

v1.4-FINAL: "Dear Mr. Schmoe, I wish to apologize in advance for stopping work on our most important project for five minutes, but I would like to present an idea to you : you see, ever since I have started working at 6-pack computing, I've tried to be a model employee and ... ... ..."

Just trying to sell more advertising (0, Troll)

Nuclear Elephant (700938) | more than 10 years ago | (#7449024)

And how the hell is this newsworthy? it's not...slashdot has once again gone a little further downhill in the quality of their news; this time so that we'll look at their new pretty banners and earn them double the cash every time we look at an article. now that slashdot is obviously heading in the commercial direction maybe someone ought to consider putting together a new geek news site?

Re:Just trying to sell more advertising (1)

AJWM (19027) | more than 10 years ago | (#7449073)

The problem with putting together a new geek news site is that, by definition, it'll be slashdotted every day.

Re:Just trying to sell more advertising (1)

Nuclear Elephant (700938) | more than 10 years ago | (#7449115)

A bunch of geeks whining about bandwidth..isn't that original

Temporary solution for the few? (1)

xanthines-R-yummy (635710) | more than 10 years ago | (#7449025)

Correct me if I'm wrong, but if everyone from /. did this, wouldn't CVS collapse? I mean, he's got a GB (4GB overall, I guess). Multiply that by 1000's.... My university only gives out 100M for webdrive type stuff for its staff, and even that amount was a pain to get.

What's the point of saturation?

Re:Temporary solution for the few? (1)

AuMatar (183847) | more than 10 years ago | (#7449085)

Umm, CVS isn't on a web server somewhere at one central location. You run it on your own machine.

Oh I like that (3, Insightful)

The Munger (695154) | more than 10 years ago | (#7449028)

That's a smart way of doing things. I've found version control to be worthwhile on even single user projects. Having the same kind of backup/restore and history tracking on every one of your files just makes sense. I'm suprised no-one has done this sooner.

In a slightly more abstract sense, it provides a 'working set' of documents on your computer. Comments on your version history adds meta-data to files that is time-based. Most systems at the moment add meta-data that is for the current file. Imagine, you check in some files with a comment like 'Project: holiday snaps 03'. Then later on, you use one of those files in a presentation 'Project: report for Bill 03'. With standardised formatting of such tags, the file keeps with it the idea that it has been used with multiple projects at different times. That's a powerful method of grouping.

Ever been in the situation where a file belongs with multiple projects? With your standard directory structures, you might put it in one directory and shortcut/alias/whatever it in the other (or maybe make a second copy). It's pretty ugly right? What if you could say, this file belongs to both of these projects, and you could even provide the old version that was used in another project. OK, so all of that would require some more automation - we can dream can't we?

That has a lot of possibilities.

Conservative eh? (0)

Anonymous Coward | more than 10 years ago | (#7449034)

I'm a conservative guy when it comes to my computing environment (I've used the same wallpaper image for the past five years)

Pff, big deal, I've used the same toilet paper for 5 years! How about that for conservative?

Join the GNAA! (-1, Troll)

Mr Haxalot (723260) | more than 10 years ago | (#7449048)

GNAA (GAY NIGGER ASSOCIATION OF AMERICA) is the first organization which
gathers GAY NIGGERS from all over America and abroad for one common goal - being GAY NIGGERS.

Are you GAY [klerck.org] ?
Are you a NIGGER [tux.org] ?
Are you a GAY NIGGER [gay-sex-access.com] ?

If you answered "Yes" to any of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!
Join GNAA (GAY NIGGER ASSOCIATION OF AMERICA) today, and enjoy all the benefits of being a full-time GNAA member.
GNAA (GAY NIGGER ASSOCIATION OF AMERICA) is the fastest-growing GAY NIGGER community with THOUSANDS of members all over United States of America. You, too, can be a part of GNAA if you join today!

Why not? It's quick and easy - only 3 simple steps!

First, you have to obtain a copy of GAY NIGGERS FROM OUTER SPACE THE MOVIE [imdb.com] and watch it. (click here to download the 280MB MPEG from BitTorrent [idge.net] )

Second, you need to succeed in posting a GNAA "first post" on slashdot.org [slashdot.org] , a popular "news for trolls" website

Third, you need to join the official GNAA irc channel #GNAA on EFNet, and apply for membership.
Talk to one of the ops or any of the other members in the channel to sign up today!

If you are having trouble locating #GNAA, the official GAY NIGGER ASSOCIATION OF AMERICA irc channel, you might be on a wrong irc network. The correct network is EFNet, and you can connect to irc.secsup.org or irc.easynews.com as one of the EFNet servers.
If you do not have an IRC client handy, you are free to use the GNAA Java IRC client by clicking here [nero-online.org] .

If you have mod points and would like to support GNAA, please moderate this post up.

This post brought to you by Penisbird [nero-online.org] , a proud member of the GNAA

G_____________________________________naann_______ ________G
N_____________________________nnnaa__nanaaa_______ ________A
A____________________aanana__nannaa_nna_an________ ________Y
A_____________annna_nnnnnan_aan_aa__na__aa________ ________*
G____________nnaana_nnn__nn_aa__nn__na_anaann_MERI CA______N
N___________ana__nn_an___an_aa_anaaannnanaa_______ ________I
A___________aa__ana_nn___nn_nnnnaa___ana__________ ________G
A__________nna__an__na___nn__nnn___SSOCIATION_of__ ________G
G__________ana_naa__an___nnn______________________ ________E
N__________ananan___nn___aan_IGGER________________ ________R
A__________nnna____naa____________________________ ________S
A________nnaa_____anan____________________________ ________*
G________anaannana________________________________ ________A
N________ananaannn_AY_____________________________ ________S
A________ana____nn_________IRC-EFNET-#GNAA________ ________S
A_______nn_____na_________________________________ ________O
*_______aaaan_____________________________________ ________C
um, dolor. Nunc nec nisl. Phasellus blandit tempor augue. Donec arcu orci, adipiscing ac, interdum a, tempus nec, enim. Phasellus placerat iaculis orci. Crasa sit amet quam. Sed enim quam, porta quis, aliquet quis, hendrerit ut, sem. Etiam felis tellus, suscipit et, consequat quis, pharetra sit amet, nisl. Aenean arcu massa, lacinia in, dictum eu, pulvinar ac, orci. Mauris at diam tempor ante ullamcorper molestie. Ut dapibus eleifend ipsum. Nam dignissim.

ssh private keys (2, Insightful)

smcavoy (114157) | more than 10 years ago | (#7449053)

somehow I don't like the idea of my private ssh keys being sown like a seed across a number of systems.
To much of a headace worrying about where they are, were they deleted properly... etc.

Eh (-1, Troll)

Anonymous Coward | more than 10 years ago | (#7449072)

I don't want the world having access to my personal files, thanks. Hence I use Windows XP. More secure than anything lunix puts out.

automate this! (1)

danharan (714822) | more than 10 years ago | (#7449080)

Something like this that ran in the background would be great. Anytime you created a file/dir, it would do so in CVS, just as when you re-save a file, it automatically versions it. And for GUI-using weenies like me, a right-click should give me a "View file history" option.

This just in, if you actually try to do backups... (1)

netsavior (627338) | more than 10 years ago | (#7449082)

you will have backups. this as innovative as saying: Make backups of your system.

whoa (0)

Anonymous Coward | more than 10 years ago | (#7449084)

I have CVS repositories in my home dir .. would those get versioned too? *head warps into the fourth dimension*.

"Hey bob! Can we roll back the CVS repository to yesterday's version so I can re-commit a better version of my code?"

Great for Mozilla settings! (4, Interesting)

adamfranco (600246) | more than 10 years ago | (#7449087)

I currently store parts of my .thunderbird and .phoenix directories in CVS and do the commit/update to sync work and home. In general it works pretty well, though not all my settings translate well between OS X (work) and Red Hat (home). For this reason in particular, extensions are not in my CVS and this makes keeping stuff custumized a bit of a pain still.

Umm... (0)

Anonymous Coward | more than 10 years ago | (#7449106)

What is the problem we have all faced? And what is CVS?

Re:Umm... (0)

Anonymous Coward | more than 10 years ago | (#7449143)

CVS [cvs.com] is a drug store chain. I have no idea what problem would be solved by putting your home directory in a drug store. I hate going into drug stores, because everyone, even the employees, is looking at you like "I wonder what medication _he's_ on." even if you're just there to drop off some film. Okay, nobody drops off film any more, but you know what I mean. Buying a greeting card, or something. Plus, sick people are always in drug stores buying medicine. Who wants to be around sick people?

christ on a cubesteak - s/innovative/idiotic (0)

Anonymous Coward | more than 10 years ago | (#7449126)

ok .. this isn't innovative .. this is stupid ..
why not just run backups on your homedir and
export it? .. now you have to deal with the added
headache delays of checkin and checkout

but seeing this post is good .. it simply further
illustrates the incompetence of the slashdot
crew

unison is probably a better solution (4, Interesting)

penguin7of9 (697383) | more than 10 years ago | (#7449127)

My recommendation: use the Unison file synchronizer [upenn.edu] to keep multiple copies of your home directory in sync.

It's not quite the same thing as CVS, but that's probably a good thing. Most importantly, it won't give you versioning. On the other hand, it is symmetric (meaning, none of the copies are distinguished) and it is much less hassle to use. Also, you can define custom merge methods to automate merging of things like mailboxes. Unison is great for keeping a home directory (or portions of it) in sync between different desktops, and between desktops and laptops.

Note that for live backups, rsync is probably still the best choice because you want something unidirectional.

Problems... (1)

Zurion (2775) | more than 10 years ago | (#7449144)

I remember reading this article over a year ago when it came out. CVS is nice, but it doesn't handle directories well. IIRC, he mentions this.

I've recently started using rsync kinds of scripts along with cron. It doesn't keep history, but it makes syncing really easy. If you need history, make daily backups. Additionally, rsync is slightly better at lower bandwidth usage vs full blown CVS.

As for ssh keys (as someone here mentioned) you can have CVS and rsync ignore specific directories you don't want copied.

Large binary files (1)

agm (467017) | more than 10 years ago | (#7449164)

How would this work for my > 1Gb VMWare virtual disks? I don't think it would very well.
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>