Email: Takayama Fumihiko <tekezo@pqrs.org>
> Top > UNIX > Software

[FsFilter] FileSystem Filter for Subversion

FsFilter

What's

This is a FileSystem-Filter for Linux and FreeBSD.

When using revision control system like Subversion or CVS, .svn or CVS directory will be created automatically.
These directory are important for revision control system, but not for human readings.

Especially, these .svn files will be noisy when using commands like "find", "grep".

Then, FsFilter will hide .svn directory for user, and provide comfortable working space of Subversion.

Principle & Examples

How it works

FsFilter hooks readdir(3) or readdir64(3) by LD_PRELOAD, then skip .svn directory to hide it.

Therefore, You can hide .svn directory for almost all commands. (ex: find, grep, diff, ls, cp, mv, ...)

Moreover, svn command doesn't use readdir(3) to access .svn directory, so svn command works fine with FsFilter.

Example

Without FsFilter With FsFilter
% find utils
utils
utils/.svn
utils/.svn/tmp
utils/.svn/tmp/props
utils/.svn/tmp/text-base
utils/.svn/tmp/prop-base
utils/.svn/tmp/wcprops
utils/.svn/props
utils/.svn/props/make-setenv.sh.svn-work
utils/.svn/empty-file
utils/.svn/entries
utils/.svn/format
utils/.svn/text-base
utils/.svn/text-base/Makefile.svn-base
utils/.svn/text-base/make-setenv.sh.svn-base
utils/.svn/README.txt
utils/.svn/prop-base
utils/.svn/prop-base/make-setenv.sh.svn-base
utils/.svn/wcprops
utils/Makefile
utils/make-setenv.sh
clean up file listing.

arrow.png
% find utils
utils
utils/Makefile
utils/make-setenv.sh
% svn status utils
?      utils/touchtest
svn works without trouble.

arrow.png
% svn status utils
?      utils/touchtest

Note

When deleting the directory including .svn, there is a "Directory not empty" error though the directory is seemingly empty.

% mkdir -p test/.svn
% ls -a test
.  ..
% rm -r test/
rm: cannot remove directory `test/': Directory not empty

Therefore, unset LD_PRELOAD when exec "rm -r".

% LD_PRELOAD= rm -r test


Comments for This Page.
Date: 2006-06-19 00:00 (JST)