0029009: Configuration - provide a way to get visual dif of SVG images
authorabv <abv@opencascade.com>
Thu, 17 Aug 2017 08:50:31 +0000 (11:50 +0300)
committerabv <abv@opencascade.com>
Thu, 17 Aug 2017 19:21:29 +0000 (22:21 +0300)
New helper script svgdiff.bat is added in adm folder.
It can be used for enabling visual diff for SVG images in TortouseGit; see Git guide for details.

adm/svgdiff.bat [new file with mode: 0644]
dox/dev_guides/git_guide/git_guide.md
dox/dev_guides/git_guide/images/OCCT_GitGuide_V2_svgdiff.png [new file with mode: 0644]

diff --git a/adm/svgdiff.bat b/adm/svgdiff.bat
new file mode 100644 (file)
index 0000000..ae81427
--- /dev/null
@@ -0,0 +1,31 @@
+@echo off
+rem Script to diff SVG images visually (as PNG) in TortoiseGit client
+rem 
+rem It assumes that Inkscape and TortoiseGitIDiff executables are either 
+rem installed in default locations in Program Files, or are accessible by PATH
+rem 
+rem To use this script for diffing SVG images, open TortoiseGit settings
+rem (Start -> Programs -> TortoiseGit -> Settings), select "Diff Viewer",
+rem click button "Advanced..." on the right tab and then add new record:
+rem - Extension: .svg
+rem - External program: <path to OCCT>\adm\svgdiff.bat %base %mine %bname %yname
+
+rem Remove double quotes around arguments
+set "f1=%1"
+set "f2=%2"
+set "f1=%f1:~1,-1%.png"
+set "f2=%f2:~1,-1%.png"
+
+rem Check if Inkscape and TortoiseGit are installed in default locations in 
+rem ProgramFiles; if not, assume they still may be accessible by PATH
+set "inkscape=%ProgramFiles%\Inkscape\inkscape.exe"
+if not exist "%inkscape%" set inkscape=inkscape.exe
+set "tgitidiff=%ProgramFiles%\TortoiseGit\bin\TortoiseGitIDiff.exe"
+if not exist "%tgitidiff%" set tgitidiff=TortoiseGitIDiff.exe
+
+rem Convert SVG to PNG using Inkscape
+"%inkscape%" -e "%f1%" %1
+"%inkscape%" -e "%f2%" %2
+
+rem Call Tortoise differ
+"%tgitidiff%" /left:"%f1%" /right:"%f2%" /lefttitle:%3 /righttitle:%4
index 794117ad7920aa35b125841dc5df36c26ec1fe6e..aefc95e12c61e8b16624e614d799db8e076b15df 100644 (file)
@@ -82,7 +82,7 @@ The official repository contains:
 
 @subsection occt_gitguide_1_5 Version of Git
 
-  The repository is tested to work with Git 1.7.6 to 1.7.9
+  The repository is tested to work with Git 1.7.6 and above
   Please do not use versions below 1.7.1 as they are known to cause troubles.
 
 @section occt_gitguide_2 Installing Tools for Work with Git
@@ -139,6 +139,13 @@ The official repository contains:
   
   @figure{OCCT_GitGuide_V2_image006.png,"",320}
 
+  Optionally, you can set up TortoiseGit to use visual diff utility for SVG images used in OCCT documentation.
+  For that, click on item "Diff Viewer" in the Settings dialog, then click button "Advanced..." on the right tab add new record with the following parameters:
+  - Extension: <code>.svg</code>
+  - External program: <code>&lt;path_to_OCCT&gt;\\adm\\svgdiff.bat %%base %%mine %%bname %%yname</code>
+
+@figure{OCCT_GitGuide_V2_svgdiff.png,"",709}
+
 @subsection occt_gitguide_2_2 Linux platform
 
   We assume that Linux users have Git already installed and available in the *PATH*.
diff --git a/dox/dev_guides/git_guide/images/OCCT_GitGuide_V2_svgdiff.png b/dox/dev_guides/git_guide/images/OCCT_GitGuide_V2_svgdiff.png
new file mode 100644 (file)
index 0000000..d65c062
Binary files /dev/null and b/dox/dev_guides/git_guide/images/OCCT_GitGuide_V2_svgdiff.png differ