Calling abapGit directly from Abap in Eclipse
I am sure the open source project abapGit and the development environment Abap in Eclipse are already well known, therefore I skip the introduction of them.
For commiting your ABAP code from Eclipse to a GIT repository currently the following steps are necessary:
- Open an SAP GUI (either as a particular instance or within ABAP in Eclipse)
- Start the transaction ZABAPGIT
- Select a specific ABAP package
- Peform the desired Git commands
The first three points are always identical, thus they are perfect candidates to be automated.
The first two points I have already completed but with point 3 … I am struggling, but to this point a bit later.
To get the first two points working automatically is now quite easy. The only necessary step is to go to the Eclipse marketplace and install or update the free plugin ABAP Continuous Integration. After completing this installation you get an additional menu entry: abapGit, invokable also with the Shortcut Ctrl+Alt+K. Of course abapGit has to be already installed before.
Pushing the menu item or pressing the shortcut opens abapGit for the currently selected project in the project explorer.
Currently an ABAP development package or an child object of this package has to be activated to get the shortcut and the menu item working but I will investigate how to get the functionality available for the whole workspace.
Well if you are constanly working with the same package or the clicks to change the package do not bother you … perfect – the new menu item will save you hopefully a lot of time when calling abapGit out of the Eclipse environment.
If you would like also to get also the package change automated, you are welcome to join the abapGit community package change challenge 😉 .Any idea, hint or anything else helpful is welcome – lets solve this challenge together.
What I tried already:
Approach 1: Changing the package with an ADT rest service.
I have already created a prototype with the ADT SDK to get the package name and the username to the ABAP backend. See. ABAPCI_ABAPGIT – connection from Eclipse to abapGit. The only thing that is missing is how to trigger the package change on the abapGit side.
Refreshing the abapGit Transaction, or reloading it?
Approach 2: Calling the ZABAPGIT transaction with parameters
With the ADT SDK it is also possible to open a transaction with parameters. On thing todo with this approach is certainly adapt abapGit to consider this parameters. The harder part with this approach is maybe to not loose the already inserted git repository credentials.
Approach 3: Ideas welcome