Commit Graph

7136 Commits

Author SHA1 Message Date
David Pursehouse 87c7bda914 Upgrade maven-source-plugin to 3.1.0
Change-Id: I8253e75f5038b6c0e2205d74683e0ebd9839dd33
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-05-23 10:13:13 +09:00
David Pursehouse d510929a25 Upgrade maven-jar-plugin to 3.1.2
Change-Id: I9a291390205ee8c44b02c4081f2d8f17635d90ec
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-05-23 10:13:13 +09:00
David Pursehouse 22360a4bee Upgrade jacoco-maven-plugin to 0.8.4
Change-Id: Ibab24e1f5eefdc14bcf9ab6d72eab7e0a0cfaad9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-05-23 10:13:13 +09:00
Matthias Sohn 73ba6658cf BitmapCalculator and its test: add missing license header
Change-Id: I3c4a8b1e9159b0553aa95213bb82628370b6c036
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-23 02:12:16 +02:00
Matthias Sohn 0988276746 Prepare 5.4.0-SNAPSHOT builds
Change-Id: I9df6fccee253d4087f9afab4cb46e0a40b8a5699
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-22 22:52:43 +02:00
Matthias Sohn 72998dd5ee JGit v5.4.0.201905221418-m3
Change-Id: I8a7e687acfcf8c341abd726ae60b5ee173422215
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-22 20:18:14 +02:00
Ivan Frade 5dce8614ab RevWalk: new method createReachabilityChecker()
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>
2019-05-22 14:17:31 -04:00
Matthias Sohn bed7a45fb5 Merge branch 'master' into stable-5.4
* 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
2019-05-22 19:37:40 +02:00
Ivan Frade 8216929618 ReachabilityCheckers: @since 5.4
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>
2019-05-22 17:37:12 +02:00
Matthias Sohn c33c0bd1b5 Update Orbit to S20190521195709 for 2019-06 M3
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>
2019-05-22 17:34:58 +02:00
Matthias Sohn e19e859977 Tune max heap size for tests
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>
2019-05-22 14:42:43 +02:00
Matthias Sohn 91101414ae Include filekey file attribute when comparing FileSnapshots
Due to finite filesystem timestamp resolution the last modified
timestamp of files cannot detect file changes which happened in the
immediate past (less than one filesystem timer tick ago).

Some filesystems expose unique file identifiers, e.g. inodes in Posix
filesystems which are named filekeys in Java's BasicFileAttributes. Use
them as another means to detect file modifications based on stat
information.

Running git gc on a repository yields a new packfile with the same id as
a packfile which existed before the gc if these packfiles contain the
same set of objects. The content of the old and the new packfile might
differ if a different PackConfig was used when writing the packfile.
Considering filekeys in FileSnapshot may help to detect such packfile
modifications.

Bug: 546891
Change-Id: I711a80328c55e1a31171d540880b8e80ec1fe095
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-22 08:13:56 +02:00
Matthias Sohn b513b77477 Measure file timestamp resolution used in FileSnapshot
FileSnapshot.notRacyClean() assumed a worst case filesystem timestamp
resolution of 2.5 sec (FAT has a resolution of 2 sec). Instead measure
timestamp resolution to avoid unnecessary IO caused by false positives
in detecting the racy git problem caused by finite filesystem timestamp
resolution [1].

Cache the measured resolution per FileStore since timestamp resolution
depends on the respective filesystem type. If timestamp resolution
cannot be measured or fails due to an exception fallback to the worst
case FAT timestamp resolution and avoid caching this value.

Add a 10% safety margin in FileSnapshot.notRacyClean(), though running
FsTest.testFsTimestampResolution() 1000 times which is not using a
safety margin didn't fail on Mac using APFS and Java 8, 11, 12.

Measured Java file timestamp resolution: [2]

[1] https://github.com/git/git/blob/master/Documentation/technical/racy-git.txt
[2] https://docs.google.com/spreadsheets/d/1imy0y6WmRqBf0kjCxzxj2X7M50eIVfa7oaUIzEOHmjo

Bug: 546891
Change-Id: I493f3b57b6b306285ffa7d392339d253e5966ab8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-22 08:13:22 +02:00
Matthias Sohn 201bbd6ead Fix FileSnapshot's consideration of file size
* fix equals() and hashCode() methods to consider size
* fix toString() to show size

Change-Id: I5485db55eda5110121efd65d86c7166b3b2e93d0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-22 08:12:51 +02:00
Matthias Sohn ed2e515ddf Fix API problem filters
Change-Id: I566391d7c51875f30cf580d64e6784819985709f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-22 08:03:29 +02:00
Thomas Wolf efe6d2bb5b GPG: check that the key found is a signing key
Throw an exception if not.

