Illusory stillness

mumble mumble techblog

Version Controlled Home Directory With Vcsh

I’ve been keeping all my .dotfiles in a Git repository. Since I’m keeping all of them, it’s become a big mess. I also had little success with maintaining diverging branches to work on different computers (e.g. Mac vs. Linux, Emacs23 versus Emacs24) while keeping the common. you-d think that exchanging merge operations between branches would work, but actually you need to be constantly rebasing, and Git doesn’t have any way of keeping track of what was a rebase of what (which is half the problem with Git) and it’s a mess.

I still wonder if maybe darcs would be a better model for VCS home — it would certainly seem better to the always-rebase school of moving branches in sync.

However, vcsh seems to approach at least one aspect of the problem, whcih is to keep different pieces of your mess of config files under differetn headings. So let’s see about starting to use that.

Download: It’s in Homebrew and Debian, so just brew or apt-get as appropriate.

1
git clone https://github.com/RichiH/vcsh.git

First question is does it support tracking things scattered around /etc and so on? It would be nice to have backups for “software configurations” set up on glibal servers too.

To start with, I went to gitolite and added some space for wild config repositories:

1
2
3
4
5
6
7
repo configs/.*
    C     = peter
    RW+D  = peter

repo gobal_configs/.*
    C     = peter
    RW+D  = peter

The tutorial for vcsh is located at /usr/doc/vcsh/README.md.gz. For my home directory I started with the “template” approach, clonign the example MR config to my own server:

1
2
3
4
5
6
7
8
vcsh clone git://github.com/RichiH/vcsh_mr_template.git mr
vcsh enter mr
git remote rm origin
git remote add origin homeGit:configs/mr
git fetch
git push origin master
git branch --set-upstream master origin/master
exit

I’ll start by making a repo for my my SSH public/authorized keys files. I recently decided not to share private keys between computers and regenerated a new private key on each, so this is a good opportunity to keep the authorized keys straight.

So, as far as I can tell, this is how you add a new config repo:

1
2
3
4
5
6
7
8
9
10
11
12
vcsh init ssh
vcsh ssh add .ssh/authorized_keys .ssh/config .ssh/*.pub
vcsh ssh commit
vcsh run ssh git remote add origin homeGit:configs/ssh
vcsh ssh push origin master
cd .config/mr/available.d/
cp mr.vcsh ssh.vcsh
emacs ssh.vcsh #change the URL
cp ssh.vcsh ../config.d
vcsh mr add ssh.vcsh ../config.d/ssh.vcsh
vcsh mr commit
vcsh mr push

Wow, really that involved? Twelve damn commands, leaving off one of which does weird things? Color me dubious about this scheme. And there are eight billion untracked files every time making it impossible to see files you don’t have under control but should — can all repos share a .gitignore or what?

Why doesn’t “vcsh init ssh” do like 90% of this?

This is supposed to be easier than symlinking scripts?

Anyhow, the capstone that pushed me from “dubious” to “kill it with fire” was this:

1
2
3
4
5
$ vcsh mr commit -m "Added ssh to config dir"
error: pathspec 'ssh' did not match any file(s) known to git.
error: pathspec 'to' did not match any file(s) known to git.
error: pathspec 'config' did not match any file(s) known to git.
error: pathspec 'dir' did not match any file(s) known to git.

COMMAND LINE ARGUMENTS. THEY CAN HAVE SPACES IN THEM. NO, REALLY, THEY CAN. JUST BECAUSE YOU WRITE YOUR STUPID THING IN SHELL IS NO EXCUSE FOR THIS SHIT.

Really, tearing apart arguments that were quoted perfectly well is fucking unacceptable for any kind of UNIX utility written after the ‘80s.

Bye now.

1
2
3
4
5
6
ssh homeGit D unlock configs/mr
ssh homeGit D unlock configs/ssh
ssh homeGit D rm configs/mr
ssh homeGit D rm configs/ssh
sudo apt-get remove mr vcsh
rm -rf .config/mr .config/vcsh .mrconfig