summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
Commit message (Collapse)AuthorAgeFilesLines
* Remove further unnecessary 'final' keywordsHan-Wen Nienhuys2018-05-1820-48/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove it from * package private functions. * try blocks * for loops this was done with the following python script: $ cat f.py import sys import re import os def replaceFinal(m): return m.group(1) + "(" + m.group(2).replace('final ', '') + ")" methodDecl = re.compile(r"^([\t ]*[a-zA-Z_ ]+)\(([^)]*)\)") def subst(fn): input = open(fn) os.rename(fn, fn + "~") dest = open(fn, 'w') for l in input: l = methodDecl.sub(replaceFinal, l) dest.write(l) dest.close() for root, dirs, files in os.walk(".", topdown=False): for f in files: if not f.endswith('.java'): continue full = os.path.join(root, f) print full subst(full) Change-Id: If533a75a417594fc893e7c669d2c1f0f6caeb7ca Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
* Remove 'final' in parameter listsHan-Wen Nienhuys2018-05-1528-56/+56
| | | | | Change-Id: Id924f79c8b2c720297ebc49bf9c5d4ddd6d52547 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
* Bazel: Add a target to build jgit commandline toolJonathan Nieder2018-05-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This works well enough for basic testing, especially the "jgit daemon" command: $ bazel build org.eclipse.jgit.pgm:jgit INFO: Analysed target //org.eclipse.jgit.pgm:jgit (39 packages loaded). INFO: Found 1 target... Target //org.eclipse.jgit.pgm:jgit up-to-date: bazel-bin/org.eclipse.jgit.pgm/jgit.jar bazel-bin/org.eclipse.jgit.pgm/jgit INFO: Elapsed time: 15.862s, Critical Path: 14.74s INFO: 42 processes: 32 linux-sandbox, 1 local, 9 worker. INFO: Build completed successfully, 60 total actions $ bazel-bin/org.eclipse.jgit.pgm/jgit rev-list HEAD^..HEAD 2>/dev/null e5ed926e02dd29b5e970d421b63b6921cc1800f5 Still to do: - suppress "Failed to load class "org.slf4j.impl.StaticLoggerBinder" output - add org.eclipse.jgit.pgm.test tests to bazel build - supply package information so that "jgit version" can work Change-Id: Ie89872839fa5aae974d5d39b6776b96332b0e83f
* Rename RefDatabase#getAllRefs to getRefsJonathan Nieder2018-04-295-7/+5
| | | | | | | | | | | | | | | This is easier to type and makes it clearer that it only returns refs and not the pseudo-refs returned by getAdditionalRefs. It also puts us in a better position to add a method to the Repository class later that delegates to this one without colliding with the existing Repository#getAllRefs method that returns a Map<String, Ref>. While at it, clarify the javadoc of getRefs and hasRefs to make the same point. Suggested-by: David Pursehouse <david.pursehouse@gmail.com> Change-Id: I23497c66ac7b5e0c987b91efbc9e9cc29924ca66 Signed-off-by: Jonathan Nieder <jrn@google.com>
* RefDatabase: add hasRefs convenience methodDavid Pursehouse2018-04-291-1/+1
| | | | | | | | | | | | | | | | | Callers can now say: db.getRefDatabase().hasRefs() rather than the more verbose: !db.getRefDatabase().getAllRefs().isEmpty() The default implementation simply uses getAllRefs().isEmpty(), but a derived class could possibly override the method with a more efficient implementation. Change-Id: I5244520708a1a7d9adb351f10e43fc39d98e22a1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* RefDatabase: Introduce getAllRefs methodDavid Pursehouse2018-04-275-15/+6
| | | | | | | | | | | | Currently to get all refs, callers must use: getRefsByPrefix(ALL) Introduce getAllRefs, which does this, and migrate all existing callers of getRefsByPrefix(ALL). Change-Id: I7b1687c162c8ae836dc7db3ccc7ac847863f691d Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Remove trivial cases of using deprecated RefDatabase.getRefs()Matthias Sohn2018-04-255-19/+14
| | | | Change-Id: I2d3e426a3391923f8a690ac68fcc33851f3eb419 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Configure WindowCache settings to use in JGit CLIMatthias Sohn2018-04-131-0/+10
| | | | | | | Set the same defaults as in EGit. Use mmap to map git packfiles into memory. Change-Id: I7997b9123448a762192d7eeb55e01432549fba98 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix API problem filter warningsMatthias Sohn2018-03-251-0/+11
| | | | | | | | Silence warnings for bundles which haven't broken API since 4.11 but we increased major version to 5 since we always use the same version for all jgit bundles Change-Id: If4f9a6aa4ef21f9b511946c5fc4bd7c0af6094c4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* ShowPackDelta: Refactor to use try-with-resourceDavid Pursehouse2018-03-141-7/+8
| | | | | | | | Remove the resource warning suppression and refactor the code to open the TemporaryBuffer and InflaterInputStream in a try-with-resource. Change-Id: I3082e5ac7565c5000d5a4364f750dd0a0952fc6e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* CommandCatalog: Simplify scan method using try-with-resourceDavid Pursehouse2018-03-131-21/+4
| | | | | | | | | The IOExceptions caught in the nested try blocks are all ignored, so we can just wrap them all up into a single try-with-resource block. Change-Id: Id85850b3f54c408af73063220e6fead20cb0fd80 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Open auto-closeable resources in try-with-resourceDavid Pursehouse2018-03-132-12/+4
| | | | | | | | | | | | | | | | | | | | When an auto-closeable resources is not opened in try-with-resource, the warning "should be managed by try-with-resource" is emitted by Eclipse. Fix the ones that can be silenced simply by moving the declaration of the variable into a try-with-resource. In cases where we explicitly call the close() method, for example in tests where we are testing specific behavior caused by the close(), suppress the warning. Leave the ones that will require more significant refcactoring to fix. They can be done in separate commits that can be reviewed and tested in isolation. Change-Id: I9682cd20fb15167d3c7f9027cecdc82bc50b83c4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Implement --force option in FetchCommand and CLI fetch commandMatthias Sohn2018-03-132-0/+7
| | | | Change-Id: I42cdb57b8fb54ce466d1958391f12f911045327f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Consistently use Constants.CHARSET rather than StandardCharsets.UTF_8David Pursehouse2018-03-114-9/+9
| | | | | Change-Id: I6714fc3666e1bced22abba94ceb700477349586e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Prepare 5.0.0-SNAPSHOT buildsMatthias Sohn2018-03-083-46/+46
| | | | | Change-Id: I2d2f50ed8a12f310e7cac68eed5536bd460c403f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.11.1-SNAPSHOT buildsMatthias Sohn2018-03-083-46/+46
| | | | | Change-Id: Id9aa6b7e8f56de5183b6cd57ef0e790ec9debd4d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.11.0.201803080745-rv4.11.0.201803080745-rMatthias Sohn2018-03-083-4/+4
| | | | | Change-Id: Ie24a33bc8a24c30db06fe7b175f405efb95776ec Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* CommandCatalog: Use StandardCharsets.UTF_8David Pursehouse2018-03-071-1/+3
| | | | | Change-Id: I7c3356335cfedd81f663fd528799fc57b95fcf0f Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* DiffAlgorithms: Open Repository in try-with-resourceDavid Pursehouse2018-03-061-4/+1
| | | | | Change-Id: I67cb486283213f8aa964333533c55966518baa36 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* AmazonS3Client: Open Input/OutputStream in try-with-resourceDavid Pursehouse2018-03-051-15/+8
| | | | | Change-Id: I32d4031159dff9005e839d0b53940431cba12beb Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Enable warning for resources not managed by try-with-resourceDavid Pursehouse2018-03-031-1/+1
| | | | | Change-Id: Iefe97de6bdb62af558f1b0e77c9205a9186f9b4c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* LFS: Enable LFS support for the CLI, better error handlingMarkus Duft2018-03-031-0/+3
| | | | | | | | | | Enable LFS support for the CLI by registering the according filters. Errors during filter creation must be propagated up the call stack, as a failure to create a filter should be treated as fatal if the filter is required. Change-Id: I3833757839bdda97cd01b6c21c1613d199e2692d Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
* LFS: support merge/rebase/cherry-pick/diff/compare with LFS filesMarkus Duft2018-03-031-4/+2
| | | | | | | | | | | | Respect merge=lfs and diff=lfs attributes where required to replace (in memory) the content of LFS pointers with the actual blob content from the LFS storage (and vice versa when staging/merging). Does not implement general support for merge/diff attributes for any other use case apart from LFS. Change-Id: Ibad8875de1e0bee8fe3a1dffb1add93111534cae Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Progress reporting for checkoutMarkus Duft2018-01-231-1/+3
| | | | | | | | | | | | | | The reason for the change is LFS: when using a lot of LFS files, checkout can take quite some time on larger repositories. To avoid "hanging" UI, provide progress reporting. Also implement (partial) progress reporting for cherry-pick, reset, revert which are using checkout internally. The feature is also useful without LFS, so it is independent of it. Change-Id: I021e764241f3c107eaf2771f6b5785245b146b42 Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.11.0-SNAPSHOT buildsMatthias Sohn2017-12-313-46/+46
| | | | | Change-Id: I5d5e2befcf530d93457d44684bd9e4fc2392e5eb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add header Automatic-Module-Name for Java 9Karsten Thoms2017-12-231-0/+1
| | | | | | Bug: 529075 Change-Id: I4532ce2c80eb91531d46026676502d636ccda706 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Remove redundant @SuppressWarnings("unused")David Pursehouse2017-12-181-1/+1
| | | | | | | These are now redundant since the parameters have javadoc. Change-Id: I6bfde267e1712ee35871c30c8203c3b4dc5e136a Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* PathTreeFilterHandler: Remove unused importDavid Pursehouse2017-12-181-1/+0
| | | | | Change-Id: I7a91210dcb775d0c9b46772f8ff3d84196ba3b10 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Fix javadoc in org.eclipse.jgit.pgmMatthias Sohn2017-12-1876-42/+329
| | | | Change-Id: I74616f6e8ef69bef4db2f13a9b47ddf57714fd1f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-4.9'David Pursehouse2017-12-071-1/+1
|\ | | | | | | | | | | | | | | * stable-4.9: LfsStore: Make inner class AppServer static DirCacheCheckout#processEntry: Fix typo in javadoc Change-Id: Id8e4a3c4dc741e6e0182522e72ecb4b34ae419eb
| * LfsStore: Make inner class AppServer staticDavid Pursehouse2017-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | FindBugs reports: This class is an inner class, but does not use its embedded reference to the object which created it. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made static. Change-Id: I245e44678166176de0cfb275e22ddd159f88e0bd Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * Prepare 4.9.2-SNAPSHOT buildsMatthias Sohn2017-12-033-46/+46
| | | | | | | | Change-Id: I5879ad4aee94ff6783b5589728912117f2495dd3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v4.9.1.201712030800-rv4.9.1.201712030800-rMatthias Sohn2017-12-033-4/+4
| | | | | | | | | | Change-Id: I8bf477778c9dac41cb65233a9e7d590531a836b7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge branch 'stable-4.9'Matthias Sohn2017-11-241-1/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Ignore warning for minor version change without API change Silence boxing warning Prepare 4.5.5-SNAPSHOT builds JGit v4.5.4.201711221230-r Fix LockFile semantics when running on NFS Honor trustFolderStats also when reading packed-refs Prepare 4.5.4-SNAPSHOT builds JGit v4.5.3.201708160445-r Change-Id: Icc33d2e36f140e8714fce088379673a8834ae9de
| * Ignore warning for minor version change without API changeMatthias Sohn2017-11-241-1/+11
| | | | | | | | | | | | | | | | - this is a new warning option in Eclipse 4.7 and higher - we always change version of all bundles in a release to keep release engineering simple Change-Id: Ic7523d77b67b2802f1bab3bc70af250d712a034f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge branch 'stable-4.9'David Pursehouse2017-11-202-1/+4
|\| | | | | | | | | | | | | | | | | | | * stable-4.9: Fix NPE in TransportGitSsh.ExtSession.exec() Add missing help text for rev-parse's --verify option Remove final modifier on args4j argument field in RevParse Change-Id: I5ac9e2f185f2210ee76970501710b99b12e93e75 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * Add missing help text for rev-parse's --verify optionMatthias Sohn2017-11-191-0/+3
| | | | | | | | Change-Id: I3345f52e0c2a555e4c5edb7effe4be4af4cca10a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Remove final modifier on args4j argument field in RevParseRĂ¼diger Herrmann2017-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Args4J does no longer allow to use final fields to reference arguments or options [1]. Change RevParse to be compatibel with this change. [1] https://github.com/kohsuke/args4j/commit/6e11f89d40dcc518c0e5eb9eef5d74f05d58e6af See-also: a0558b709448cea01cc0725fff73408d9b223c72 Signed-off-by: RĂ¼diger Herrmann <ruediger.herrmann@gmx.de> Change-Id: I33b233f195c06855d9e094c8c9ba804fbe7b1438
| * Prepare 4.9.1-SNAPSHOT buildsMatthias Sohn2017-10-083-46/+46
| | | | | | | | | | Change-Id: Ic49fd093d3fe4324c4d83aba74033040fcaa37a6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v4.9.0.201710071750-rv4.9.0.201710071750-rMatthias Sohn2017-10-073-4/+4
| | | | | | | | | | Change-Id: I487f6aa3d0c4ef1d57f91cdc36177d994ae24c51 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Prepare 4.10.0-SNAPSHOT buildsMatthias Sohn2017-10-083-46/+46
|/ | | | | Change-Id: I5ca462d1db18a2c5c9382cfb9c83972510fa2b88 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Checkout now reports failures through exceptions.Ned Twigg2017-10-011-8/+12
| | | | | | | | | | | Checkout sometimes throws an exception, and other times it writes an error message to outw and returns normally, even though the command failed. This commit now reports all failures through a die() exception. Change-Id: I038a5d976d95020fea3faac68e9178f923c25b28 Signed-off-by: Ned Twigg <ned.twigg@diffplug.com>
* Added API to TextBuiltin for piped usage.Ned Twigg2017-09-211-0/+33
| | | | | | | | | | Added a public method to TextBuiltin which makes it possible for clients to initialize all of its state, including output and error streams. This gives clients the ability to customize the way in which a command is run. Change-Id: If718236964d2c5cf869e120c74f1a12965f4812e Signed-off-by: Ned Twigg <ned.twigg@diffplug.com>
* Implement CommandRef.toString() to help debuggingMatthias Sohn2017-09-081-0/+8
| | | | Change-Id: If3ebed08c8f4e2cc925a97dbdd4c84410bc7c4a5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Stop using deprecated CmdLineException constructorsDavid Pursehouse2017-09-068-32/+75
| | | | | | | | | | | Instead of taking a String, the constructors now take a Localizable and a variable list of format arguments. Introduce a new Format helper class in CLIText, which implements the Localizable interface, and use it in place of raw Strings. Change-Id: I241eda16e242293ceb17b3c85ae5df85bd37c658 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* UntrackedFilesHandler: Fix non-localized stringDavid Pursehouse2017-09-063-2/+7
| | | | | Change-Id: Ida7b9ddc991515ab233763f2cb985853c9143a3c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Main: Replace deprecated ExampleMode with OptionHandlerFilterDavid Pursehouse2017-09-061-2/+3
| | | | | Change-Id: I1161a82269b7f093c00c9533ed8b99b7cca0a322 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Remove final modifier on args4j option or argument fieldsMatthias Sohn2017-09-054-8/+8
| | | | | | | | | Remove final field modifier since args4j does no longer allow use of final fields [1]. [1] https://github.com/kohsuke/args4j/commit/6e11f89d40dcc518c0e5eb9eef5d74f05d58e6af Change-Id: Ib3dee10828d87d6b558c2e90387eadd9aa2ce260 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Update args4j to 2.33Matthias Sohn2017-08-306-33/+16
| | | | | | | CQ: 11068 Change-Id: I7d52cddacff05477f646fda5f7b9f2de844922f6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Fix compilation errors with args4j 2.0.23 and laterRobin Stocker2017-08-3010-18/+16
| | | | | | | | | | The multiValued attribute on @Option was removed. When the field is a List, it's not actually needed (even with earlier versions of args4j), see RmTest. In other cases, we have a custom handler, where it's also not needed. Bug: 413163 Change-Id: I4bb951e9fab5f4ae4271bd7e11be799dc234ab80