You have successfully versioned your Oracle Forms & Reports module with git. What if you could see the diff for your module after changes from your working copy or between two commits? See my solution with the tools from ORCL Toolbox and a Git difftool wrapper.
At first you need a licence for FormsAPI Master or FormsTool from ORCL Toolbox. If you know another tool, please add a comment below! As long as it have a CLI for diff, it should be implemented in similar way.
Install the tool, in my case FormsAPI Master.
Then create a file git-difftool-wrapper.cmd in you Git installation, eg. in C:\Program Files\Git\cmd.
@echo off
rem call FormsAPI Master only for binary oracle forms and reports modules
if "%~x1"==".fmb" goto CheckFormsAPIMaster
if "%~x1"==".mmb" goto CheckFormsAPIMaster
if "%~x1"==".olb" goto CheckFormsAPIMaster
if "%~x1"==".pll" goto CheckFormsAPIMaster
if "%~x1"==".rdf" goto CheckFormsAPIMaster
goto NoExternalDiff
:CheckFormsAPIMaster
rem check if the installation of FormsAPI Master exists
if exist "C:/Oracle/FormsAPIMaster40b450/FapiMaster.exe" goto FormsAPIMaster
goto NoExternalDiff
:FormsAPIMaster
rem call FormsAPI Master
"C:/Oracle/FormsAPIMaster40b450/FapiMaster.exe" /COMPARE /MODULE1=%1 /MODULE2=%2
goto end
:NoExternalDiff
rem inform the user that no other external diff tools are defined
C:\Windows\System32\msg.exe * "No external diff tool found for this file extension!"
:end
Next you edit your Git configuration. I recommend to do this as local administrator in the in git system configuration for all computer users:
git config --system diff.tool git-difftool-wrapper
git config --system --replace-all difftool.prompt false
git config --system --replace-all difftool.git-difftool-wrapper.cmd ^
"\"C://Program Files//Git//cmd//git-difftool-wrapper.cmd\" \"$LOCAL\" \"$REMOTE\"
This should result in following configuration:
[diff]
tool = git-difftool-wrapper
[difftool "git-difftool-wrapper"]
cmd = \"C://Program Files//Git//cmd//git-difftool-wrapper.cmd\" \"$LOCAL\" \"$REMOTE\"
[difftool]
prompt = false
If you now change to your working copy you can test the following:
X:\test_forms_compare>git diff customers.fmb
diff --git a/customers.fmb b/customers.fmb
index e28d88f..f31930c 100644
Binary files a/customers.fmb and b/customers.fmb differ (1)
X:\test_forms_compare>git difftool customers.fmb (2)
1 | Standard diff shows further only that there is a difference. |
2 | But difftool now opens FormsAPI Master and show your differences: |
And this work too from graphical tools like Atlassian Sourcetree, which use the installed and configured Git version and can call external diff tools.
That’s it!