Last active
September 26, 2020 15:17
-
-
Save Radon8472/d9ec5e00f240520604d3b3c99f454053 to your computer and use it in GitHub Desktop.
git_binary_diff
This file contains hidden or 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
*.zip diff=zip | |
*.tgz diff=tgz | |
*.tar.gz diff=tgz | |
*.sql.gz diff=gz | |
*.db diff=sqlite3 | |
*.sqlite diff=sqlite3 | |
*.sqlite3 diff=sqlite3 |
This file contains hidden or 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
# | |
# @see: https://gist.github.com/dbapl/e841d321bbb3ee77a3aa | |
# | |
# tested in version 2.24.1.windows.2 | |
# | |
# you can add this entries either to your | |
# - global gitconfig (/etc/gitconfig) or to, | |
# - users gitconfig (~/.gitconfig) or to, | |
# - repositories gitconfig ($GIT_DIR/config) | |
# | |
[diff "zip"] | |
textconv = unzip -c -a | |
[diff "tgz"] | |
binary = true | |
textconv = tar -xvzO -f | |
[diff "gz"] | |
binary = true | |
textconv = gunzip -c | |
# Diff for sqlite database using the sqlite3 commandline tool | |
[diff "sqlite3"] | |
binary = true | |
# textconv = "f() { sqlite3 $1 --readonly .dump; }; f" # Version 1 | |
# Version 2 | |
textconv = "f() {\ | |
sqlite3 $1 --readonly '.mode line' 'SELECT sqlite_version(),* FROM \ | |
pragma_data_version, pragma_schema_version, pragma_user_version, pragma_application_id, \ | |
pragma_encoding, pragma_journal_mode\ | |
';\ | |
echo '---------------';\ | |
sqlite3 $1 --readonly .dump;\ | |
}; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment