mirror of https://github.com/apache/lucene.git
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:
parent
a376ac4556
commit
76c285b1d3
|
@ -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
|
Loading…
Reference in New Issue