Skip to content

Commit

Permalink
New .gitattributes file.
Browse files Browse the repository at this point in the history
This should assist in keeping line endings straight.
It is designed to enforce LF endings everywhere except
for files specifically for windows.
  • Loading branch information
paulp committed Sep 20, 2012
1 parent 3136e53 commit e4e8578
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions gitconfig.SAMPLE
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions tools/class-dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
#

JAVAP_OPTS="-private"

[[ -n "$1" ]] && ( cd "$(dirname "$1")" && javap $JAVAP_OPTS "$(basename "${1%%.class}")" )
4 changes: 4 additions & 0 deletions tools/jar-dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
#

jar tf "$1" | sort

0 comments on commit e4e8578

Please sign in to comment.