You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2012/02/13 11:27:45 UTC
svn commit: r1243467 - /lucene/dev/trunk/dev-tools/scripts/gitignore-gen.sh
Author: dweiss
Date: Mon Feb 13 10:27:44 2012
New Revision: 1243467
URL: http://svn.apache.org/viewvc?rev=1243467&view=rev
Log:
LUCENE-3775: A shell script to generate .gitignore from svn:ignore properties.
Added:
lucene/dev/trunk/dev-tools/scripts/gitignore-gen.sh (with props)
Added: lucene/dev/trunk/dev-tools/scripts/gitignore-gen.sh
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/dev-tools/scripts/gitignore-gen.sh?rev=1243467&view=auto
==============================================================================
--- lucene/dev/trunk/dev-tools/scripts/gitignore-gen.sh (added)
+++ lucene/dev/trunk/dev-tools/scripts/gitignore-gen.sh Mon Feb 13 10:27:44 2012
@@ -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
\ No newline at end of file