Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

does Java have API wrappers around subversion and Git?

Tags:

java

git

svn

Curious if there any API wrappers for Git and Subversion for Java?

I want to be able to pullup the changesets and souce code (and diffs) from Subversion and Git repos.

Is this possible? Any pre-built APIs?

like image 256
mrblah Avatar asked Dec 28 '09 23:12

mrblah


4 Answers

A quick google search found some results, although I can't say I've used them so their usefulness is unknown

  • JavaGit: "JavaGit is a Java API that provides access to git repositories. Our goal is to provide a library with an easy-to-use API that is intuitive for developers new to git and developers who are veteran git users." According to their FAQ it just uses the command line git command behind the scenes
  • JGit: An implementation of git in Java
  • svnkit: Implementation of SVN in Java.
like image 126
Gavin H Avatar answered Oct 20 '22 05:10

Gavin H


jGit is an implementation of git in Java.

SvnClientAdapter will connect to SVN using various different methods.

like image 45
mopoke Avatar answered Oct 20 '22 04:10

mopoke


JGit is an implementation of Git, so if you are looking for just an API which routes to the native git implementation, it will not do the trick.

JavaGit just does not work. I tried it under win64 with msysgit 1.8.1 and,... well it just does not work. Probably it was tested under another OS and older version of git.One can go ahead and fix JavaGit for their purposes - the code is far from complex. The maturity of the source is not impressive though - there are unimplemented stubs, exception swallowing etc. I'd say it's an unfinished project by otherwise well-intended people.

Maybe another alternative is to take the git command class from http://plugins.jetbrains.com/plugin/3033 and decouple it from intellij infrastructure. That is something I would pursue.

It's always an option, if your usecases are simple, to implement your own API, perhaps reusing a commandline abstraction library such as http://commons.apache.org/proper/commons-cli/

Hope this helps.

like image 2
Mitaka Avatar answered Oct 20 '22 05:10

Mitaka


Check out svnkit for a java-based subversion implemention. There are also subversion bindings to java distributed with subversion at http://subversion.tigris.org/

jgit has a java implementation for git.

like image 1
Andrew Avatar answered Oct 20 '22 04:10

Andrew