aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Replace most usages of PacketLineIn.END with PacketLineIn.end()David Pursehouse2019-06-034-81/+95
| | | | | | | | | | | | | | PacketLineIn.END is only referenced in tests. Replace most of those with a new package visible end() method. Remaining usages of PacketLineIn.END are in the form: while ((line = pckIn.readString()) != PacketLineIn.END) { and are not trivial replacements, hence are not touched in this change. Change-Id: Id77c5321ddcad127130b246bde8f08736e60e1ea Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* PacketLineIn: Deprecate DELIM constantDavid Pursehouse2019-06-033-67/+81
| | | | | | | | | | | | | | Deprecate DELIM with the intention of making it private in a future release. Callers that want to test if a packet line string is the delimiter should use the isDelimiter(String) method. The only other references to DELIM in the JGit code are in tests. For those, introduce a package visible delimiter() method. Change-Id: I21e8bbac0ffb9ef710c9753e23435416b09a4891 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Replace trivial reference comparison of PacketLineIn.{DELIM,END}David Pursehouse2019-06-0214-66/+64
| | | | | | | | Replace reference comparisons of PacketLineIn's DELIM and END strings with usage of the helper methods isDelimiter() and isEnd(). Change-Id: I52dcfc4ee9097f1bd6970601c716701847d9eebd Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* PacketLineIn: Rename isDelim to isDelimiterDavid Pursehouse2019-06-022-2/+2
| | | | | Change-Id: I279808b8ddd8a9230a35582c00867b811633dfe8 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* ProtocolV2ParserTest: Fix typo in commentDavid Pursehouse2019-06-021-1/+1
| | | | | Change-Id: I22b07179ba6e2517ae3e178c31fde20987cead34 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Upgrade Bouncy Castle to 1.61Brandon Weeks2019-06-0114-100/+109
| | | | | | | | | | | | Also now use JcaKeyBoxBuilder constructor in BouncyCastleGpgKeyLocator.readKeyBoxFile(Path). CQ: 19868 CQ: 19869 CQ: 19870 Change-Id: I45bd80e158aecd90448b0c7e59615db27aaef892 Signed-off-by: Brandon Weeks <bweeks@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Update to Orbit R20190531194818 and rollback update to Ant 1.10.6Matthias Sohn2019-06-0115-39/+39
| | | | | | | | | An issue has been reported with Java 1.8 and new Ant version 1.10.6 hence this was rolled back to 1.10.5 in Orbit. See: https://bz.apache.org/bugzilla/show_bug.cgi?id=63457 Bug: 547607 Change-Id: I9c04c988ec89bb1e2cbb528a2d3add30a0b7b3b9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* cli: Add the --always option to describeSebastian Schuberth2019-05-312-0/+5
| | | | | Change-Id: I0342d589e4deabe9d80ea3c9c6b48d7b265d8fe6 Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
* DescribeCommand: Support the "always" optionSebastian Schuberth2019-05-312-9/+47
| | | | | | | | | | | See: https://git-scm.com/docs/git-describe#Documentation/git-describe.txt---always Extend the tests accordingly. Change-Id: Ibfcda338a246c8cba0df6b6e7b9bad76c9f8b593 Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
* cli: Add the --tags option to describeSebastian Schuberth2019-05-312-0/+5
| | | | | Change-Id: I78924e61e2050eeaff991ee56715f36514100492 Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
* DescribeCommand: Consistenly omit the default valueSebastian Schuberth2019-05-311-1/+1
| | | | | | | | Omit the default value of "false" for "useTags" like already done for "longDesc". Change-Id: I25aaacae028fc8cf27f4040ba45fe79609318aa1 Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
* Remove excess blank line in FileUtilsTestMatthias Sohn2019-05-311-1/+0
| | | | Change-Id: I0d617feb7baacf9917b1da605fcb75f7d4ccd184 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* PacketLineIn: Add helper methods to check for END and DELIMDavid Pursehouse2019-05-302-6/+31
| | | | | | | | | These methods will allow clients to check for END and DELIM without doing a reference comparison on the String objects, which raises warnings from Error Prone. Change-Id: I9e7e59843553ed4488ee8e864033198bbb60d67c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* UploadPackTest: Rename variable to avoid hiding class memberDavid Pursehouse2019-05-301-4/+4
| | | | | Change-Id: I9e02642b2f56a735681e58b8c8d6e3545ef9093b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* UploadPackTest: Add missing <> operator on instantiation of ArrayListDavid Pursehouse2019-05-301-1/+1
| | | | | Change-Id: I348cbcd75252d7857ada843dc496d445ee1d62fb Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* BitmapCalculator: javadoc fixesIvan Frade2019-05-271-1/+2
| | | | | | | | | | Fill out the description of when IOException is thrown. Also fix a typo in the description for IncorrectObjectTypeException. Change-Id: I9fafd19d68ddc4fe4e95e8516c2c38484b941a3a Signed-off-by: Ivan Frade <ifrade@google.com> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* RevWalkUtils: add progress callback to findBranchesReachableFromAndrey Loskutov2019-05-253-1/+43
| | | | | | | | | | Offer a version of findBranchesReachableFrom method with progress monitor callback. This is required to allow UI clients to cancel long running operations and show progress. Bug: 547642 Change-Id: I31d1de54dbaa6ffb11e03da4c447963e8defa1d0 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* Merge branch 'stable-5.4'David Pursehouse2019-05-241-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | * stable-5.4: SystemReader: Respect passed-in parent when no system config is present Prepare 5.4.0-SNAPSHOT builds JGit v5.4.0.201905221418-m3 Prepare 5.4.0-SNAPSHOT builds JGit v5.4.0.201905081430-m2 Change-Id: If69cb0afe9915b926d977e4ad26c7d72db31667c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * Merge branch 'stable-5.3' into stable-5.4David Pursehouse2019-05-241-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | * stable-5.3: SystemReader: Respect passed-in parent when no system config is present Change-Id: I758ed0c2a3527ffcf6255158a49090aba090e942 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | * SystemReader: Respect passed-in parent when no system config is presentDave Borowitz2019-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default implementation of openSystemConfig has special handling for when the FS returns null from getGitSystemConfig: it should return a "real" FileBasedConfig instance that never actually tries to load a file. However, this codepath was not respecting the passed-in parent config. Change-Id: Id0bcdc93bb42f9ebe3f5ee4c6b4be8863e0133f9
| * | Prepare 5.4.0-SNAPSHOT buildsMatthias Sohn2019-05-2272-103/+103
| | | | | | | | | | | | | | | Change-Id: I9df6fccee253d4087f9afab4cb46e0a40b8a5699 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v5.4.0.201905221418-m3v5.4.0.201905221418-m3Matthias Sohn2019-05-2272-103/+103
| | | | | | | | | | | | | | | Change-Id: I8a7e687acfcf8c341abd726ae60b5ee173422215 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Merge branch 'master' into stable-5.4Matthias Sohn2019-05-22112-1242/+1675
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: ReachabilityCheckers: @since 5.4 Update Orbit to S20190521195709 for 2019-06 M3 Tune max heap size for tests GPG: check that the key found is a signing key GPG: use key fingerprint suffix to compare id for signing key Recognize ReachabilityCheckerTestCase as helper UploadPack: restore inadvertently deleted line UploadPack: Use reachability checker to validate non-advertised wants Bazel: Simplify names of bouncy castle libraries Convert to lambda or member reference BitmappedReachabilityChecker: Reachability check using bitmaps BitmapCalculator: Get the reachability bitmap of a commit ReachabilityChecker: Default implementation with a RevWalk Change-Id: I323c460853230abcffa94c4f34f15dbaff8c330c
| * | | Prepare 5.4.0-SNAPSHOT buildsMatthias Sohn2019-05-1572-103/+103
| | | | | | | | | | | | | | | | | | | | Change-Id: Ieb4b049972509631f06b5268a90f432a1b9ee207 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | JGit v5.4.0.201905081430-m2v5.4.0.201905081430-m2Matthias Sohn2019-05-0872-103/+103
| | | | | | | | | | | | | | | | | | | | Change-Id: I535a98d8ef507d3c8cda7b0f042a2ae835da1279 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Upgrade maven-source-plugin to 3.1.0David Pursehouse2019-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I8253e75f5038b6c0e2205d74683e0ebd9839dd33 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | Upgrade maven-jar-plugin to 3.1.2David Pursehouse2019-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I9a291390205ee8c44b02c4081f2d8f17635d90ec Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | Upgrade jacoco-maven-plugin to 0.8.4David Pursehouse2019-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Ibab24e1f5eefdc14bcf9ab6d72eab7e0a0cfaad9 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | BitmapCalculator and its test: add missing license headerMatthias Sohn2019-05-232-0/+84
| | | | | | | | | | | | | | | | Change-Id: I3c4a8b1e9159b0553aa95213bb82628370b6c036 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | RevWalk: new method createReachabilityChecker()Ivan Frade2019-05-224-11/+21
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every caller would need to check if bitmaps are available in the repo to instantiate a reachability checker. Offer a method to create the reachability checker in the walk: the caller has already a walk over the repo, and the walk has all the information required. This allows us to make the implementation classes package-private. Change-Id: I355e47486fcd9d55baa7cb5700ec08dcc230eea5 Signed-off-by: Ivan Frade <ifrade@google.com>
* | | ReachabilityCheckers: @since 5.4Ivan Frade2019-05-223-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | The new ReachabilityChecker interface and its implementations are marked as @since 5.5, but they will make it to the 5.4 release. Change-Id: I88c31b3300ccf35d18c35faddb2517f0a57bdcfd Signed-off-by: Ivan Frade <ifrade@google.com>
* | | Update Orbit to S20190521195709 for 2019-06 M3Matthias Sohn2019-05-2215-83/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | Update - org.apache.ant to 1.10.6.v20190516-0412 (CQ 19829) - org.apache.httpcomponents.httpclient to 4.5.6.v20190503-0009 CQ: 19829 Change-Id: Ia057d4f07dab21374ca66c3d87a2bab1c795562c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Tune max heap size for testsMatthias Sohn2019-05-228-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an attempt to fix crashes observed on the new Jenkins infrastructure running on Kubernetes [1]. Increase it to 512m for - org.eclipse.jgit.ant.test - org.eclipse.jgit.http.test - org.eclipse.jgit.lfs.server.test - org.eclipse.jgit.lfs.test - org.eclipse.jgit.pgm.test Decrease it to 768m for - org.eclipse.jgit.test [1] e.g. https://ci-staging.eclipse.org/jgit/job/stable/job/jgit.gerrit/16074/console Change-Id: Id074ed0f7bcb8a13da649a547342af2a08439d9f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | GPG: check that the key found is a signing keyThomas Wolf2019-05-213-0/+10
| | | | | | | | | | | | | | | | | | Throw an exception if not. Change-Id: I60f36b271d5f44c6dc475302b169cb5b8a1e3945 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | GPG: use key fingerprint suffix to compare id for signing keyThomas Wolf2019-05-211-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check whether the value of the git config user.signingKey is a suffix of the full fingerprint of the key. This was already used for finding keys in secring.gpg, but not in pubring.kbx. This mechanism allows a user to use any unique suffix to identify keys; to avoid needless collisions it's recommended to use at least the last 16 characters of the hex representation of the fingerprint, which is the key id.[1] [1] https://tools.ietf.org/html/rfc4880#section-12.2 Bug: 545673 Change-Id: If6fb4879502b6ee4b8c26c21b2714aeac4e4670c Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | Merge "Recognize ReachabilityCheckerTestCase as helper"Jonathan Nieder2019-05-201-0/+1
|\ \ \
| * | | Recognize ReachabilityCheckerTestCase as helperJonathan Tan2019-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4e196faa1b ("ReachabilityChecker: Default implementation with a RevWalk", 2019-05-15) added ReachabilityCheckerTestCase but did not add it as a test helper in the corresponding BUILD file, making tests no longer runnable with Bazel. Resolve this issue. Change-Id: Iccc00b0d169dbaa137e130ce2ddd1b7669960b52 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | | | UploadPack: restore inadvertently deleted lineJonathan Tan2019-05-201-0/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 7b96bd812e ("UploadPack: Use reachability checker to validate non-advertised wants", 2019-05-16), a "walk.setRetainBody(false);" statement was inadvertently deleted. (An earlier version of this commit had this line in another part of the code and a review comment suggested to move it back here; the line was then deleted from the other part of the code but not readded.) Restore this line. Change-Id: I96ff6106ba9e4eef429388c83e898b3363295f69 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | | Merge changes from topic 'reachability-2'Jonathan Tan2019-05-209-44/+914
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: UploadPack: Use reachability checker to validate non-advertised wants BitmappedReachabilityChecker: Reachability check using bitmaps BitmapCalculator: Get the reachability bitmap of a commit ReachabilityChecker: Default implementation with a RevWalk
| * | | UploadPack: Use reachability checker to validate non-advertised wantsIvan Frade2019-05-161-44/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In "Reachable commit" request validators, we need to check that a "want" in the request, that hasn't been advertised, is reachable from the refs visible to the user. Current code has intermixed the translation of ObjectIds to RevCommits (and its error handling) with the actual walk, with the delegation to bitmaps in restricted circunstances. Refactor the code to make it "flatter" and more readable. Move ObjectIds to RevCommits translation to its own functions. Use the reachability checker instead of a newly defined walk. Before the non-advertised wants were validated with bitmaps only if any "want" refered to an non-commit. Now they will be validated with bitmaps also if the "wants" refer all to commits. Change-Id: Ib925a48cde89672b07a88bba4e24d0457546baff Signed-off-by: Ivan Frade <ifrade@google.com>
| * | | BitmappedReachabilityChecker: Reachability check using bitmapsIvan Frade2019-05-152-0/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "basic" reachability check walks the graph starting from the tips marking things as "uninteresting". If the target commit is marked as "uninteresting" it was reached; it is reachable from those tips. This requires a lot of walking and can be solved directly with bitmaps. Most of the time the bitmaps are already calculated or a short walk away. This should improve the performance of reachability checks, for example in Gitiles. Change-Id: I83d33271f58d95d2dc9ed151967b3eda513c99f7 Signed-off-by: Ivan Frade <ifrade@google.com>
| * | | BitmapCalculator: Get the reachability bitmap of a commitIvan Frade2019-05-152-0/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make reachability checks with bitmaps, we need to get the reachability bitmap of a commit, which is not always precalculated. There is already a class returning such bitmap (BitmapWalker) but it does too much unnecessary work: it calculates ALL reachable objects from a commit (i.e. including trees and blobs), when for reachability the commits are just enough. Introduce BitmapCalculator to get the bitmap of a commit: either because it is precalculated or generating it with a walk only over commits. Change-Id: Ibb6c78affe9eeaf1fa362a06daf4fd2d91c1caea Signed-off-by: Ivan Frade <ifrade@google.com>
| * | | ReachabilityChecker: Default implementation with a RevWalkIvan Frade2019-05-154-0/+413
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is common to check if a certain commit is reachable from some starting points. For example gitiles does it to check if a commit is visible to a user based on its permissions. Offer this functionality in JGit. Split the interface as the next commit will introduce an implementation using bitmap indices. Change-Id: I0933b305c8d734f7a64502910ff4d9ef4fc92ae1 Signed-off-by: Ivan Frade <ifrade@google.com>
* | | Bazel: Simplify names of bouncy castle librariesDavid Ostrovsky2019-05-162-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Name bouncy castle libraries consistently. This also allows to use local jgit tree as dependency in gerrit. Change-Id: Ie0a995a70ecee907d25b3cdda9034a25c0290efe Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* | | Convert to lambda or member referenceCarsten Hammer2019-05-1674-1097/+626
|/ / | | | | | | | | | | | | | | | | | | | | Convert anonymous inner classes to lambda expressions or member references Bug: 545856 CQ: 19537 Change-Id: I621431c178e8b99316314602f7c66c9a36f9ae98 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Apache MINA sshd client: test reading encrypted ed25519 keysThomas Wolf2019-05-065-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add encrypted ed25519 keys in the tests; sshd 2.2.0 can finally decrypt encrypted new-style OpenSSH key files. (Needs the "unlimited strength" JCE, which is the default since Java 8u161. On older JREs, users should install the policy files available from Oracle.) The "expensive" key added has been generated with OpenSSH's ssh-keygen -t ed25519 -a 256, i.e., with 256 bcrypt KDF rounds instead of the default 16. On my machine it takes about 2sec to decrypt. Bug: 541703 Change-Id: Id3872ca2fd75d8f009cbc932eeb6357d3d1f267c Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | Apache MINA sshd client: adapt to sshd 2.2.0Thomas Wolf2019-05-0636-885/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Update target platforms, maven and bazel builds to use sshd 2.2.0. Adapt internal classes to changed sshd interfaces and remove previous work-arounds for asking repeatedly for key passwords and for loading keys lazily; both are now done by sshd. CQ: 19034 CQ: 19035 Bug: 541425 Change-Id: I85e1df6ebb8a94953a912d9b2b8a7b5bdfbd608a Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Update Orbit to S20190501151401 for 2019-06 M2Matthias Sohn2019-05-0615-65/+47
| | | | | | | | Change-Id: Ice7ba783c1836682d237e7b50bded90ceaa8b564 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Upgrade maven-compiler-plugin to 3.8.1David Pursehouse2019-05-061-1/+1
| | | | | | | | | | Change-Id: I40c9b637f8a877764e48bbfc8255d4e406f62468 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Upgrade surefire plugins version to 2.22.2David Pursehouse2019-05-061-1/+1
| | | | | | | | | | Change-Id: I5ee3eebc54789ffaf87964446591e5d65cca6b93 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>