One can add this property automatically when creating new files with the help of SVN's auto props feature. But from time to time someone, e.g. a new developer not knowing about auto props, checks in files without having the "svn:keywords" property set.
So I wondered how to identify such files in the repository. SVN doesn't provide a command answering that question, you only can retrieve all files having a certain property set.
But no problem, some shell magic to the rescue:
comm -23 <(sort <(sed 's/\.\///g' <(find . -name "*.java"))) <(sort <(sed 's/ - Id//g' <(svn propget svn:keywords * -R)))
So what's happening here? The basic idea is to list those files with the svn:keywords property set (
svn propget) and compare this to a list with all files (
The outputs of both commands are brought into the same format using
sed, sorted and then passed as parameters to the
commcommand, which compares two input files to each other. The
-23parameter causes only those lines to be put out which are only contained in file1 but not in file2, which are exactly the names of those files lacking the "svn:keywords" property.
I tested the command successfully on Mac OS X, but I think it should work pretty much the same way on other Unix systems, too.