LUCENE-3775: A shell script to generate .gitignore from svn:ignore properties.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1243467 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dawid Weiss 2012-02-13 10:27:44 +00:00
parent a376ac4556
commit 76c285b1d3
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#!/bin/bash
rm -f .gitignore-new
for dir in `find . -path '*.svn*' -prune -o -type d -print | grep -v -e "/build"`; do
ruby -e 'printf("SVN dir: %-70s", ARGV[0])' "$dir" >&2
svn info $dir > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
svn propget "svn:ignore" $dir | ruby -e 'while $stdin.gets; (puts ARGV[0].gsub(/^\./, "") + "/" + $_) unless $_.strip.empty?; end' "$dir" > .temp
if [ -s .temp ]; then
echo " OK" >&2
echo -e "\n\n# $dir" >> .gitignore-new
cat .temp >> .gitignore-new
else
echo " --" >&2
fi
rm .temp
else
echo " NOT svn controlled." >&2
fi
done