Skip to content

Commit e4e8578

Browse files
committed
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.
1 parent 3136e53 commit e4e8578

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

.gitattributes

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# These files are text and should be normalized (convert crlf => lf)
2+
*.c text
3+
*.check text
4+
*.css text
5+
*.html text
6+
*.java text
7+
*.js text
8+
*.sbt text
9+
*.scala text
10+
*.sh text
11+
*.txt text
12+
*.xml text
13+
14+
# Windows-specific files get windows endings
15+
*.bat eol=crlf
16+
*.cmd eol=crlf
17+
*-windows.tmpl eol=crlf
18+
19+
# Some binary file types for completeness
20+
# (binary is a macro for -text -diff)
21+
*.dll binary
22+
*.gif binary
23+
*.jpg binary
24+
*.png binary
25+
*.class -text diff=class
26+
*.jar -text diff=jar

gitconfig.SAMPLE

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# With something like this in .git/config or ~/.gitconfig
2+
# you can diff class files and jar files.
3+
[diff "class"]
4+
textconv = tools/class-dump
5+
cachetextconv = true
6+
[diff "jar"]
7+
textconv = tools/jar-dump
8+
cachetextconv = true

tools/class-dump

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
#
3+
4+
JAVAP_OPTS="-private"
5+
6+
[[ -n "$1" ]] && ( cd "$(dirname "$1")" && javap $JAVAP_OPTS "$(basename "${1%%.class}")" )

tools/jar-dump

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
#
3+
4+
jar tf "$1" | sort

0 commit comments

Comments
 (0)