Difference between revisions of "Diff"

From BlackBox Framework Wiki
Jump to navigation Jump to search
 
(13 intermediate revisions by 2 users not shown)
Line 5: Line 5:
Here is how to set it up for Git:
Here is how to set it up for Git:


1. download and unpack the attached DiffConfig package, which simply
1. Download and unpack the [[Media:DiffConfig17.zip|DiffConfig1.7]] package, which simply
contains a special version of a BlackBox 1.6 Config file.
contains a special version of a BlackBox 1.7 Config file. You may need to recompile it if you need it for a version other than 1.7. For BlackBox 1.6 you can use the [[Media:DiffConfig.zip|DiffConfig1.6]] package.


2. Under Git settings configure a diff viewer for the .odc file name extension.
2. Under Git settings configure a diff viewer for the .odc file name extension.


The details depend on which Git client tool you use but there is always a way for setting up a diff viewer for a specific file name extension.
The details depend on which Git client tool you use but there is always a way for setting up a diff viewer for a specific filename extension. For [https://tortoisegit.org/ TortoiseGit] you select the entry 'Settings' under the Git Popup menu. Then select 'Diff Viewer' and 'Advanced...'. Then 'Add...' a new diff viewer and adapt the paths as needed:
Under TortoiseGit, which I use, you select the entry 'Settings' under the Git Popup menu. Then select 'Diff Viewer' and 'Advanced...'.


Then 'Add...' a new diff viewer and adapt the paths as needed:
Extension: ''.odc''


Extension: .odc.
External Program: ''"C:\Program Files\BlackBox Component Builder 1.7\BlackBox.exe" /USE "C:\Program Files\DiffConfig" %mine %base''


External Program: "C:\Program Files\BlackBox Component Builder 1.6\BlackBox.exe" /USE "C:\Program Files\DiffConfig" %mine %base
The BlackBox.exe path of course may need to be adapted. Note that there are double quotes required if the path contains spaces. That is it.


That is it.
Now you can use all the diff commands of your Git client for .odc files. The Config file simply tiles the window vertically, the left window showing the base version, and the right window showing the new version. Then it invokes the Info->Compare Texts command (F9). You use F9 to step to the next difference.
 
Now you can use all the diff commands of your Git client for .odc files.
 
The Config file simply tiles the window vertically, the left window showing the base version, and the right window showing the new version.
 
Then it invokes the Text Diff command (F9). You use F9 to step to the next difference.


== For Terminal ==
== For Terminal ==


To use "odcread" in local repository as binary to text converter:
To use binary to text converter from terminal in Linux:


1. Download [[https://github.com/gertvv/odcread odcread]], compile and install in folder /usr/local/bin/
1. Download [http://github.com/gertvv/odcread odcread], compile and install it in a system folder.


2. In local repository make file .git/info/attributes with content *.odc diff=cp
git clone http://github.com/gertvv/odcread.git
cd odcread
sudo apt-get install g++
make
sudo mv odcread /usr/bin


3. In file .git/config add next three strings:
2. In local repository make file '''.git/info/attributes''' with content


[diff "cp"]
*.odc diff=cp


binary = true
3. In file '''.git/config''' add next three lines at the end:


textconv = /usr/local/bin/odcread
[diff "cp"]
      binary = true
      textconv = /usr/bin/odcread

Latest revision as of 11:03, 16 November 2016

For GUI

If you want to use Git (or Svn) for managing BlackBox source code and resource files, which are in a binary format (.odc), you need a diff viewer capable of handling this specific file format. As it turned out, BlackBox can be used for that purpose with just a small adaptation.

Here is how to set it up for Git:

1. Download and unpack the DiffConfig1.7 package, which simply contains a special version of a BlackBox 1.7 Config file. You may need to recompile it if you need it for a version other than 1.7. For BlackBox 1.6 you can use the DiffConfig1.6 package.

2. Under Git settings configure a diff viewer for the .odc file name extension.

The details depend on which Git client tool you use but there is always a way for setting up a diff viewer for a specific filename extension. For TortoiseGit you select the entry 'Settings' under the Git Popup menu. Then select 'Diff Viewer' and 'Advanced...'. Then 'Add...' a new diff viewer and adapt the paths as needed:

Extension: .odc

External Program: "C:\Program Files\BlackBox Component Builder 1.7\BlackBox.exe" /USE "C:\Program Files\DiffConfig" %mine %base

The BlackBox.exe path of course may need to be adapted. Note that there are double quotes required if the path contains spaces. That is it.

Now you can use all the diff commands of your Git client for .odc files. The Config file simply tiles the window vertically, the left window showing the base version, and the right window showing the new version. Then it invokes the Info->Compare Texts command (F9). You use F9 to step to the next difference.

For Terminal

To use binary to text converter from terminal in Linux:

1. Download odcread, compile and install it in a system folder.

git clone http://github.com/gertvv/odcread.git
cd odcread
sudo apt-get install g++
make
sudo mv odcread /usr/bin

2. In local repository make file .git/info/attributes with content

*.odc diff=cp

3. In file .git/config add next three lines at the end:

[diff "cp"]
     binary = true
     textconv = /usr/bin/odcread