summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.archive
Commit message (Collapse)AuthorAgeFilesLines
* Tag som non-localizable strings with NON-NLSRobin Rosenberg2014-01-106-18/+15
| | | | Change-Id: I6882c98c2785f38241a81ba5b93892aab79690a5
* Add missing package import for org.eclipse.jgit.archiveMatthias Sohn2014-01-071-0/+1
| | | | | | The archive bundle needs access to the nls package since 2ecc27db. Change-Id: I76882e1f270296c5ce8e220e1946c4a8ddb6fdf5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* archive: Include entries for directoriesJonathan Nieder2013-12-274-6/+105
| | | | | | | | | | | | Entries for directories are optional and mostly wasted space in most archive formats (except as a place to hang ownership and filesystem permissions), but "git archive" includes them. Follow suit. This will make it easier in a later change to include empty directories as placeholders for missing submodules. Change-Id: I1810c686bcc9eb4d73498e4d3e763e18787b088a Signed-off-by: Jonathan Nieder <jrn@google.com>
* Prepare 3.3.0-SNAPSHOT buildsMatthias Sohn2013-12-053-7/+7
| | | | | Change-Id: I7c7e7c1beec0c5d15b96c14c73ce93e3f09855c8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add uses directives to ensure OSGi wires jgit bundles correctlyMatthias Sohn2013-11-121-1/+5
| | | | | | | | See http://spring.io/blog/2008/10/20/understanding-the-osgi-uses-directive/ Bug: 420903 Change-Id: I3706a2b8f695d4ce0ee2333722ed7b8d31032f1e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Revert "Close unfinished archive entries on error""Dave Borowitz2013-11-012-10/+4
|\
| * Revert "Close unfinished archive entries on error"Jonathan Nieder2013-09-232-10/+4
| | | | | | | | | | | | | | | | | | | | This reverts commit 75d9b31f14d6226a535a80c05cffda29e55d2ceb. Now that we do not try to close the ArchiveOutputStream in the error path, there is no need to artificially close partial entries from before the error. Change-Id: I1f1cb08ec4e9b14c79bf4621f3fa959463034b82 Signed-off-by: Jonathan Nieder <jrn@google.com>
* | Prepare 3.2.0-SNAPSHOT buildsMatthias Sohn2013-10-033-7/+7
| | | | | | | | | | Change-Id: Iac6cf7a5bb6146ee3fe38abe8020fc3fc4217584 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Prepare post 3.1.0 buildsstable-3.1Matthias Sohn2013-10-033-7/+7
| | | | | | | | | | Change-Id: I306a3d40c6ddb88a16d17f09a60e3d19b0716962 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | JGit v3.1.0.201310021548-rv3.1.0.201310021548-rMatthias Sohn2013-10-023-4/+4
| | | | | | | | | | Change-Id: I2170b13047d5eab7565f47f9feb1680e03b1ba09 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Prepare post 3.1.0 RC1 buildsMatthias Sohn2013-09-273-3/+3
| | | | | | | | | | Change-Id: I060f2082ccd0c91905b6b29a49cc633a0b51a1f2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | JGit v3.1.0.201309270735-rc1v3.1.0.201309270735-rc1Matthias Sohn2013-09-273-3/+3
|/ | | | | Change-Id: I48202dd461110da25f9bc159c938311fff0669e0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* TarFormat: use tabs for indentDave Borowitz2013-07-171-1/+1
| | | | Change-Id: I2f4c285d2b2f4bdb7a5d1a1026c131417066410d
* Close unfinished archive entries on errorJonathan Nieder2013-07-172-4/+10
| | | | | | | | | | Otherwise the underlying error is hidden by an "IOException: This archives contains unclosed entries." when jgit tries to close the archive. Reported-by: Dave Borowitz <dborowitz@google.com> Change-Id: I594dcdf366200b802e13e5a645fe06597feb7bb4 Signed-off-by: Jonathan Nieder <jrn@google.com>
* Disable warning about assigning to parameterRobin Stocker2013-06-151-1/+1
| | | | | | | | | See change I08bed4275af9ec52aa4d7054067ac82f6a3c9781, where fixing such warning lead to complaints. If fixing is not wanted, disable it instead. Change-Id: If31d4028fa1c6377a11e83ed5688b45701cec68b
* Prepare 3.1.0-SNAPSHOT buildsMatthias Sohn2013-06-133-7/+7
| | | | | Change-Id: I7490a7c9558423c03e3c167ad55b9a98be9d99d9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Pick default archive format based on filename suffixJonathan Nieder2013-06-065-0/+53
| | | | | | | | | | | | Introduce a setFilename() method for ArchiveCommand so callers can specify the intended filename of the produced archive. If the filename ends with .tar, the format will default to tar; if .zip, zip; if .tar.gz, gzip-compressed tar; and so on. This doesn't affect "jgit archive" because it doesn't support the --output=<file> option yet. A later patch might do that. Change-Id: Ic0236a70f7aa7f2271c3ef11083b21ee986b4df5
* Add long filename, large file, and non-ASCII filename support to TarFormatJonathan Nieder2013-06-062-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Attempts to write entries with too-long filenames currently error out: $ jgit.pgm/target/jgit archive HEAD >test.tar java.lang.RuntimeException: file name 'org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java' is too long ( > 100 bytes) at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.putArchiveEntry(TarArchiveOutputStream.java:288) at org.eclipse.jgit.archive.TarFormat.putEntry(TarFormat.java:92) at org.eclipse.jgit.archive.TarFormat.putEntry(TarFormat.java:62) at org.eclipse.jgit.api.ArchiveCommand.writeArchive(ArchiveCommand.java:293) at org.eclipse.jgit.api.ArchiveCommand.call(ArchiveCommand.java:322) at org.eclipse.jgit.pgm.Archive.run(Archive.java:97) at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:174) at org.eclipse.jgit.pgm.Main.execute(Main.java:213) at org.eclipse.jgit.pgm.Main.run(Main.java:121) at org.eclipse.jgit.pgm.Main.main(Main.java:95) That's because the default longFileMode is LONGFILE_ERROR, which throws an exception for filenames longer than 100 characters. Switch to LONGFILE_POSIX. While at it, handle large files and filenames with strange encodings, too. This requires commons compress 1.4, which introduced support for large files and POSIX long filenames. Change-Id: I04d5427eec0968b129f55d7a4c6021039a494828
* Add tbz2 archive formatJonathan Nieder2013-06-053-0/+73
| | | | Change-Id: Idb7ff75877a0cfe23f47e10e3f6f93386f5bb145
* Fix javadoc of FormatActivatorMatthias Sohn2013-06-021-5/+7
| | | | | Change-Id: I64b32f71df2964da4cb2de73b34bf7e455ab5b93 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix version of dependency to package org.osgi.frameworkMatthias Sohn2013-06-011-1/+1
| | | | | | | | | | | | OSGi 4.01 comes with package org.osgi.framework version 1.3 [1] which has the BundleActivator interface needed by org.eclipse.jgit.archive. OSGi 5.0 matches package org.osgi.framework version 1.7 [2]. [1] http://www.osgi.org/javadoc/r4v401/ [2] http://www.osgi.org/javadoc/r5/core/ Change-Id: I10f78e5eb02b5d03395f23d2f0ad039caf565269 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add missing javadoc for archive codeJonathan Nieder2013-05-295-0/+25
| | | | | | | | Document archive formats, the archive format interface, and the parameters of the GitAPIException constructors. Noticed by eclipse. Reported-by: Dani Megert <Daniel_Megert@ch.ibm.com> Change-Id: I22b5f9d4c0358bbe867c1906feec7c279e214273
* Drop unnecessary "throws" clauses in archive codeJonathan Nieder2013-05-291-2/+2
| | | | | | Noticed by eclipse. Change-Id: I730b290556066038efeaf2436de95415b175f351
* Move FormatActivator.start()/stop() to a separate classJonathan Nieder2013-05-292-44/+93
| | | | | | | | | This makes the functionality of registering all formats from the org.eclipse.jgit.archive package available in contexts where FormatActivator cannot be built because the OSGi core framework is not readily available to build against. Change-Id: If8e3487e933783a7e12f8e1838cbfe0b5862ce80
* Add tgz and txz archive formatsJonathan Nieder2013-05-284-0/+140
| | | | Change-Id: I347e8a9a112d142ccef91cba1d6e997d645ca70a
* Maintain list of archive formats in one placeJonathan Nieder2013-05-281-4/+51
| | | | | | | | | | | | | Add a static start() method to FormatActivator to allow outside classes such as the Archive subcommand of the jgit program to use it without a BundleContext. This way, the list of formats only has to be maintained in one place. While at it, build a list of registered formats at start() time, so stop() doesn't have to repeat the same list of formats. Suggested-by: Shawn Pearce <spearce@spearce.org> Change-Id: I55cb3095043568740880cc9e4f7cde05f49c363c
* Move ArchiveCommand into standard porcelain APIJonathan Nieder2013-05-2420-0/+1034
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