Commit Graph

235 Commits

Author SHA1 Message Date
Robin Rosenberg 81fa566295 Suppress resource warnings with Java 7
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
2012-10-25 15:17:23 -07:00
Tomasz Zarna e8c25a1738 Add --squash option to org.eclipse.jgit.pgm.Merge
Change-Id: Ifd20b6f4731cfa71319145cac7b464aa53db18b8
2012-10-07 23:38:34 +02:00
Shawn O. Pearce 31261b5c2f Revert "The constructor CmdLineException(String) is deprecated"
This reverts commit 07f9936257.

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
2012-09-26 10:20:42 -07:00
Robin Rosenberg 7de1154d21 Remove uses of TextBuiltin.out in favor of outw
These came from patches in review in parallel with the introduction
of the exception throwing print writer.

Change-Id: I1c27fa276eb1fcf12ad19792049c35cb52518c16
2012-09-23 23:00:35 +02:00
Tomasz Zarna 07f9936257 The constructor CmdLineException(String) is deprecated
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>
2012-09-23 10:49:50 +02:00
Robin Rosenberg c3f1fac03f Suppress boxing warnings where we know they are ok
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
2012-09-22 01:21:00 +02:00
Matthias Sohn 4b3c0f8aba Prepare 2.2.0 builds
Change-Id: I386ba70541d644e58661d26713b309371e0f9257
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-09-19 09:10:12 +02:00
Tomasz Zarna f7b644df66 Add tests for output result of merging -- org.eclipse.jgit.pgm.Merge
Change-Id: I888c7e80503b869d65a9617e6a07e01d1ff5f197
2012-09-17 07:07:00 -07:00
Robin Rosenberg caa362f20d Check for write errors in standard out and exit with error
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
2012-09-16 11:12:47 -07:00
Robin Rosenberg 5f094154dd Added new Status CLI command 'jgit status'
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>
2012-09-09 21:10:59 +02:00
Tomasz Zarna e44c3e7139 Output result of switching branch -- o.e.jgit.pgm.Checkout
Change-Id: I9829950b686ce3b8c70b8f7a1774d5e2b55cd00a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-09-05 07:59:37 +02:00
Robin Rosenberg f590a4c667 Fix NPE when notes are present
Change-Id: If9200ae4a7f582a5562aecf323ff0430ba154583
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-09-05 07:42:12 +02:00
Christian Halstrick 4c3f017a77 Garbage collector for FileRepositories
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>
2012-07-29 15:43:50 +02:00
Shawn O. Pearce 189a01b617 show: Implement command line show for any object
Change-Id: I4dea84428d48b3de0e187c510b766f965323b21b
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2012-07-18 00:31:47 +02:00
Tomasz Zarna 75b60afe41 Typo in CLIText#unknownMergeStratey, should be #unknownMergeStrategy
Change-Id: I4d4aa59723d6422ff755165e45f368da76d309ab
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2012-07-14 15:15:31 +02:00
Matthias Sohn 9000351909 Prepare 2.1.0 builds
Change-Id: I4aad3efdd435d8d5eb53c84a8d38132acce97c25
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-14 00:45:13 +02:00
Matthias Sohn 2f27d5ae12 Prepare post v2.0.0.201206130900-r builds
Change-Id: I51b1bbed35288c5285b3d6860efba97d58de5a1c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-14 00:19:30 +02:00
Matthias Sohn aacd4f721b JGit v2.0.0.201206130900-r
Change-Id: I685e09b3e37d68614df1b5cc5f687a65cd6eb82d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-13 15:03:59 +02:00
Matthias Sohn 4974090d33 Add org.eclipse.jgit.pgm.feature to enable consumption via p2
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>
2012-06-12 18:10:04 +02:00
Matthias Sohn f2d9a5ed31 Prepare next 2.0.0-SNAPSHOT builds
Change-Id: I0d55b390502b3da139ab0d15a6cf3d05774d8ad9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-06 13:57:32 +02:00
Matthias Sohn 1cb135ebfb JGit v2.0.0.201206060730-rc3
Change-Id: I12f8800b74228e71c77f0fb82c250c154d06369f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-06 13:27:54 +02:00
Matthias Sohn 9bd9d9a698 Prepare next 2.0.0-SNAPSHOT builds
Change-Id: Iffc57d6b25dafb72272d1957116c19ab45ba2c54
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-31 01:39:57 +02:00
Matthias Sohn 4aa550f7cc JGit v2.0.0.201205301645-rc2
Change-Id: Ic4f84f1a11c93863c229c0089f2e4edc7c7a36b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-30 23:08:15 +02:00
Tomasz Zarna 23e0a3e734 Add config --list command to pgm
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>
2012-05-23 16:35:08 +02:00
Mikael Karlsson 15147a273f Add user friendly output from jgit commit command
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
2012-05-18 22:07:50 +02:00
Tomasz Zarna 94285e691a Add --all switch to org.eclipse.jgit.pgm.Commit
Change-Id: Iab52f995676daf60e0dfa043cc9e022f6e32a758
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-05-10 18:31:33 -07:00
Tomasz Zarna e5633ba2d3 Fix two typos in CLIText.properties
Change-Id: Id1429d52c88a9e2b888e6c6906cf8148945bd2ca
2012-05-02 11:35:13 +02:00
Robin Rosenberg fd53b454f2 Fix broken TagCommand API
Tags can be un-annotated whereby there is no RevTag object, only
a ref pointing to the tagged object.

