Unexpand Id keywords
While cleaning up my mails I found this tiny script that Sylvain once posted. I know I will need it if I just delete it so why not blog about it.
#!/bin/sh
# Unexpands all "$Id ....$" keywords from files having a certain prefix (i.e. replaces
# them by $Id$) The good thing with Subversion is that it doesn't consider as being
# modified a file where the keyword has changed
find . \( -name '*.java' -or -name '*.xml' \) -print | while read file
do
echo $file
sed -e 's/\$Id:.*\$/$Id$/' $file > ${file}.rmkw-tmp
mv ${file}.rmkw-tmp $file
done