Change-Id: I60f36b271d5f44c6dc475302b169cb5b8a1e3945
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2019-05-21 18:13:40 +02:00
Thomas Wolf 6536b5cbca GPG: use key fingerprint suffix to compare id for signing key
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>
2019-05-21 18:11:28 +02:00
Jonathan Nieder 6e127c089a Merge "Recognize ReachabilityCheckerTestCase as helper" 2019-05-20 23:14:34 -04:00
Jonathan Tan bab685488d Recognize ReachabilityCheckerTestCase as helper
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>
2019-05-20 17:02:07 -07:00
Jonathan Tan f2318190bf UploadPack: restore inadvertently deleted line
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>
2019-05-20 16:22:31 -07:00
Jonathan Tan 7121fa6fec Merge changes from topic 'reachability-2'
* 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
2019-05-20 16:04:28 -04:00
Ivan Frade 7b96bd812e UploadPack: Use reachability checker to validate non-advertised wants
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>
2019-05-16 16:31:16 -07:00
David Ostrovsky 5e4be72b5a Bazel: Simplify names of bouncy castle libraries
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>
2019-05-16 19:04:40 +02:00
Carsten Hammer 84fc5c908d Convert to lambda or member reference
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>
2019-05-16 02:58:43 -04:00
Ivan Frade 601b0ae577 BitmappedReachabilityChecker: Reachability check using bitmaps
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>
2019-05-15 16:36:20 -07:00
Ivan Frade b6da4b34cc BitmapCalculator: Get the reachability bitmap of a commit
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>
2019-05-15 15:04:00 -07:00
Ivan Frade 4e196faa1b ReachabilityChecker: Default implementation with a RevWalk
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>
2019-05-15 14:55:54 -07:00
Matthias Sohn d31716f883 Prepare 5.4.0-SNAPSHOT builds
Change-Id: Ieb4b049972509631f06b5268a90f432a1b9ee207
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-15 09:16:58 +02:00
Matthias Sohn f5957e433c Fix API problem filters
Change-Id: Ie67a9f8c62152a1d02782f0571202d9b88ae31f4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-14 17:22:26 +02:00
Matthias Sohn b172015b23 JGit v5.4.0.201905081430-m2
Change-Id: I535a98d8ef507d3c8cda7b0f042a2ae835da1279
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-08 20:28:19 +02:00
Thomas Wolf c33d2bfb9f Apache MINA sshd client: test reading encrypted ed25519 keys
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>
2019-05-06 15:22:08 +02:00
Thomas Wolf 86cee68e0d Apache MINA sshd client: adapt to sshd 2.2.0
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>
2019-05-06 15:22:05 +02:00
Matthias Sohn 756c2c2b3c Update Orbit to S20190501151401 for 2019-06 M2
Change-Id: Ice7ba783c1836682d237e7b50bded90ceaa8b564
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-06 15:10:42 +02:00
David Pursehouse 0270abd31b Upgrade maven-compiler-plugin to 3.8.1
Change-Id: I40c9b637f8a877764e48bbfc8255d4e406f62468
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-05-06 18:09:00 +09:00
David Pursehouse 28097b204a Upgrade surefire plugins version to 2.22.2
Change-Id: I5ee3eebc54789ffaf87964446591e5d65cca6b93
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-05-06 00:33:27 +02:00
Matthias Sohn 8f2b4c8a6e Use integer depth in PackWriter's DepthAwareVisitationPolicy
- ObjectWalk.getTreeDepth() returns int hence there is no need to use
long depths in the lowestDepthVisited map.
- Also fix boxing warnings introduced in 0a15cb3a.

Change-Id: I6d73b6f41d5d20975d02f376c8588e411eaff0ec
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-03 12:43:59 +02:00
Michael Keppler 2e5bd2a362 Upgrade Tycho to 1.4.0 for eclipse build
Change-Id: I8893be53a5b45e1f4c177ff002b94c887576f128
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
2019-04-29 00:46:50 +02:00
David Pursehouse 8491a1134e SubmoduleWalk#forPath: Clarify that caller must close returned instance
Change-Id: I25e7913a78c23c030a8c568975ee1044a9973517
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-04-29 00:40:46 +02:00
David Pursehouse 18ae69158f ConfigConstants: Fix quoting of section names in javadocs
Replace:

 in the "core section"
 in the "diff section"
 in the "merge section"

