Slashdot Mirror


Home Directory In CVS

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."

20 of 414 comments (clear)

  1. Here's a piece of advice by Rosco+P.+Coltrane · · Score: 5, Funny

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

    --
    "A door is what a dog is perpetually on the wrong side of" - Ogden Nash
  2. CVS takes files? by cuppm · · Score: 5, Funny

    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...

    --
    I have no sig, the eyebrows seal the deal. That's right. Eyebrows.
  3. Why just home? by AuMatar · · Score: 5, Interesting

    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.

    --
    I still have more fans than freaks. WTF is wrong with you people?
    1. Re:Why just home? by Jellybob · · Score: 5, Informative

      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.

    2. Re:Why just home? by pclminion · · Score: 5, Insightful
      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.

  4. Re:I keep my life in a CVS repository by Rosco+P.+Coltrane · · Score: 5, Funny

    No. But you can do this right now:

    cvs commit suicide

    --
    "A door is what a dog is perpetually on the wrong side of" - Ogden Nash
  5. Sourceforge by Smitty825 · · Score: 5, Funny

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

    --

    Doh!
    1. Re:Sourceforge by AvantLegion · · Score: 5, Funny
      I patched your political science essay.

      I fixed all the anti-Bush bugs.

  6. How does he handle renaming and erasing in CVS? by Anonymous Coward · · Score: 5, Interesting

    'cause CVS loses the history in these operations.

    1. Re:How does he handle renaming and erasing in CVS? by neonleonb · · Score: 5, Interesting

      Alias mv to execute some shell script:
      mv $1 $2
      cvs remove $1
      cvs add $2
      cvs commit -m "move $1 $2" $1 $2
      You might want to add some script to deal with the case where $2 is a directory, but that shouldn't be too hard.

      That way, information about the move and the previous file status is kept.

  7. Pun Intended... by Vaulter · · Score: 5, Funny


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

    --
    I don't have a sig...Do you??
  8. Re:Not Innovative by TheZax · · Score: 5, Funny

    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)

    --

    JWall: GUI client for IPTables
  9. Re:auto-backups the plan9 way by Rosco+P.+Coltrane · · Score: 5, Funny

    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 ... ... ..."

    --
    "A door is what a dog is perpetually on the wrong side of" - Ogden Nash
  10. Re:Or just RCS by pHDNgell · · Score: 5, Informative

    I have a script that does all of this for me:

    http://bleu.west.spy.net/~dustin/soft/filemonitor

    You point it at a dir and run it from cron nightly. It also gives you a handy nightly mail telling you what changed. Excellent for those late night changes to systems where you don't remember what you did...or if someone else made some late night changes that you'd like to undo.

    --
    -- The world is watching America, and America is watching TV.
  11. kinda old article; update by joey · · Score: 5, Informative

    I'm not sure why something that I wrote in 2001 and that appeared in print media in 2002 is news.
    This is the second time I've been slashdotted for something over 1 year old this year. Previously it was the pkg-comp page, which I wrote circa 1998.
    Kinda makes you wonder.

    Anyway..

    I suppose I should mention that these days I keep most of my home directory in subversion. I have not gotten around to writing a successor to this article yet, but it works even better than cvs, and that's probably the most common question people ask me about this article these days.

    --
    see shy jo
  12. Re:CVS, eh? by vslashg · · Score: 5, Informative

    I agree that Perforce is awesome. But here's something you may not know -- Perforce is completely free for the kind of thing this article is talking about doing.

    Specifically, Perforce is available for download here. Without a license, it only supports two users and two clientspecs... not enough to manage a project shared among developers, but wonderful for managing your code in home projects. More good news: Perforce is free-as-in-beer for use in developing open source projects.

    (This isn't meant as a holy war... I know that many of you might think that source control package Foo is better than Perforce. You may be right. I'm just pointing out some Perforce licensing facts for those who like Perforce.)

  13. The comments say he uses subversion now by Polo · · Score: 5, Informative
    Did you see his followup reply at the bottom??
    Re: CVS homedir (Score: 0)
    by Anonymous on Tuesday, November 11, 2003

    I suppose I should mention that these days I keep most of my home directory in subversion. I have not gotten around to writing a successor to this article yet, but it works even better than cvs, and that's probably the most common question people ask me about this article these days.

    -- Joey Hess
  14. Been doing that a *long* time by Anonymous Coward · · Score: 5, Interesting

    I've been keeping my home directory in CVS since 1996. Prior to that, I kept it in RCS, since around 1985, and briefly in SCCS.

    I haven't yet decided to go to Subversion, in part because I have a patched version of CVS that allows me to check into multiple CVS repositories - i.e. I can check in when on my laptop on an airplane, disconnected from the net, and can later check in to my main repository when I get connected. (Yeah, yeah, BitKeeper is a way to do that.)

    As Joey's article discusses, there are minor issues with CVS'ing your home directory: use of modules, etc. I divide it into stuff that is owned by the company that I am currently working for, and stuff that I own.

    When I get an account on a new machine, one of the first things that I do is create a new branch (or, a new version on some existing branch) to hold the dot files and other files
    that were pre-installed in my home directory. Having saved them, I then blithely overwrite them with my standard home directory, and maybe do a quick check to see if there are any special features worth propagating to my standard home directory.

    Oh, yeah: a bit of footwork to checkout
    onto your home directory:

    cd ~
    mv * .* /tmp/glew/old-home-directory // actually, usually saved already
    cvs -d MYSERVER co glew-home
    mv glew-home/{*,.*} .
    rmdir glew-home

    I often find myself pasting together
    modules from different repositories.
    Sometimes I *want* a "cvs update"
    in the root, e.g. in ~, to traverse
    repository boundaries - no problem.
    But sometimes I don't - e.g. I frequently
    work in ~/hack, and check out stuff into there.

    To do this, I have fallen into the habit
    of creating a CVSBARRIER directory that is
    not checked in, that prevents cvs update
    from traversing.

    Also, I find it useful to have a place
    to put overall comments for a repository.
    Typically, this is ~/README or ~/CVS-status.
    The overall comments - such as "the tag
    named FOO is my home directory at the time
    I moved to university BAR and merged in
    changes from my laptop BAZZ that had diverged"
    get suck in the CVS log, via
    cvs ci -f CVS-status.

    Oner thing: when yiou have as much history as this, you notice when programs change their interface. E.g. nmh doesn't run my ~/.mhrc from 1994 :-(

    --- Andy "Krazy" Glew
    (I'm too lazy to create a slashdot account)

  15. Old news by whereiswaldo · · Score: 5, Informative


    This was featured in a Linux Journal article from September 2002:

    http://linuxjournal.com/article.php?sid=5976

    Same guy, too.

  16. Re:My favorite directory to put in CVS by inferno0069 · · Score: 5, Informative

    Where do you think Gentoo got this from?

    Debian.