-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run custom commands though JGit CLI #73
Comments
Just so I understand the use cases, how is this different from having an external tool or custom toolbar equivalent that asks the user for a git command or provides a combobox of favorites to choose from and passes it to one of the executeCommand operations? Isn't a separate process created in these instances as well? Would the JGit command line library allow you to create a git console view that is interactive instead of output only? On a related note, is the JGit library, or a wrapped version of it, exposed through Oxygen's Rhino engine to Javascript customization scripts? |
The main benefit would be that you don't need another git client installed on your system. A separate process would indeed be created in this case as well.
Perhaps, but that's not the scope of this issue.
I don't think there's an easy solution to this... These Javascript customization scripts run in a framework action? A framework can share a plugin classloader. In theory, if a framework is bound to the Git plugin's classloader then one could use the singleton {{com.oxygenxml.git.service.GitAccess}} to execute operations on the Git repository etc. |
I gave it a shot and unfortunately the JS script doesn't look to be invoked in the framework's class loader which means it can't access git plugin classes. That leaves the JAVA based operation which is definitely loaded with the proper class loader so it can access the git classes. |
The command line client tools built on top of JGit is available as a Maven artifact: https://mvnrepository.com/artifact/org.eclipse.jgit/org.eclipse.jgit.pgm
What we can do:
java -cp args4j-2.33.jar;bcpg-jdk15on-1.61.jar;bcpkix-jdk15on-1.61.jar;bcprov-jdk15on-1.61.jar;eddsa-0.3.0.jar;httpclient-4.5.10.jar;JavaEWAH-1.1.6.jar;jsch-0.1.55.jar;jzlib-1.1.1.jar;log4j-1.2.14.jar;org.eclipse.jgit-5.4.2.201908231537-r.jar;org.eclipse.jgit.http.apache-5.4.2.201908231537-r.jar;org.eclipse.jgit.lfs-5.4.2.201908231537-r.jar;org.eclipse.jgit.pgm-5.4.3.201909031940-r.jar;org.eclipse.jgit.ssh.apache-5.4.2.201908231537-r.jar;slf4j-api-1.7.2.jar;slf4j-log4j12-1.7.25.jar;sshd-common-2.2.0.jar;sshd-core-2.2.0.jar;sshd-osgi-2.2.0.jar;sshd-sftp-2.2.0.jar org.eclipse.jgit.pgm.Main
We might use Maven copy:dependencies to copy all dependencies or https://maven.apache.org/ant-tasks/index.html to collect all these jars.
Some users might desire a Favorites mechanism and/or a History for these commands.
The text was updated successfully, but these errors were encountered: