-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sam bacha
authored
Feb 17, 2021
1 parent
dcb7127
commit 7fff80f
Showing
3 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
BINARY_FILES="" | ||
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACM) | ||
LFS_FILES=$(echo $CHANGED_FILES | xargs git check-attr filter | grep 'filter: lfs$' | sed -e 's/: filter: lfs//') | ||
|
||
for FILE in $LFS_FILES; do | ||
SOFT_SHA=$(git hash-object -w $FILE) | ||
RAW_SHA=$(git hash-object -w --no-filters $FILE) | ||
|
||
if [ $SOFT_SHA == $RAW_SHA ]; then | ||
BINARY_FILES="$FILE\n$BINARY_FILES" | ||
fi | ||
done | ||
|
||
if [[ -n "$BINARY_FILES" ]]; then | ||
echo "Attention!" | ||
echo "----------" | ||
echo "You tried to commit binary files:" | ||
echo -e "\x1B[31m$BINARY_FILES\x1B[0m" | ||
echo "Revert your changes and commit those files with git-lfs!" | ||
echo "----------" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
*.sql | ||
*.zip | ||
*.tar | ||
*.tar.gz | ||
*.tar.lz4 | ||
*.tgz | ||
*.7z | ||
|
||
audit-trail/ | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
### MicrosoftOffice ### | ||
*.tmp | ||
~$*.doc* | ||
Backup of *.doc* | ||
~$*.xls* | ||
*.xlk | ||
~$*.ppt* | ||
*.~vsd* |