Skip to content

Instantly share code, notes, and snippets.

@tmr111116
Forked from anonymous/attributes
Created February 8, 2013 09:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmr111116/4737827 to your computer and use it in GitHub Desktop.
Save tmr111116/4737827 to your computer and use it in GitHub Desktop.
# git の差分表示に使うには .git/info/attributes にこの内容と、
*.mwb diff=MySQLWorkbench
# git config でこれが必要。
# git config diff.MySQLWorkbench.textconv /path/to/mwb.sh
#! /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;'
@tmr111116
Copy link
Author

anonymous になってしまった…。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment