svndiffにBeyondCompareを使用する
Use Beyond Compare Svn Diff
問題の説明
最近、非常に便利なものが見つかりましたdiff
with merge
Software 比較を超えて 。したがって、このソフトウェアを毎日のファイル比較とバージョン管理に使用できるかどうかを検討してください。
問題が解決しました
最初のダウンロードBeyond Compare
最新バージョン。インストール後にコマンドラインツールをインストールし、Install Commond Line Tools
を実行します。したがって、bcomp
with bcompare
2つのコマンドを使用してファイルを比較できます。
bcomp
アプリウィンドウを開いて、すぐに戻るのではなく保持します。bcompare
ウィンドウを開いた直後に戻ります。したがって、ここではbcomp
コマンドを使用します。
in ~
新しいスクリプトを作成する.BCDiff
スクリプトの内容は次のとおりです。
#!/bin/bash DIFF='bcomp' LEFT=${6} RIGHT=${7} $DIFF $LEFT $RIGHT Exit 0 # This returns 0 to prevent the return value of the above diff command from being received by svn diff.
後で変更する~/.subversion/config
ファイル内diff-cmd
1つの動作diff-cmd = ~/.BCDiff
問題ありません。
また、実行権限を追加するために作成するスクリプトにも注意してください。
chmod +x ./.BCDiff
関連する原則
Svndiffメカニズム
svn diff
独自の比較プログラムを使用するメカニズムを提供します。で使用diff program
ロケーションプログラムは一連の形状を受け入れます
-u -L tag1 (revision 171313) -L tag2 (working copy) file1 file2
パラメーター。 6番目と7番目のパラメーターは、比較される2つのファイルの絶対パスです。したがって、スクリプトを使用して、これら2つのパスを目的のdiffプログラムに渡すことができます。これは、beyond compare
だけでなく、vimdiff
などの他の比較方法にも適用および使用されます。
比較メカニズムを超えて
Beyond Compare
コマンドラインフォームbcomp
使用方法は次のとおりです。
Beyond Compare Copyright (c) 1996-2016 Scooter Software. All rights reserved. Syntax: bcomp [options] [ [ [ []]]] bcomp @ [options] For more information on the options below check the help. Options: -nobackups Disables backup file creation -ro Disables editing on all sides -ro# Disables editing on specified side -title#= Shows description instead of filename in path edit -vcs#= Uses version control path instead of real filename for file format matching, displayed in path edits if -title isn't defined File View Options: -fv[=] Opens new file view -qc[=] Silently compares two files -savetarget= Saves to specified filename instead of original file Folder View Options: -sync Opens new Folder Sync view Merge Options: -automerge Automatically merges files without interaction -favorleft, favorright Suppresses output coloring for favored side -force Adds conflict markers to output if -automerge fails -iu Turns on 'Ignore Unimportant Differences' -mergeoutput= Specifies an output file -reviewconflicts Opens interactive window if -automerge fails Script Options: -closescript Closes script window when finished -silent Runs script without showing window A # character in a switch should be replaced by a side number: 1=Left, 2=Right, 3=Center, 4=Output Comparison result return values: 0 Success 1 Binary same 2 Rules-based same 11 Binary differences 12 Similar 13 Rules-based differences 14 Conflicts detected 100 Error 101 Conflicts detected, merge output not saved 102+ Error
合計4つのファイルパスパラメータを渡すことができます。 2つを渡すと、1つは左に1つは右になります。 3つは、左に1つ、右に1つ、中央に1つを示します。 4つは左と右の1つを表し、以下のファイルパスの1つが出力されます。
ここでは、比較のために2つのパラメーターを渡します。
ただし、以下の戻り値に注意してください。デフォルトでは、2つのファイルの比較に従って値が返されます。しかしsvn diff
これらのゼロ以外の値を受け入れると、比較で問題が発生し、プロセス全体が終了します。したがって、上記のスクリプトでは、exit 0
成功を返すために使用svn diff
外部プログラムを追加しました。
要約すると、Beyond Compareを使用して、svndiff比較ファイルを作成できます。