The problem: you have eight versions of your .emacs file, all slightly different. Arch to the rescue! We will examine how to add the important contents of your home directory into an arch repository and track changes.

First, create the project in a secure place:

~ $ tla my-default-archive safe@example.com
~ $ tla archive-setup homedir--base--0
* creating category safe@example.com/homedir
* creating branch safe@example.com/homedir--base
* creating version safe@example.com/homedir--base--0

then initialize the tree:

~ $ tla init-tree homedir--base--0

If your home directory is as messy as mine, you should probably use the explicit tagging method

~ $ tla id-tagging-method explicit
method set: explicit

At this point, you should add some files that you want to keep tabs on.

~ $ tla add .emacs
~ $ tla add .gnus.el
~ $ tla add lisp/
~ $ tla add lisp/my-elisp-hacks.el

You should also make sure that you exclude large directories from being traversed by tla. You can find the largest directories with the command

~ $ du --max-depth=1 | sort -n
<lots of output>

and then make a ~/.arch-inventory file that has an "exclude" line for each of the large directories. You will also need to add "source \..*" in order to get past the initial tree-lint.

Now commit!

~ $ tla import

However, you now have a little problem. If you now want to run tla init-tree in any subdirectory of your home directory, you'll just get an error message:

~/some/dir $ tla init-tree foo--bar--0
init-tree: dir is already in project tree (.)

You have to run tla init-tree with the --nested parameter now for it to succeed.


You will run into a problem with the above configuration when working with multiple machines on the same configuration. The message would be :

~$ tla changes
* looking for my-mail@hello.world--libre/homedir--base--0--patch-6 to compare with
unable to create directory "/home/,,new-pristine.1097057276.19013.1" (Permission denied)
PANIC: I/O error

tla wrongly assumes in this case that is has write permission on .. You can use a greedy sparse revision library to accomodate this problem. Something like:

mkdir $HOME/revlib
tla my-revision-library $HOME/revlib
tla library-config --greedy --sparse $HOME/revlib

This should set the library to automatically grab new versions when you want to update. Note that this is a hard-linked library, so only files that change get added.

If you are truly concerned about disk space, you can use the script "shrink-library" from tlacontrib. Without an argument it will remove any categories from your revision library that are older than 2 weeks. I like to do shrink-library 0 which removes all but the latest version. -JohnMeinel

Thanks to AaronBentley and JohnMeinel ! This works like a charm and is less kludgy. I took the liberty to edit your comments. -JeanBaptisteNote

Imho this isn't working with arch 1.3 anymore ? -Anon

Controlling Home Directories With Arch (last edited 2007-04-10 17:47:41 by AndyTai)