Last year I tried using RCS to do a version control of a server’s /etc direcotry. That didn’t work out too well, because the extra copies of every archive turned out to cause errors for some applications. Also it was very cumbersome to use, because you have to manually add every archive and use ‘co’ every time before editing.
So I’d much rather use something like Subversion or darcs. Especially darcs because it doesn’t create a separate control directory for every directory unter version control (CVS creates a directory called “CVS” everywhere, Subversion one called “.svn” and darcs just creates “_darcs” in the top level directory.
Today for the new server at the Diego Thomson I did some experiments with Subversion. This went from “cool” to “oh now” to “cool” to “oh now” now. But let me extend on this story. First I thought, well this would be very cool. Also because most applications will ignore the hidden folder (".svn") while having problems with visible folders (“CVS”) this should work. And: subversion stores symlinks without problems. Then I realized that it doesn’t store file permissions and was demoralized by this. A Yahoo! search then turned up the Subversion FAQ, specifically the entry How can I do an in-place ‘import’.
# svn mkdir file:///root/svn-repository/etc -m "Make a directory in the repository to correspond to /etc"
# cd /etc
# svn checkout file:///root/svn-repository/etc .
# svn add apache samba alsa X11
# svn commit -m "Initial version of my config files"
I modified this commands, executed them and really: my file permissions were preserved. The I tested some changes at the sudoers file. Added a line but realized I didn't like it. So an svn revert later my sudo calls suddenly reported "sudo: /etc/sudoers is mode 0644, should be 0440" and didn't work. Ouch. So when doing revert the file permissions will not be preserved after all.
Has anyone a solution or does know a system which will preserve my permissions (darcs won't either and doesn't even know about symlinks, yet). I prefer systems that do not clobber my file tree and only create one single directory.
Update: Later I tried out Bazaar as mentioned here by Maxi. Bazaar-NG doesn't know anything about file permissions either. I tried it first and my discovery is also confirmed in this mailinglist thread. (Though it does mention that GNU Arch knows about permissions, so I'm off to testing that now.)