summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
Commit message (Collapse)AuthorAgeFilesLines
* Have git-ls tree to accept path args like git-ls-treeKetan Padegaonkar2012-11-181-2/+14
| | | | | | | | | | Usage is: jgit ls-tree [-r|--recursive] <tree-ish> [-- paths...] Change-Id: I2e1c9c3cc8cddfa12ca4bfb9afc4df0492a9fce1 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add "jgit archive" tool that writes a tree as a ZIP fileJonathan Nieder2012-11-164-0/+110
| | | | | | | | | | | | | | | | | | | | | | | C Git's "git archive" command represents a tree object using a standard archival format like tar, zip, or tgz, ready for consumption by other, git-unaware users or tools. Add a bare-bones analagous "jgit archive" command to show what is possible, supporting only ZIP format for now. It uses java.util.zip which is not aware of the InfoZIP extensions for representing symlinks and file permissions, so symlinks, executable files, and submodule entries are represented as plain text files. Making this functionality available from the library, improving handling of special entries, and support for other output formats are left for later patches. Ultimately the intent is to offer a TreeArchiveStream class for use by web frontends like Gitiles to offer "download as zip/tgz/txz" links and use by, for example, code search tools to get easy access to the content of git tree objects. Test with "jgit archive my-favorite-tree >out.zip". Change-Id: Ib590f173ceff3df4b58493cecccd6b9a1b355e3d
* Add reflog command to JGit CLITomasz Zarna2012-11-163-0/+90
| | | | | | Bug: 394497 Change-Id: Ib8bc1d9fd789d22fe5f10e03068a11cfdd3e46eb Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Make an exception for the formatting rules (turn off) for some filesRobin Rosenberg2012-11-161-0/+1
| | | | | | | | | | Our rule to enforce javodocs for public members gives us a problem because there are some patterns where javadoc make little sense so we make the comments as small as possible, which our formatting rules do not like, so disable it for those source files. Change-Id: I6e3edb1e650ed45428b89cf41e6151b6536bca8a Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Harmonize the JDT settings within JGitRobin Rosenberg2012-11-164-10/+68
| | | | | | | | | | | Note the the settings are slightly less restrictive for test bundles. -Also cleanup a couple of malformed javadocs -Update compiler warnings/errors to include default values from Juno -We now flag diagnosed null dereference as error. We didn't do that earlier because of some false positives. Change-Id: I58386d63164e65d3d8d1998da3390d99bdc7381a Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add missing @since tags to mark API added in 2.2Matthias Sohn2012-11-162-2/+11
| | | | | | Change-Id: I458167739210214fa54c4b3d62fac5abc82f96f7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add support for --no-ff while mergingTomasz Zarna2012-11-163-4/+61
| | | | | | Bug: 394432 Change-Id: I373128c0ba949f9b24248874f77f3d68b50ccfd1 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add a test for org.eclipse.jgit.pgm.TagTomasz Zarna2012-11-153-2/+10
| | | | | | | | The test checks if an error is thrown when trying to create the same tag for the second time. Change-Id: I4ed2f6c997587f0ea23bd26a32fb64a2d48a980e Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Do not fail when checking out HEADTomasz Zarna2012-11-151-0/+2
| | | | | Change-Id: I99f5467477ed53101121a5a5d8a0910c55758401 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Prefix an abnormal CLI command termination with 'fatal:'Tomasz Zarna2012-11-152-2/+0
| | | | | Change-Id: I3d257666c6fbed7b238c575808f73ec518e811b9 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Merge "Fix formatting in org.eclipse.jgit.pgm.CLIText"Matthias Sohn2012-11-141-6/+2
|\
| * Fix formatting in org.eclipse.jgit.pgm.CLITextTomasz Zarna2012-11-111-6/+2
| | | | | | | | Change-Id: Ia87f28fa440cb354bf591713c8aadbe3969edbf1
* | diff, log -p: do not use outs before it is initializedJonathan Nieder2012-11-142-4/+16
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit caa362f20df1 (Check for write errors in standard out and exit with error, 2012-09-14), running "jgit diff" results in a NullPointerException: | $ jgit diff | java.lang.NullPointerException | at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) | at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126) | at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:688) | at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:630) | at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:616) | at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:600) | at org.eclipse.jgit.pgm.Diff.run(Diff.java:211) | at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:166) | at org.eclipse.jgit.pgm.Main.execute(Main.java:200) | at org.eclipse.jgit.pgm.Main.run(Main.java:120) | at org.eclipse.jgit.pgm.Main.main(Main.java:94) That patch replaced most uses of System.out with a wrapper, with changes like the following: class Diff extends TextBuiltin { private final DiffFormatter diffFmt = new DiffFormatter( // - new BufferedOutputStream(System.out)); + new BufferedOutputStream(outs)); outs is not set for TextBuiltin objects until init() has been run. Moving the initialization to after the super.init() call gets "jgit diff" and "jgit log -p" working well again. Change-Id: I80fcf259c4fb733990bd16e52bcf94e66d820826
* Suppress resource warnings with Java 7Robin Rosenberg2012-10-251-0/+1
| | | | | | | | | | | For streams that should not be closed, i.e. don't own an underlying stream, and in-memory streams that do not need to be closed we just suppress the warning. This mostly apply to test cases. GC is enough. For streams with external resources (i.e. files) we add the necessary call to close(). Change-Id: I4d883ba2e7d07f199fe57ccb3459ece00441a570
* Add --squash option to org.eclipse.jgit.pgm.MergeTomasz Zarna2012-10-073-1/+14
| | | | Change-Id: Ifd20b6f4731cfa71319145cac7b464aa53db18b8
* Revert "The constructor CmdLineException(String) is deprecated"Shawn O. Pearce2012-09-266-36/+20
| | | | | | | | | | | | | | | | This reverts commit 07f99362575f324e466d7f5ae49d5f8f69cf7a8a. 07f9 seems to require a more recent args4j, but I cannot locate a CQ that verifies we can use a version more recent then 2.0.12. 2.0.16 has been released, but the Hudson CI instance at Eclipse won't build it. Since the commit fixes an issue identified in March but wasn't actually submitted to the tree until September, we can continue to ignore whatever the problem is/was until someone can attempt a more correctly working solution. Change-Id: I94fa432c219bda21c1126976bb60e5292760092e
* Remove uses of TextBuiltin.out in favor of outwRobin Rosenberg2012-09-233-14/+18
| | | | | | | These came from patches in review in parallel with the introduction of the exception throwing print writer. Change-Id: I1c27fa276eb1fcf12ad19792049c35cb52518c16
* The constructor CmdLineException(String) is deprecatedTomasz Zarna2012-09-236-20/+36
| | | | | | | | | | Use CmdLineException(CmdLineParser, String) instead. The new constructor has been added in args4j 2.0.12, so in pom.xml that would be the minimum version. Set the upper boundary in pom.xml to 2.1.0 (exclusive), just like in the MANIFEST.MF. Change-Id: If45d809e4ffa11a3572d958ce121422fb03cf8f3 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Suppress boxing warnings where we know they are okRobin Rosenberg2012-09-2211-26/+58
| | | | | | | | | Invoke the wrapper types' valueOf via static imports. For booleans used in asserts, add a new assert in the JUnit utility package since out current version of JUnit does not have the assert(boolean, boolean) method. Change-Id: I9099bd8efbc8c133479344d51ce7dabed8958a2b
* Prepare 2.2.0 buildsMatthias Sohn2012-09-193-31/+31
| | | | | Change-Id: I386ba70541d644e58661d26713b309371e0f9257 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add tests for output result of merging -- org.eclipse.jgit.pgm.MergeTomasz Zarna2012-09-173-1/+5
| | | | Change-Id: I888c7e80503b869d65a9617e6a07e01d1ff5f197
* Check for write errors in standard out and exit with errorRobin Rosenberg2012-09-1639-220/+263
| | | | | | | | | | | | | The underlying problem is that System.out is a PrintWriter and as such it does not throw exceptions on error, but rather just sets a flag and continues. This changes replaces the use of System.out with a PrintWriter-like writer that does not catch error, but instead throw them to the caller. Bug: 366243 Change-Id: I44405edc4416e943b87f09a0f6ed041c6c51b046
* Added new Status CLI command 'jgit status'Robin Rosenberg2012-09-094-2/+213
| | | | | | | | | | | | | This is a first basic implementation that displays current branch and list of files of various status, but isn't as refined as its native counterpart (e.g. does not say if we're ahead or behind the remote). It's been helpful in the diagnostic of bug #347885. Bug: 348318 CQ: 6769 Change-Id: Ifc35da608fbba652524c1b5b522e3c0d5369ad5e Signed-off-by: François Rey <eclipse.org@francois.rey.name> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Output result of switching branch -- o.e.jgit.pgm.CheckoutTomasz Zarna2012-09-053-4/+50
| | | | Change-Id: I9829950b686ce3b8c70b8f7a1774d5e2b55cd00a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix NPE when notes are presentRobin Rosenberg2012-09-051-1/+1
| | | | Change-Id: If9200ae4a7f582a5562aecf323ff0430ba154583 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Garbage collector for FileRepositoriesChristian Halstrick2012-07-292-0/+59
| | | | | | | | | | | | | | | | | | | | | Implements a garbage collector for FileRepositories. Main ideas are copied from the garbage collector for DFS based repos (DfsGarbageCollector). Added functionalities are - pruning loose objects - handling of the index - packing refs - handling of reflogs (objects referenced from reflog will not be pruned/) These are features of a GC which are not handled in this change and which should come with subsequent changes: - unpacking packed objects into loose objects (to support that pruning packed objects doesn't delete them until they are older than two weeks) - expiration of reflogs - support for configuration parameters (e.g. gc.pruneExpire) Change-Id: I14ea5cb7e0fd1b5c50b994fd77f4e05bfbb9d911 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* show: Implement command line show for any objectShawn O. Pearce2012-07-184-1/+322
| | | | | | Change-Id: I4dea84428d48b3de0e187c510b766f965323b21b Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Typo in CLIText#unknownMergeStratey, should be #unknownMergeStrategyTomasz Zarna2012-07-143-3/+3
| | | | | Change-Id: I4d4aa59723d6422ff755165e45f368da76d309ab Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Prepare 2.1.0 buildsMatthias Sohn2012-06-143-30/+30
| | | | Change-Id: I4aad3efdd435d8d5eb53c84a8d38132acce97c25 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare post v2.0.0.201206130900-r buildsMatthias Sohn2012-06-143-3/+3
| | | | Change-Id: I51b1bbed35288c5285b3d6860efba97d58de5a1c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v2.0.0.201206130900-rv2.0.0.201206130900-rMatthias Sohn2012-06-133-3/+3
| | | | | Change-Id: I685e09b3e37d68614df1b5cc5f687a65cd6eb82d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add org.eclipse.jgit.pgm.feature to enable consumption via p2Matthias Sohn2012-06-122-0/+58
| | | | | | | | | | Orion wants to consume the pgm bundle from a p2 repository in their build. Also add corresponding source bundle and feature to provision sources via a target platform. Bug: 373789 Change-Id: I0016ee155553c546606b63d310666eb10bd997e1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare next 2.0.0-SNAPSHOT buildsMatthias Sohn2012-06-062-2/+2
| | | | Change-Id: I0d55b390502b3da139ab0d15a6cf3d05774d8ad9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v2.0.0.201206060730-rc3v2.0.0.201206060730-rc3Matthias Sohn2012-06-062-2/+2
| | | | | Change-Id: I12f8800b74228e71c77f0fb82c250c154d06369f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare next 2.0.0-SNAPSHOT buildsMatthias Sohn2012-05-312-2/+2
| | | | Change-Id: Iffc57d6b25dafb72272d1957116c19ab45ba2c54 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v2.0.0.201205301645-rc2v2.0.0.201205301645-rc2Matthias Sohn2012-05-302-2/+2
| | | | | Change-Id: Ic4f84f1a11c93863c229c0089f2e4edc7c7a36b7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add config --list command to pgmTomasz Zarna2012-05-233-0/+123
| | | | | | | Currently, only --list option is supported with --global, --system, --local and --file switches. Change-Id: I9b179b162996520e95c4e001dccd65c566a4bd27 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add user friendly output from jgit commit commandMikael Karlsson2012-05-181-1/+6
| | | | | | | | Instead of printing the stack trace from the JGitInternalException thrown from CommitMessage.call(), print just the exception message, using the Die exception. Change-Id: I9ec3eb02eb001813fa15ac6f90a606223dcdafdc
* Add --all switch to org.eclipse.jgit.pgm.CommitTomasz Zarna2012-05-103-2/+11
| | | | | Change-Id: Iab52f995676daf60e0dfa043cc9e022f6e32a758 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Fix two typos in CLIText.propertiesTomasz Zarna2012-05-021-2/+2
| | | | Change-Id: Id1429d52c88a9e2b888e6c6906cf8148945bd2ca
* Fix broken TagCommand APIRobin Rosenberg2012-04-061-4/+5
| | | | | | | | Tags can be un-annotated whereby there is no RevTag object, only a ref pointing to the tagged object. Bug: 360650 Change-Id: I06309c45c0a896fe2a0a874700febf78c9fb87e8
* Merge changes Ic0ee9c08,Ia3e82682,I8d8ab547,I8f2cd0a0,I45823b0c,Ie22ac47eShawn Pearce2012-03-122-3/+3
|\ | | | | | | | | | | | | | | | | | | * changes: cleanup: Silence an unused-parameter warning cleanup: Get rid of some unused-warnings cleanup: Remove unused parameter in ConsoleCredentialsProvider cleanup: Drop unused parameter on DhtPackParser cleanup: Remove unneeded parameter to private method in RefUpdateTest cleanup: Remove unnecessary @SuppressWarnings
| * cleanup: Get rid of some unused-warningsRobin Rosenberg2012-03-092-3/+3
| | | | | | | | Change-Id: Ia3e82682781c6b5bc3141b3e27db67b93c3162cd
* | Export all packages from org.eclipse.jgit.pgmTomasz Zarna2012-03-071-1/+4
|/ | | | Change-Id: I90565c8626aa5ab58ed3ff1dafa8bd21c9a79c62
* Prepare 2.0.0-SNAPSHOT buildsMatthias Sohn2012-02-162-25/+25
| | | | | Change-Id: I946e315af04227727ac937ebe9d70ae1ea4e8936 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Allow to list tags with org.eclipse.jgit.pgm.Tag"Robin Rosenberg2012-01-251-7/+20
|\
| * Allow to list tags with org.eclipse.jgit.pgm.TagTomasz Zarna2011-12-021-7/+20
| | | | | | | | Change-Id: I79c284a720935814aef9767156106833f983bb8b
* | Merge branch 'stable-1.2'Matthias Sohn2011-12-262-0/+100
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-1.2: JGit v1.2.0.201112221803-r Expose unmerged paths when revert fails Enforce the use of Java5 API:s only (with a few exceptions) Change-Id: Ib18d41a65e68cc47fb63114fcce27a16820d0692 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v1.2.0.201112221803-rv1.2.0.201112221803-rstable-1.2Matthias Sohn2011-12-232-2/+2
| | | | | | | | | | | | | | | Change-Id: Icc0b09324f205d93929af8cf522a99ad00cf7591 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Enforce the use of Java5 API:s only (with a few exceptions)Robin Rosenberg2011-12-162-0/+100
| |/ | | | | | | | | | | | | | | | | | | | | | | This only works with Eclipse 3.6 and newer and requires installation of new package. Documentation is not very good, but there is a blog about it here: http://eclipseandjazz.blogspot.com/2011/10/of-invalid-references-to-system.html API checking is especially useful on OS X where Java5 is not readily available. Change-Id: I3c0ad460874a21c073f5ac047146cbf5d31992b4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>