summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Format lib/BUILD with buildifierDavid Pursehouse2018-12-021-1/+1
| | | | | Change-Id: I63db70e6e6f4da44a211621d8721ede66bce44bd Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Apache MINA sshd client: enable support for ed25519 keysThomas Wolf2018-12-021-0/+9
| | | | | | | | | | | | | | | Include the net.i2p.crypto.eddsa bundle via a hard dependency. Add tests for dealing with ed25519 host keys and user key files. Manual tests: fetching from git.eclipse.org with an ed25519 user key, and pushing this change itself using the same ed25519 key. Note that sshd 2.0.0 does not yet support encrypted ed25519 private keys. Bug: 541272 Change-Id: I7072f4014d9eca755b4a2412e19c086235e5eae9 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Fix running tests from bazelMatthias Sohn2018-11-281-0/+12
| | | | | | | | The new dependency to mockito for JDKHttpConnectionTest wasn't added for bazel test run. Change-Id: Ie967b7152340a0b3e05cced7eadfd40af78d9995 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Move SshTestGitServer to new bundle org.eclipse.jgit.junit.sshThomas Wolf2018-11-171-2/+2
| | | | | | | | | | | | | | | Create the bundle and move the SshTestGitServer there. Verified that the Eclipse build still works and ran JSchSshTest and ApacheSshTest as junit tests inside Eclipse. Update maven build and features to account for that. Verified by running full maven build including packaging. Update bazel build files to account for that. Verified by a clean-slate bazel build :all, followed by running the JSchSshTest and the ApacheSshTest via bazel. Change-Id: Ia084942f4425b454529de148e00417e7da786a90 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Format BUILD files with buildifierDavid Pursehouse2018-11-131-2/+2
| | | | | Change-Id: I7eb83e0560b1826c4f8567e9bc5fbdb2ae3fe9d0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Apache MINA sshd clientThomas Wolf2018-11-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add a new ssh client implementation based on Apach MINA sshd 2.0.0. This implementation uses JGit's own config file parser and host entry resolver. Code inspection of the Apache MINA implementation revealed a few bugs or idiosyncrasies that immediately would re-introduce bugs already fixed in the past in JGit. Apache MINA sshd is not without quirks either, and I had to configure and override more than I had expected. But at least it was all doable in clean ways. Apache MINA boasts support for Bouncy Castle, so in theory this should open the way to using more ssh key algorithms, such as ed25519. The implementation is in a separate bundle and is still not used in the core org.eclipse.jgit bundle. The tests re-use the ssh tests from the core test bundle. Bug: 520927 Change-Id: Ib35e73c35799140fe050d1ff4fb18d0d3596580e Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Ssh tests with an Apache MINA sshd test git serverThomas Wolf2018-11-061-0/+18
| | | | | | | | | | | | | | | | Add a simple ssh git server based on Apache MINA sshd, and use it in new tests that verify ssh operations and in particular a number of bugs that had cropped up over time in JSch. The git server supports fetching only, and sftp access. The tests are all in an abstract base class; the concrete JschSshTest class only provides ssh-specific test setup. So the same tests could be run easily also with some other ssh client. Bug: 520927 Change-Id: Ide6687b717fb497a29fc83f22b07390a26dfce1d Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* pgm: Add missing dependency on commons-loggingJonathan Nieder2018-10-011-1/+0
| | | | | | | Without this, commands like "jgit repo" that use commons-logging fail. Change-Id: Ia78198c5e15ac4d6152d832ab2a2498f625486d2 Signed-off-by: Jonathan Nieder <jrn@google.com>
* Bazel: Use hyphen instead of underscore in external repository namesDavid Pursehouse2018-08-301-15/+15
| | | | | | | | | | | | | | Recent Bazel versions support the hyphen character in external repository names. On the Gerrit project, the repository names were harmonized to consistently use hyphen. As a side effect, it is no longer possible to build jgit from source in the gerrit tree, due to the different repository names. Rename the dependencies to use hyphens, consistent with gerrit. Change-Id: Ideebd858ddd3f0e6f765643001642dfb6c12441f Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* HttpClientConnection.getHeaderFields should support multiple values for same ↵Gabriel Couto2018-07-231-0/+1
| | | | | | | | header Bug: 537166 Change-Id: I1ba645968efe01a88f2484f030b7572228ba169c Signed-off-by: Gabriel Couto <gmcouto@gmail.com>
* Declare LFS dependency on GSON for Bazel buildHan-Wen Nienhuys2018-02-191-1/+4
| | | | | Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: Ia017dd5651756c3b80f18b908fb28ba56b6cbf14
* Add com.jcraft.jzlib 1.1.1Matthias Sohn2018-01-041-0/+9
| | | | | | | | | | com.jcraft.jsch requires com.jcraft.jzlib to provide optional zlib packet compression support. Add this library so that jgit can handle packet compression. CQ: 15292 Bug: 529129 Change-Id: I0297bd0488753547a5f5d47dbf0db508a79dd265 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add dependency to jsch for OpenSshConfigTest to bazel buildThomas Wolf2017-08-311-1/+4
| | | | | | Make jsch visible to the test bundle and add the dependency. Change-Id: I0c49ee9b8f64fe8a8c74d2f08865917eb33069b4 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Format BUILD files with buildifierDavid Pursehouse2017-08-181-3/+3
| | | | | Change-Id: I5e2a286866b63a8fa2bd29cc2fe432fab2bbe0af Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* bazel: Consume hamcrest through transitive dependencyDavid Ostrovsky2017-03-231-16/+4
| | | | | | | | | In I3ab958ce8 explicit dependency in lib/BUILD were defined and most of the bazel build implementation was switched to using it. Switch test.bzl test implementation to using explicit dependencies as well. Change-Id: I4413d1a45addeeb2a980d07669fa034c2eebb3a4 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* Remove Buck buildDavid Pursehouse2017-03-222-190/+0
| | | | | | Buck will be replaced with Bazel Change-Id: I3cf07d7aaaa2a58bac34e16c50af5416693254ac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add remaining parts of the bazel buildDavid Ostrovsky2017-03-211-2/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add bazel build for ui and junit.http, and the test packages. A number of different test labels are supported: api attributes dfs diff http lfs lfs-server nls notes pack patch pgm reftree revplot revwalk storage submodule symlinks transport treewalk util To run all tests: bazel test //... To run specific tests, using labels: bazel test --test_tag_filters=api,dfs,revplot,treewalk //... Change-Id: Ic41b05a79d855212e67b1b4707e9c6b4dc9ea70d Signed-off-by: David Ostrovsky <david@ostrovsky.org> Signed-off-by: Jonathan Nieder <jrn@google.com>
* bazel: Mark junit targets testonlyJonathan Nieder2017-03-191-1/+2
| | | | | | | | | | | Only testonly targets (such as tests) need to use junit. In particular this involves making the toplevel :all rule testonly. It's not clear to me what that rule is for --- "bazel build //..." already works to build all targets. In any case it appears to be for testing, so marking it as testonly shouldn't be harmful. Change-Id: I28ff508ab8ce2ec0a0111109110aa9680d30600e
* bazel: Add explicit targets for library dependenciesJonathan Nieder2017-03-191-0/+60
| | | | | | | | | | | | | | | | | | | | This provides a place to declare visibility restrictions and transitive dependencies for each library. Other targets should only declare dependencies on what they directly use, making dependencies easier to maintain. Trim the dependencies of org.eclipse.jgit:jgit to follow that rule. It declares dependencies on Apache httpcomponents and the servlet API but doesn't use them. Tested: * 'bazel build //...' succeeds * applying the change https://gerrit-review.googlesource.com/90843 to a copy of Gerrit, following the instructions there, and running 'bazel test //...' in that copy of Gerrit still succeeds Change-Id: I3ab958ce8b3227019cdbe4cc81e0f042e1541034
* Update Jetty to 9.4.1.v20170120 in buck buildJonathan Nieder2017-02-261-13/+13
| | | | | | | | | | | | | | | 5e8e2179b218ede7d14b69dc5149b0691b5859cf (Update Jetty to 9.4.1.v201470120, 2017-01-26) updated Jetty in the maven build. Update the buck build to match so buck builds work again. The buck build will go away soon, but in the meantime (until the bazel build gets the same level of support) it is convenient as a faster way of running tests than using maven. The bazel build doesn't need this change since it doesn't build or run http tests yet. Change-Id: Ibbdaf2880e76b32fc9f6b5605a2ff29e3deffda2
* Update JavaEWAH to 1.1.6Dave Borowitz2016-11-171-3/+3
| | | | | | | | Use Oxygen M3 Orbit repository which provides the bundles built using the new orbit-recipe based build. CQ: 11658 Change-Id: I7f3dcc966732b32830c75d5daa55383bd028d182 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Support LFS protocol and a file system based LFS storageMatthias Sohn2016-02-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement LfsProtocolServlet handling the "Git LFS v1 Batch API" protocol [1]. Add a simple file system based LFS content store and the debug-lfs-store command to simplify testing. Introduce a LargeFileRepository interface to enable additional storage implementation while reusing the same protocol implementation. At the client side we have to configure the lfs.url, specify that we use the batch API and we don't use authentication: [lfs] url = http://host:port/lfs batch = true [lfs "http://host:port/lfs"] access = none the git-lfs client appends the "objects/batch" to the lfs.url. Hard code an Authorization header in the FileLfsRepository.getAction because then git-lfs client will skip asking for credentials. It will just forward the Authorization header from the response to the download/upload request. The FileLfsServlet supports file content storage for "Large File Storage" (LFS) server as defined by the Github LFS API [2]. - upload and download of large files is probably network bound hence use an asynchronous servlet for good scalability - simple object storage in file system with 2 level fan-out - use LockFile to protect writing large objects against multiple concurrent uploads of the same object - to prevent corrupt uploads the uploaded file is rejected if its hash doesn't match id given in URL The debug-lfs-store command is used to run the LfsProtocolServlet and, optionally, the FileLfsServlet which makes it easier to setup a local test server. [1] https://github.com/github/git-lfs/blob/master/docs/api/http-v1-batch.md [2] https://github.com/github/git-lfs/tree/master/docs/api Bug: 472961 Change-Id: I7378da5575159d2195138d799704880c5c82d5f3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
* buck: run http testsMatthias Sohn2016-01-021-0/+56
| | | | | | | | | | Running tests using buck reveals that HttpClientTests are broken and weren't executed by Maven since these test classes don't match the maven-surefire-plugin's default for test classes **/*Test.java. Will be fixed in a follow-up change. Change-Id: I82a01b5fd3f0a930bec2423a29a256601dadc248 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* buck: run testsShawn Pearce2015-12-311-0/+27
| | | | | | | | | | | | Compile each test in its own java_test() target so they can run in parallel, reducing total time spent testing on large machines. $ buck test --all [-] PROCESSING BUCK FILES...FINISHED 0.3s [100%] [-] BUILDING...FINISHED 2.9s [100%] (351/383 JOBS, 351 UPDATED, 0.0% CACHE MISS) [-] TESTING...FINISHED 98.1s (3360 PASS/15 SKIP/0 FAIL) Change-Id: I8d6541268315089299f933ed23d785b1b3431133
* buck: build standalone jgit binaryShawn Pearce2015-12-311-0/+36
| | | | | | | | | | Construct the java_application JAR wrapped with the shell script header. This is enough to clone a repository over HTTPs: $ buck build :jgit_bin $ buck-out/gen/jgit_bin/jgit_bin clone https://... Change-Id: I4aceb4e77b2ec9be76a32ec93d94f2dafe9acce6
* Implement Buck driven buildDavid Ostrovsky2015-12-311-0/+62
Today there are plenty of modern build tool systems available in the wild (in no particular order): * http://bazel.io * https://pantsbuild.github.io * http://shakebuild.com * https://ninja-build.org * https://buckbuild.com The attributes, that all these build tools have in common, are: * reliable * correct * very fast * reproducible It must not always be the other build tool, this project is currently using. Or, quoting Gerrit Code Review maintainer here: "Friends, don't let friends use <the other build tool system>!" This change is non-complete implementation of JGit build in Buck, needed by Gerrit Code Review to replace its dependency with standlone JGit cell. This is very useful when a developer is working on both projects and is trying to integrate changes made in JGit in Gerrit. The supported workflow is: $ cd jgit $ emacs <hack> $ cd ../gerrit $ buck build --config repositories.jgit=../jgit gerrit With --config repositories.jgit=../jgit jgit cell is routed through JGit development tree. To build jgit, issue: $ buck build //:jgit [-] PROCESSING BUCK FILES...FINISHED 0,0s Yes, you can't measure no-op build time, given that Buck daemon is used. Change-Id: I301a71b19fba35a5093d8cc64d4ba970c2877a44 Signed-off-by: David Ostrovsky <david@ostrovsky.org>