ユーザ用ツール

サイト用ツール


it技術:winmerge

文書の過去の版を表示しています。


WinMerge

WinMerge は、オープンソースの Windows 用比較・マージツールです。WinMerge は、フォルダとファイル両方が比較でき、理解しやすく扱いやすいテキスト形式で差異をビジュアルに表現します。

Tips

空白とタブを無視する

メニューの編集の設定にて、下図の赤枠の設定にする。
空白を「すべて無視する」にすると、タブとスペースが同一視される。

バイナリファイルを比較対象から除外

Javaなどバイナリファイル(classやjar)などを比較対象から除外したい場合、フィルターを作成する。 WinMerge のファイルフィルタ

f: はファイルのパターンを正規表現で指定する。
d: はディレクトリのパターンを正規表現で指定する。

def: のところで選択するinclude と exclude の意味が、普通の感覚と逆になっている。
def: include と指定すると、設定ファイルで指定されたパターンのファイルが比較対象とならない。
def: exclude と指定すると、設定ファイルで指定されたパターンのファイルだけが比較対象となる。

Java.flt
## This is a directory/file filter for WinMerge
## This filter suppresses various binaries found in ADAMulti source trees
name: Java
desc: Suppresses various binaries found in Java source trees
 
## This is an inclusive (loose) filter
## (it lets through everything not specified)
def: include
 
## Filters for filenames begin with f:
## Filters for directories begin with d:
## (Inline comments begin with " ##" and extend to the end of the line)
 
f: \.class$   ## class file
f: \.jar$     ## jar file
 
d: \\classes$ ## class files
d: \\log$     ## log files

ログファイルを比較対象から除外

log.flt
## This is a directory/file filter template for WinMerge
name: Log
desc: Longer description
 
## Select if filter is inclusive or exclusive
## Inclusive (loose) filter lets through all items not matching rules
## Exclusive filter lets through only items that match to rule
## include or exclude
def: include
 
## Filters for filenames begin with f:
## Filters for directories begin with d:
## (Inline comments begin with " ##" and extend to the end of the line)
 
f: \.log$ ## Filter for filename
 
d: \\log$ ## Filter for directory

行フィルタで比較対象から除外

ツール→フィルタ→行フィルタに正規表現を追加して、行フィルタを有効にすると対象行が違っていても比較対象から除外してくれる。

WinMergeでバージョン管理されたファイルのCVSやSVNのキーワードを除外して比較する

先頭日時を除外して比較する

WinMergeの比較処理前に正規表現フィルタのプラグインで差分を無視したいテキストを定義する

PrediffLineFilterフィルタの設定にて、正規表現を使用して先頭日時を除外して比較する。
似た機能に行フィルタがあるが、それだと行全体が除外されてしまう。

設定入力
大文字小文字の違い
正規表現を使用
検索文字列^\d{2}/\d{2}/\d{4} \d{2}:\d{2}:\d{2}.\d{3}
置換後の文字列

メイン画面の[プラグイン]→[比較前処理プラグイン]→[PrediffLineFilter.sct]にチェックが入った状態にします。

it技術/winmerge.1610072473.txt.gz · 最終更新: 2021/01/08 11:21 by yajuadmin