]> source.dussan.org Git - jgit.git/commit
Move ArchiveCommand into standard porcelain API 62/12262/10
authorJonathan Nieder <jrn@google.com>
Sat, 25 May 2013 00:30:18 +0000 (17:30 -0700)
committerJonathan Nieder <jrn@google.com>
Sat, 25 May 2013 00:30:18 +0000 (17:30 -0700)
commit56276d053f44209f25951d3acfba226c563a81f0
tree9eb091e509cf57eefd22d8b099438757d9510b56
parenta544ff72dbf62671d2530f4cfca0e8f9dd693d78
Move ArchiveCommand into standard porcelain API

Allow use of ArchiveCommand without depending on the jgit command-line
tools.

To avoid complicating the process of installing and upgrading JGit,
this does not add a dependency by the org.eclipse.jgit bundle on
commons-compress.  Instead, the caller is responsible for registering
any formats they want to use by calling ArchiveCommand.registerFormat.

This patch puts functionality that requires an archiver into a
separate org.eclipse.jgit.archive bundle for people who want it.  One
can use it by calling ArchiveCommand.registerFormat directly to
register its formats or by relying on OSGi class loading to load
org.eclipse.jgit.archive.FormatActivator, which takes care of
registration automatically.

Once the appropriate formats are registered, you can make a tar or zip
from a git tree object as follows:

ArchiveCommand cmd = git.archive();
try {
cmd.setTree(tree).setFormat(fmt).setOutputStream(out).call();
} finally {
cmd.release();
}

Change-Id: I418e7e7d76422dc6f010d0b3b624d7bec3b20c6e
34 files changed:
org.eclipse.jgit.archive/.classpath [new file with mode: 0644]
org.eclipse.jgit.archive/.gitignore [new file with mode: 0644]
org.eclipse.jgit.archive/.project [new file with mode: 0644]
org.eclipse.jgit.archive/.settings/org.eclipse.core.resources.prefs [new file with mode: 0644]
org.eclipse.jgit.archive/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
org.eclipse.jgit.archive/.settings/org.eclipse.jdt.ui.prefs [new file with mode: 0644]
org.eclipse.jgit.archive/.settings/org.eclipse.mylyn.tasks.ui.prefs [new file with mode: 0644]
org.eclipse.jgit.archive/.settings/org.eclipse.mylyn.team.ui.prefs [new file with mode: 0644]
org.eclipse.jgit.archive/.settings/org.eclipse.pde.api.tools.prefs [new file with mode: 0644]
org.eclipse.jgit.archive/.settings/org.eclipse.pde.core.prefs [new file with mode: 0644]
org.eclipse.jgit.archive/META-INF/MANIFEST.MF [new file with mode: 0644]
org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF [new file with mode: 0644]
org.eclipse.jgit.archive/about.html [new file with mode: 0644]
org.eclipse.jgit.archive/build.properties [new file with mode: 0644]
org.eclipse.jgit.archive/plugin.properties [new file with mode: 0644]
org.eclipse.jgit.archive/pom.xml [new file with mode: 0644]
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/FormatActivator.java [new file with mode: 0644]
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java [new file with mode: 0644]
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java [new file with mode: 0644]
org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
org.eclipse.jgit.pgm/pom.xml
org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Archive.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/ArchiveCommand.java [deleted file]
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/FormatActivator.java [deleted file]
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/TarFormat.java [deleted file]
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/ZipFormat.java [deleted file]
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/internal/CLIText.java
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
pom.xml