with:

 in the "core" section
 in the "diff" section
 in the "merge" section

Change-Id: Ided7bf73e9c8aae4fc4e43d5d5b9f6d7e3066f0a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-04-29 00:40:46 +02:00
David Pursehouse 8404757062 Upgrade maven-pmd-plugin to 3.12.0
Change-Id: I5ae0f0573aae3da3789fecdad494a2dd243e780b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-04-29 00:40:46 +02:00
Matthias Sohn 88b56ff1e9 Silence API errors and add missing @since tags caused by 175e6654
Change-Id: If55acad84015f988f1e974bc19c426828b98822b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-29 00:36:00 +02:00
Matthias Sohn 3c92025c1b Merge branch 'stable-5.3'
* stable-5.3:
  Prepare 5.3.2-SNAPSHOT builds
  JGit v5.3.1.201904271842-r
  Prepare 5.2.3-SNAPSHOT builds
  JGit v5.2.2.201904231744-r
  Revert 4678f4b and provide another solution for bug 467631
  Apache MINA sshd: make sendKexInit() work also for re-keying
  Prepare 5.1.8-SNAPSHOT builds
  JGit v5.1.7.201904200442-r
  ObjectUploadListener: Add callback interface
  Prepare 4.11.9-SNAPSHOT builds
  JGit v4.11.8.201904181247-r
  Prepare 4.9.11-SNAPSHOT builds
  JGit v4.9.10.201904181027-r
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: I8a8671f7767444a77b809bd66a27d776c8332736
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-29 00:10:43 +02:00
Matthias Sohn 1342942cc8 Prepare 5.3.2-SNAPSHOT builds
Change-Id: Iedd56602acc89783387098c7f92ce0e5bad091e0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-28 00:54:08 +02:00
Matthias Sohn 38049a008d JGit v5.3.1.201904271842-r
Change-Id: If3c323acfd2b6933f7d4fbec480cd4e82224f701
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-28 00:41:59 +02:00
Matthias Sohn 32f0963b84 Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Prepare 5.2.3-SNAPSHOT builds
  JGit v5.2.2.201904231744-r
  Revert 4678f4b and provide another solution for bug 467631
  Apache MINA sshd: make sendKexInit() work also for re-keying
  Prepare 5.1.8-SNAPSHOT builds
  JGit v5.1.7.201904200442-r
  ObjectUploadListener: Add callback interface
  Prepare 4.11.9-SNAPSHOT builds
  JGit v4.11.8.201904181247-r
  Prepare 4.9.11-SNAPSHOT builds
  JGit v4.9.10.201904181027-r
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: Ie7e572ac7e346f21fe0c387d7448be168a9c127a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-28 00:30:47 +02:00
Thomas Wolf 3537386926 [releng] Update the japicmp baseline to 5.3.0.201903130848-r
Change-Id: Ie69cc0885317705aaee7d107875e6aa9f430b5eb
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2019-04-25 14:33:01 -04:00
Thomas Wolf 1faaccfc21 Update target platform, maven and bazel builds to JSch 0.1.55
Same version as used in the latest Eclipse platform. Updating the
JGit target platform results in the new JSch version being included
in the JGit feature in the p2 repo, and thus ultimately in the EGit
update site.

CQ: 19588
Bug: 546130
Change-Id: Id7e4318096f6f29dc4573e15542abdf54582af34
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2019-04-25 19:33:36 +02:00
Matthias Sohn a72e0b0188 Prepare 5.2.3-SNAPSHOT builds
Change-Id: I6ae3db901d986467128326073d4ba70406ae8385
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-24 00:04:44 +02:00
Matthias Sohn 1d297c3ddc JGit v5.2.2.201904231744-r
Change-Id: I4ed2aff28bff702a8c1b42814acb04c7ef9025a7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-23 23:43:50 +02:00
Thomas Wolf 8277f62897 Revert 4678f4b and provide another solution for bug 467631
Making gitlinks and folders match in a tree walk was the wrong
approach to fix bug 467631. The problem is that in such a conflict
the tree walk may then not descend into the folder.

Revert the changes to Paths.java and PathsTest.java from commit
4678f4b. Instead test for the problem case from bug 467631 explicitly
in IndexDiff. Add Daniel's test case from bug 545162, and add yet
another test case for DiffEntry.scan() that covers the problem
originally reported in bug 545162.

Bug: 545162
Change-Id: Ie2214c5d5ee32ac6596b621f0f1c7b86d38fa9b7
Also-by: Daniel Veihelmann <daniel.veihelmann@gmail.com>
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2019-04-20 11:19:34 +02:00