Subversion feature: sparse checkouts
With trunk now heading for KDE 4.2 and Subversion 1.5.0 released short time ago I think it's worth of bringing one new feature to the public I find extremely useful: sparse checkouts.
First thing is to explain what exactly a sparse checkout is. Basically that means that you do an incomplete checkout of a given directory in the repository. This is a superset of what was possible using svn -N but giving you a much finer control about what is checked out. Still not happy with it? Neither would I, so let's see an example:
svn checkout --depth=empty svn+ssh://youraccount@svn.kde.org/home/kde/branches/KDE/4.1/ cd 4.1 svn update --depth=infinity kdelibs kdeutils
Now you have checked out kdelibs and kdeutils from the 4.1 branch. What makes this sparse checkout extremely useful is that subversion still knows that they belong into the same directory. If you do svn update 4.1 it will update both kdelibs and kdeutils, but will neither checkout kdebase nor any other package from that branch. If you would like to commit something that touches both directories you can do it in a single commit because they still belong to the same directory.
Former ways of getting such a directory layout usually included creating some directory hierarchy by hand and checking out only some directories at the right places or checking out everything and deleting stuff afterwards (or leaving tons of unused files at your disk). More examples on sparse directories are given in the Subversion book. Please note: you currently can't redo a checkout, e.g. doing svn update --depth=empty on a directory will not clean it up. If you really need this there is already a workaround documented.