]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - svn-eol-style-from-gitattributes.sh
add a script to automate svn:eol-style processing
[xonotic/darkplaces.git] / svn-eol-style-from-gitattributes.sh
diff --git a/svn-eol-style-from-gitattributes.sh b/svn-eol-style-from-gitattributes.sh
new file mode 100644 (file)
index 0000000..7c1085c
--- /dev/null
@@ -0,0 +1,22 @@
+for F in *; do
+       exec 3<.gitattributes
+       while read <&3 -r L S; do
+               if [ -z "${F##$L}" ]; then
+                       s=$S
+               fi
+       done
+       case "$s" in
+               '-diff -crlf')
+                       svn propdel svn:eol-style "$F"
+                       ;;
+               '-crlf')
+                       svn propdel svn:eol-style "$F"
+                       ;;
+               'crlf=input')
+                       svn propset svn:eol-style native "$F"
+                       ;;
+               *)
+                       echo "UNKNOWN: $s"
+                       ;;
+       esac
+done