Bug: 360650
Change-Id: I06309c45c0a896fe2a0a874700febf78c9fb87e8
2012-04-06 00:52:20 +02:00
Shawn Pearce 0a69f05647 Merge changes Ic0ee9c08,Ia3e82682,I8d8ab547,I8f2cd0a0,I45823b0c,Ie22ac47e
* 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
2012-03-12 10:16:42 -04:00
Robin Rosenberg 66e8cd4eec cleanup: Get rid of some unused-warnings
Change-Id: Ia3e82682781c6b5bc3141b3e27db67b93c3162cd
2012-03-09 13:30:20 +01:00
Tomasz Zarna c638f72b41 Export all packages from org.eclipse.jgit.pgm
Change-Id: I90565c8626aa5ab58ed3ff1dafa8bd21c9a79c62
2012-03-07 18:41:45 +01:00
Matthias Sohn 755dfdb409 Prepare 2.0.0-SNAPSHOT builds
Change-Id: I946e315af04227727ac937ebe9d70ae1ea4e8936
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-02-16 00:49:49 +01:00
Robin Rosenberg 9673ae18ce Merge "Allow to list tags with org.eclipse.jgit.pgm.Tag" 2012-01-25 13:10:15 -05:00
Matthias Sohn 067ccbfda7 Merge branch 'stable-1.2'
* 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>
2011-12-26 23:52:32 +01:00
Matthias Sohn a069e90fa9 JGit v1.2.0.201112221803-r
Change-Id: Icc0b09324f205d93929af8cf522a99ad00cf7591
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-23 00:19:02 +01:00
Tomasz Zarna 8c60468ff4 Allow to amend commits with JGit CLI
Change-Id: I0e8d365b56e079ac4ccece7fcf80ea140c319c78
2011-12-18 16:28:44 +01:00
Robin Rosenberg 0ca105a502 Enforce the use of Java5 API:s only (with a few exceptions)
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>
2011-12-16 01:01:36 +01:00
Matthias Sohn 7fded4d14f Prepare 1.3.0 builds
Change-Id: I7a1ae73783c95041b59f047a7330e62e7f642149
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-10 01:07:16 +01:00
Robin Rosenberg 9ffbe444f8 Force jgit.sh to use UTF-8 encoding on Mac
For some obscure reason the platform encodng in Java on Macs
is MacRoman. OS X used UTF-8 as the default encoding so set
the encoding property in jgit.sh.

Change-Id: I08182c2f8512f799178cee70bcc28d6ee2b9c2b0
2011-12-07 00:44:46 +01:00
Tomasz Zarna 7017c697fa Allow to list tags with org.eclipse.jgit.pgm.Tag
Change-Id: I79c284a720935814aef9767156106833f983bb8b
2011-12-02 14:25:48 +01:00
Robin Rosenberg 6baf0cb956 Make use of the many date formatting options in the log command
Change-Id: I30f1049fce086f2cf7e39ba3ad8b335df3a7b827
2011-10-26 23:15:24 +02:00
Robin Rosenberg 06b183f9b7 Add a method to SystemReader to get the time zone
Change-Id: Ifd31f408ed2c5b7869694b715fea3219e74963ef
2011-10-20 23:49:51 +02:00
Robin Rosenberg 51d95bbaea Merge "Document the show methods of RevWalkTextBuiltin" 2011-09-22 12:27:48 -04:00
Robin Rosenberg 8a45aa460c Merge "Fix a boxing warning in org.eclipse.jgit.pgm.RevWalkTextBuiltin" 2011-09-22 12:27:27 -04:00
Robin Rosenberg eb8431da75 Document the show methods of RevWalkTextBuiltin
Change-Id: Ic704008cb215e1437c0a3fd1aec3aa38209ef3c7
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2011-09-18 13:08:14 +02:00
Robin Rosenberg edaca7ed12 Fix a boxing warning in org.eclipse.jgit.pgm.RevWalkTextBuiltin
Change-Id: Ia154da79926ce25731e856bed264dd19a76bc1f1
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2011-09-18 13:08:03 +02:00
Matthias Sohn 19a366d532 Prepare 1.2.0 builds
Change-Id: I9ec247135d93ef28d732e94f18d0ec1d0e2e6d44
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-09-15 22:51:46 +02:00
Matthias Sohn 57d6585522 Prepare post v1.1.0.201109151100-r build
Change-Id: Ib099ec93d8243b238641d79328216874532ab5eb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-09-15 21:51:23 +02:00
Matthias Sohn 1cb0510cee JGit v1.1.0.201109151100-r
Change-Id: Iadcec7e5973600e005cbdeb837fa197d3ae2ea86
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-09-15 17:32:58 +02:00
Matthias Sohn b09d21b6eb Prepare post v1.1.0.201109071825-rc3 builds
Change-Id: I1244f6639263d156a6f9e4530167e5eb1826a535
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-09-08 01:50:41 +02:00