Skip to content

Commit 7fff80f

Browse files
author
sam bacha
authored
chore(repo): update git configs
1 parent dcb7127 commit 7fff80f

File tree

3 files changed

+51
-6
lines changed

3 files changed

+51
-6
lines changed

.gitattributes

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
# gitattributes
22
# custom gitattributes
3-
*.pdf diff=exif
43
*.png diff=exif
5-
64
*.dtd text
75
*.html text diff=html
8-
*.java text diff=java
96
*.md text
10-
*.nuspec text
11-
*.rng text
12-
*.rngc text
137
*.sh eol=lf
148
*.xml text
159
*.xsd text
@@ -21,3 +15,11 @@ LICENSE* text
2115

2216
*.docx diff=word
2317
*.pdf filter=lfs diff=lfs merge=lfs -text
18+
19+
test/ export-ignore
20+
/.github export-ignore
21+
/.editorconfig export-ignore
22+
/.gitattributes export-ignore
23+
/.gitignore export-ignore
24+
25+
/CHANGELOG.md merge=union

.githooks/pre-commit/git-lfs.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
BINARY_FILES=""
6+
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACM)
7+
LFS_FILES=$(echo $CHANGED_FILES | xargs git check-attr filter | grep 'filter: lfs$' | sed -e 's/: filter: lfs//')
8+
9+
for FILE in $LFS_FILES; do
10+
SOFT_SHA=$(git hash-object -w $FILE)
11+
RAW_SHA=$(git hash-object -w --no-filters $FILE)
12+
13+
if [ $SOFT_SHA == $RAW_SHA ]; then
14+
BINARY_FILES="$FILE\n$BINARY_FILES"
15+
fi
16+
done
17+
18+
if [[ -n "$BINARY_FILES" ]]; then
19+
echo "Attention!"
20+
echo "----------"
21+
echo "You tried to commit binary files:"
22+
echo -e "\x1B[31m$BINARY_FILES\x1B[0m"
23+
echo "Revert your changes and commit those files with git-lfs!"
24+
echo "----------"
25+
exit 1
26+
fi

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
*.sql
22
*.zip
33
*.tar
4+
*.tar.gz
5+
*.tar.lz4
6+
*.tgz
7+
*.7z
8+
49
audit-trail/
10+
.DS_Store
11+
.AppleDouble
12+
.LSOverride
13+
14+
### MicrosoftOffice ###
15+
*.tmp
16+
~$*.doc*
17+
Backup of *.doc*
18+
~$*.xls*
19+
*.xlk
20+
~$*.ppt*
21+
*.~vsd*

0 commit comments

Comments
 (0)