I have investigated the possibilities to control Git from Java. What I have found is :
- Using
Runtime.getRuntime().exec("git command")
- to have Java execute commands with git - Using JavaGit API (http://javagit.sourceforge.net/) or -Using Eclipse JGit API (http://www.jgit.org/)
I tried to write my own Java-wrapper for git with Runtime and ProcessBuilder, but I got problems with the process threads, was waiting for ever for the threads to finish some times.
I then looked into other solutions with APIs. First I tried JavaGit API, but I can't get that to work at all.
Second I tested JGit API, and it is looking great. But I soon find out that I could not set the commit date as I did with my Java-wrapper :
ProcessBuilder pb = new ProcessBuilder("git", "commit", "--date=" + "\"" + customDateString + "\"", "-m \"" + comment + "\"");
I downloaded the JGit source-code to see if I could implement it, but it was too much to read in and I could not find any issue tracker on Github for JGit to make a suggestion.
Can someone here help me do this?
Or tell me where I can write to make a suggestion to the developers?