The Agent Git plug-in allows you to seamlessly integrate PowerBuilder 2017, PowerBuilder 2019 and PowerBuilder 2023 with Git.
Features of the plug-in include:
Below is a link to a short video showing how to connect a PowerBuilder 2017 workspace to the Git version control using Agent Git.
Note: The configuration steps for PowerBuilder 2019 and PowerBuilder 2023 will be the same as shown in that video.
The tutorial below describes how to use Agent Git with the PowerBuilder 2017 IDE and the Git source control.
For a better understanding on how PowerBuilder interacts with the source control refer to the links below:
IMPORTANT: For the Agent Git plug-in to perform well with PowerBuilder some additional PowerBuilder configuration is also required.
PowerBuilder configuration information can be found here and the following information is taken form that page.
Extension to the SCC API - Status determination by version number
PowerBuilder provides third-party SCC providers with an extension to the SCC API that allows them to enhance the integration of their products with PowerBuilder. Typically, calls to the SccDiff method are required to determine if an object is out of sync with the SCC repository. (This is not appropriate for Perforce or ClearCase.)
However, SCC providers can implement SccQueryInfoEx as a primary file comparison method instead of SccDiff. The SccQueryInfoEx method returns the most recent version number for each object requested. This allows PowerBuilder to compare the version number associated with the object in the PBL with the version number of the tip revision in the SCC repository in order to determine whether an object is in sync.
Since SccQueryInfoEx is a much simpler request than SccDiff, the performance of the PowerBuilder IDE improves noticeably when this feature is implemented by the SCC provider. For these providers, the SccDiff call is used as a backup strategy only when a version number is not returned on an object in the repository. Also for these providers, the version number for registered files can be displayed in the Library painter.
The Agent Git plug-in supports this SccQueryInfoEx extension and its performance is much faster than the default SccDiff option.
To make sure this option is working check the PowerBuilder configuration details and in particular check the SccDiffStrategy option.
Use the Agent Git Configuration utility to do the once off configuration of the plug-in.
You can use this dialog to configure the behaviour of the plug-in.
To see how Agent Git works we need something to play with so the next step is to create a simple PowerBuilder test project.
From within the PowerBuilder IDE create a new MyWorkspace test workspace and add a template application to that workspace as shown below:
From within the PowerBuilder IDE use the Properties menu to bring up the MyWorkspace, Properties dialog as shown below:
Setup Agent Git as the Source Control System for this workspace, fill in the required connection details and also set the Status Refresh Rate to a high value as shown below:
IMPORTANT:
If the Agent Git plug-in is not listed in the Source Control Systems that indicates the Agent Git software has not been succesfully installed. This can be because the wrong version of the Agent Git installer was used and the best way to check this is by running both the 64-bit and 32-bit bit versions of the installer found on the download page.
IMPORTANT NOTES:
If you are using the Agent Git option to mark files as read only when not checked out make sure you also select the PowerBuilder option to not prompt when overwriting read only files.
Make sure the Project entered matches the workspace name used in Step 3.
Make sure the Local Root Directory entered matches folder location of the workspace that was created in Step 3.
Use the button as indicated by the blue square, to import the project into the Git Repository as shown below:
This will result in you being presented with the project binding dialog as shown below:
This dialog takes two inputs, a project name and a local folder location that contains the Git repository.
In this particular case, as this is a new project, hitting the Ok button will result in the following dialog:
The reason the dialog is displayed is because we are dealing with a new project and no Git repository exists for the project and as such the response should be Yes.
However, for the case where the project already has a Git repo the answer should be No and the path should then be modified to point to that existing Git repo.
Apply the changes and the workspace will now be bound to the Git repository.
With the workspace now bound to the Git repository, use the Add to Source Control option to add the workspace items to the Git repository as shown below:
This will result in the following PowerBuilder import dialog:
At this stage the workspace and all it's items have been imported into the repository and the workspace has also been bound to the repository.
To access the source control from inside PowerBuilder use the popup menu as shown below:
IMPORTANT NOTE: If these source control menus are disabled, check the machine for duplicate copies of PowerBuilder pb*.dll files.
To check the bindings use the Show History menu to check on the source control history for the workspace as shown below:
With the workspace now fully configured, you can now use the check-out, check-in, file compare commands (or any of the other source control commands) to manage your workspace files.
For more information, this link describes how to get the best out of source control from inside the PowerBuilder IDE.