summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-09-15 19:44:37 -0700
committerPaul Phillips <paulp@improving.org>2012-09-20 09:57:00 -0700
commite4e8578c5cf433648fa5428bfb2ad2ce8d347439 (patch)
tree2a5a1ab8b15c55a72f072846e44a7cefc145a3a6
parent3136e53e0ce4d73e1d2b3e8d043fff7892b2f439 (diff)
downloadscala-e4e8578c5cf433648fa5428bfb2ad2ce8d347439.tar.gz
scala-e4e8578c5cf433648fa5428bfb2ad2ce8d347439.tar.bz2
scala-e4e8578c5cf433648fa5428bfb2ad2ce8d347439.zip
New .gitattributes file.
This should assist in keeping line endings straight. It is designed to enforce LF endings everywhere except for files specifically for windows.
-rw-r--r--.gitattributes26
-rw-r--r--gitconfig.SAMPLE8
-rwxr-xr-xtools/class-dump6
-rwxr-xr-xtools/jar-dump4
4 files changed, 44 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000..958b0b9f28
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,26 @@
+# These files are text and should be normalized (convert crlf => lf)
+*.c text
+*.check text
+*.css text
+*.html text
+*.java text
+*.js text
+*.sbt text
+*.scala text
+*.sh text
+*.txt text
+*.xml text
+
+# Windows-specific files get windows endings
+*.bat eol=crlf
+*.cmd eol=crlf
+*-windows.tmpl eol=crlf
+
+# Some binary file types for completeness
+# (binary is a macro for -text -diff)
+*.dll binary
+*.gif binary
+*.jpg binary
+*.png binary
+*.class -text diff=class
+*.jar -text diff=jar
diff --git a/gitconfig.SAMPLE b/gitconfig.SAMPLE
new file mode 100644
index 0000000000..d90c3bfb02
--- /dev/null
+++ b/gitconfig.SAMPLE
@@ -0,0 +1,8 @@
+# With something like this in .git/config or ~/.gitconfig
+# you can diff class files and jar files.
+[diff "class"]
+ textconv = tools/class-dump
+ cachetextconv = true
+[diff "jar"]
+ textconv = tools/jar-dump
+ cachetextconv = true
diff --git a/tools/class-dump b/tools/class-dump
new file mode 100755
index 0000000000..06a7e5acbc
--- /dev/null
+++ b/tools/class-dump
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+
+JAVAP_OPTS="-private"
+
+[[ -n "$1" ]] && ( cd "$(dirname "$1")" && javap $JAVAP_OPTS "$(basename "${1%%.class}")" )
diff --git a/tools/jar-dump b/tools/jar-dump
new file mode 100755
index 0000000000..166441b330
--- /dev/null
+++ b/tools/jar-dump
@@ -0,0 +1,4 @@
+#!/bin/sh
+#
+
+jar tf "$1" | sort