Created
February 8, 2013 09:55
-
-
Save anonymous/4737817 to your computer and use it in GitHub Desktop.
MySQL WorkBench の .mwb ファイルの差分を見やすくするシェルスクリプト。
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
# git の差分表示に使うには .git/info/attributes にこの内容と、 | |
*.mwb diff=MySQLWorkbench | |
# git config でこれが必要。 | |
# git config diff.MySQLWorkbench.textconv /path/to/mwb.sh |
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
#! /bin/sh | |
# MySQL WorkBench の .mwb ファイルの差分を見やすくするシェルスクリプト。 | |
# - 無駄によく変わる _ptr_ の値を無視 | |
# - &#xXX; の形式なっている日本語のコメントをそのまま読めるように | |
/usr/bin/funzip $1 | perl -pe 'binmode STDOUT, ":utf8"; s/_ptr_="0x\w+"/_ptr_="!!!removed!!!"/g; s/\&\#x(\w+)\;/chr(hex($1))/eg;' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment