jgit_jdbc
jgit_jdbc copied to clipboard
JDBC based storage layer for JGit
com.sap.poc.jgit.storage.jdbc
This package is a prototypical implementation (proof of concept, thus packaged in com.sap.poc) of the (not final) org.eclipse.jgit.storage.dht.spi interface. It binds JGit's generic DHT storage to JDBC.
The code is based on patch set 11 of Shawn Pearce's JGit change "RFC Store Git on any DHT" (http://egit.eclipse.org/r/2295). Furthermore Shawn's JGit DHT storage implementations for Apache Cassandra (https://github.com/spearce/jgit_ cassandra) and Apache HBase (https://github.com/spearce/jgit_hbase) have been used as 'reference implementations'.
This version has been successfully tested on a PostgreSQL database (version 9.0.3-1). As a test repository, JGit itself was pushed and cloned. The current version works with PostgreSQL only as it uses data type 'BYTEA'.
Here are the steps to try it out:
-
Download and install database software
-
Start database server e.g. PostgreSQL: initdb -D <...>/data -E UNICODE postgres -D <...>/data
-
Create database e.g. PostgreSQL: createdb
-
Download JDBC driver
-
Copy driver to JRE's lib/ext directory
-
Build jgit-jdbc.jar
-
Create schema java -Djdbc.drivers=
-jar jgit-jdbc.jar
jdbc-create-schema git+jdbc+:// : / e.g. PostgreSQL on localhost: java -Djdbc.drivers=org.postgresql.Driver -jar jgit-jdbc.jar
jdbc-create-schema git+jdbc+postgresql://localhost:5432/ -
Initialize repository java -Djdbc.drivers=
-jar jgit-jdbc.jar
jdbc-init git+jdbc+:// : / / .git e.g. PostgreSQL on localhost: java -Djdbc.drivers=org.postgresql.Driver -jar jgit-jdbc.jar jdbc-init
git+jdbc+postgresql://localhost:5432// .git -
Start JGit daemon (with 800M) java -Xmx800m -jar jgit-jdbc.jar jdbc-daemon --enable receive-pack
git+jdbc+:// : / / .git e.g. PostgreSQL on localhost: java -Xmx800m -jar jgit-jdbc.jar jdbc-daemon --enable receive-pack
git+jdbc+postgresql://localhost:5432// .git -
Push git push git://
/ .git master -
Clone git clone git://
/ .git