Commit Graph

7399 Commits

Author SHA1 Message Date
Thomas Wolf ffe74210d6 SystemReader: extract updating config and its parents if outdated
Change-Id: Ia77f442e47c5670c2d6d279ba862044016aabd86
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-08 09:27:54 +01:00
Matthias Sohn b7810be174 Merge branch 'stable-5.4' into stable-5.5
* stable-5.4:
  Fix benchmark pom.xml to include distribution managment config

Change-Id: I1863f641880e8d9fbd26c02ede6bf5d773e8c8a0
2019-11-06 21:05:07 +01:00
Matthias Sohn 155ed93da8 Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Fix benchmark pom.xml to include distribution managment config

Change-Id: Ib4eed75cc8c5146884ce1461e98564de1c759bba
2019-11-06 21:02:14 +01:00
Matthias Sohn 5c40f12e20 Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Fix benchmark pom.xml to include distribution managment config

Change-Id: Icda57b0045ba87d9424615713d7d706697e5c236
2019-11-06 21:00:07 +01:00
Matthias Sohn 4dd85d9bf3 Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  Fix benchmark pom.xml to include distribution managment config

Change-Id: I20e8b7155397771b1bc77e628f535f27458a24bb
2019-11-06 20:57:46 +01:00
Matthias Sohn d36488ad2e Fix benchmark pom.xml to include distribution managment config
Also fix indentation.

Change-Id: I6d223c493d537bb8aac23c7ddf0a602aff22a3c2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-06 17:56:54 +01:00
Matthias Sohn 97f9bc8e8e Merge branch 'stable-5.4' into stable-5.5
* stable-5.4:
  Run JMH benchmarks using bazel
  Benchmark for creating files and FileSnapshots
  Implement benchmark for looking up FileStore of a given Path
  JMH benchmark for SimpleLruCache
  Update API problem filters
  Remove unused API problem filters
  Silence API errors for new API added since 5.1.0

Change-Id: I071536d630a95e89f5bbbf965a1571b9f5eb81ee
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 16:23:26 +01:00
Matthias Sohn e85664e3f8 Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Run JMH benchmarks using bazel
  Benchmark for creating files and FileSnapshots
  Implement benchmark for looking up FileStore of a given Path
  JMH benchmark for SimpleLruCache
  Update API problem filters
  Remove unused API problem filters
  Silence API errors for new API added since 5.1.0

Change-Id: Ib735c4039e24ec8b045ae2cc81df1e9e5c9fa996
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 15:54:48 +01:00
Matthias Sohn cbdb5e7750 Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Run JMH benchmarks using bazel
  Benchmark for creating files and FileSnapshots
  Implement benchmark for looking up FileStore of a given Path
  JMH benchmark for SimpleLruCache
  Update API problem filters
  Remove unused API problem filters
  Silence API errors for new API added since 5.1.0

Change-Id: I00615958ab6fbdff601e87a9792aba5606cda12a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 15:25:08 +01:00
Matthias Sohn 29a429c29a Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  Run JMH benchmarks using bazel
  Benchmark for creating files and FileSnapshots
  Implement benchmark for looking up FileStore of a given Path
  JMH benchmark for SimpleLruCache
  Remove unused API problem filters
  Silence API errors for new API added since 5.1.0

Change-Id: If91c55a192d3b2c441d9c8d414f2e24a7261b1b6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 15:18:45 +01:00
Matthias Sohn 452c38cd22 Run JMH benchmarks using bazel
The benchmarks can be built and run using bazel by running:

$ bazel run //org.eclipse.jgit.benchmarks:benchmarks

Change-Id: I6679750eaa0f2be30ed9d45036e013b0ea4fcc86
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 14:59:50 +01:00
Matthias Sohn 06de3a1dd7 Benchmark for creating files and FileSnapshots
Change-Id: I953fd8b6b9743b0b9cada244331253eb2121784d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 14:59:50 +01:00
Matthias Sohn 25a611ccc5 Implement benchmark for looking up FileStore of a given Path
Results on Mac OS 10.14.6 using APFS:

Result "org.eclipse.jgit.benchmarks.LookupFileStoreBenchmark.testLookupFileStore":
  44583.277 ±(99.9%) 2666.096 ns/op [Average]
  (min, avg, max) = (43707.073, 44583.277, 45320.685), stdev = 692.377
  CI (99.9%): [41917.181, 47249.373] (assumes normal distribution)

Secondary result
"org.eclipse.jgit.benchmarks.LookupFileStoreBenchmark.testLookupFileStore:·stack":
Stack profiler:

....[Thread state
distributions]........................................................
100.0%         RUNNABLE

....[Thread state:
RUNNABLE].............................................................
 42.5%  42.5% sun.nio.fs.UnixNativeDispatcher.realpath0
 37.9%  37.9% sun.nio.fs.UnixNativeDispatcher.stat0
 11.0%  11.0% sun.nio.fs.BsdNativeDispatcher.getfsstat
  7.6%   7.6% sun.nio.fs.BsdNativeDispatcher.fsstatEntry
  0.7%   0.7% sun.nio.fs.BsdNativeDispatcher.endfsstat
  0.1%   0.1% sun.nio.fs.UnixPath.initOffsets
  0.0%   0.0% sun.nio.fs.UnixFileAttributes.get
  0.0%   0.0% java.util.zip.Inflater.inflateBytes
  0.0%   0.0% sun.misc.Unsafe.compareAndSwapInt
  0.0%   0.0% sun.nio.fs.BsdFileStore.findMountEntry

This shows that FS.attrCacheByPath should be useful to reduce overhead
of looking up the FileStore of a given file.

Change-Id: I7213086b42e0453f0ee149660d507dac2a4644cc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 14:59:50 +01:00
Matthias Sohn 9a638b08d3 JMH benchmark for SimpleLruCache
See [1] for JMH documentation and [2] how to use JMH in Eclipse.

The benchmarks pom currently cannot use the JGit parent pom due to an
ecj bug [3] regarding annotation processing. Hence for now do not
inherit from the JGit parent pom and copy the compiler plugin
configuration for javac from the parent pom.

After running the Maven build the benchmark can be run using Maven:

$ java -jar org.eclipse.jgit.benchmarks/target/benchmarks.jar

or in Eclipse by running the main method of the SimpleLruCacheBenchmark
class.

[1] https://openjdk.java.net/projects/code-tools/jmh/
[2] http://alblue.bandlem.com/Page/3/index.html
[3] https://eclip.se/532029

CQ: 20517
CQ: 20518
Change-Id: Idca8a9e0980f0b8a9c741c4c9e97d03c62f07c8d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 14:50:32 +01:00
Matthias Sohn 9328236cfe Update API problem filters
- filter errors for new APIs added in service release
- remove unused filters

Change-Id: Ifbf532b8a3c46d4ed78a38f6c75073a072b7f669
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-04 16:24:55 +01:00
Matthias Sohn 5b7be296d2 Remove unused API problem filters
Change-Id: I0ae0fd4919b7ccc5218c6eb0fab22350bb9c9714
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-04 13:28:53 +01:00
Matthias Sohn 6d407fe727 Silence API errors for new API added since 5.1.0
Change-Id: I92a7c1b0319d61aeb25f58048bd07c144068c3db
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-04 13:25:37 +01:00
David Pursehouse 67f44ce9fe Merge branch 'stable-5.4' into stable-5.5
* stable-5.4:
  Bazel: Bump bazel version to 1.0.0

Change-Id: I967ad9e0fa6f13c5217aafb8faedc4a7dfb37c58
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-10-12 09:39:51 +09:00
Matthias Sohn 2fda4d3983 Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Bazel: Bump bazel version to 1.0.0

Change-Id: If07e2ff3281dc96bec206b68631d22be8fd4636a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-12 00:28:18 +02:00
Matthias Sohn f884705088 Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Bazel: Bump bazel version to 1.0.0

Change-Id: Ife26567c08ec053741c9db4ca8b5b2836044dcde
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-11 23:43:52 +02:00
Matthias Sohn e93ba0a200 Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  Bazel: Bump bazel version to 1.0.0

Change-Id: I067d8ebd15f35f139d86bc67473b42afac4f0f53
2019-10-11 20:00:56 +02:00
David Pursehouse 3b704aec70 Bazel: Bump bazel version to 1.0.0
Change-Id: I607915af0556efe8b2fb640e9387029b755d1a7f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-10-11 15:35:26 +02:00
Matthias Sohn b570b6907c Prepare 5.5.2-SNAPSHOT builds
Change-Id: Ief9940182fd6e3f3e2df88e6485be753c1260e6b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-03 02:06:57 +02:00
Matthias Sohn 2796d86d1e JGit v5.5.1.201910021850-r
Change-Id: I9930b35b095f638119b4601a8311257daf5e5420
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-03 00:49:02 +02:00
Matthias Sohn 285073d554 Merge branch 'stable-5.4' into stable-5.5
* stable-5.4:
  Prepare 5.3.7-SNAPSHOT builds
  JGit v5.3.6.201910020505-r
  Prepare 5.1.13-SNAPSHOT builds
  JGit v5.1.12.201910011832-r
  Do not rely on ArrayIndexOutOfBoundsException to detect end of input

Change-Id: Ia1070fd170651ce827bc6b876c6764a44ffe60eb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-03 00:47:16 +02:00
Matthias Sohn 430a34e6e1 Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Prepare 5.3.7-SNAPSHOT builds
  JGit v5.3.6.201910020505-r
  Prepare 5.1.13-SNAPSHOT builds
  JGit v5.1.12.201910011832-r
  Do not rely on ArrayIndexOutOfBoundsException to detect end of input

Change-Id: Ia621d06a9489ee276c793de9dd4a77f4ff19e2ac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-02 11:36:05 +02:00
Matthias Sohn ca207cd3ae Prepare 5.3.7-SNAPSHOT builds
Change-Id: I3465b6a4d913bfb2864abba58448423e7c262f60
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-02 11:23:28 +02:00
Matthias Sohn 38258f3f72 JGit v5.3.6.201910020505-r
Change-Id: I12d1c6af03f2d7474c99c22cd2aabb77e95fcb32
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-02 11:03:41 +02:00
Matthias Sohn e59a17d733 Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Prepare 5.1.13-SNAPSHOT builds
  JGit v5.1.12.201910011832-r
  Do not rely on ArrayIndexOutOfBoundsException to detect end of input

Change-Id: I3f11a83e177daefa0a2e91173f70f9547067f713
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-02 11:01:39 +02:00
Matthias Sohn 3cb3ac95b2 Merge branch 'stable-5.1' into stable-5.2
# By Matthias Sohn (2) and Saša Živkov (1)
* stable-5.1:
  Prepare 5.1.13-SNAPSHOT builds
  JGit v5.1.12.201910011832-r
  Do not rely on ArrayIndexOutOfBoundsException to detect end of input

Change-Id: Iaae4b171eaa0081f9142489de8df94ab455d65f7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-02 10:56:15 +02:00
Matthias Sohn 929dd414c1 Prepare 5.1.13-SNAPSHOT builds
Change-Id: Ic1dca14924f49ad07eb5cd0570ce7ece9f319d0d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-02 00:40:49 +02:00
Matthias Sohn ebe1e15781 JGit v5.1.12.201910011832-r
Change-Id: I69fef9b2cdc18bbf1c8b9b290fb3d190684be13c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-02 00:32:04 +02:00
Saša Živkov 3d8649ddef Do not rely on ArrayIndexOutOfBoundsException to detect end of input
In the Config#StringReader we relied on ArrayIndexOutOfBoundsException
to detect the end of the input. Creation of exception with (deep) stack
trace can significantly degrade performance in case when we read
thousands of config files, like in the case when Gerrit reads all
external ids from the NoteDb.

Use the buf.length to detect the end of the input.

Change-Id: I12266f25751373a870ce3fa623cf2a95d882d521
2019-09-27 15:58:10 +02:00
Matthias Sohn 37c8b35344 Merge branch 'stable-5.4' into stable-5.5
* stable-5.4:
  WorkingTreeIterator: handle different timestamp resolutions

Change-Id: I83384336e0d766237d0579152673c9eefc9edd65
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-17 00:41:35 +02:00
Matthias Sohn 35339b455e Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  WorkingTreeIterator: handle different timestamp resolutions

Change-Id: I87afe29578b0270c79bc54c4e2cfda579c329237
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-17 00:40:50 +02:00
Matthias Sohn 84022ac9de Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  WorkingTreeIterator: handle different timestamp resolutions

Change-Id: Ia2a38949089a66abb5f4f1cd41717d2ae8d0eb5b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-17 00:39:54 +02:00
Matthias Sohn 831ba0a628 Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  WorkingTreeIterator: handle different timestamp resolutions

Change-Id: Ic33ebec963af03a182dfe8f46486f5e8d00c0694
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-17 00:38:32 +02:00
Thomas Wolf e3f535cb15 WorkingTreeIterator: handle different timestamp resolutions
Older JGit stored only milliseconds timestamps in the index. Newer
JGit may get finer timestamps from the file system. This leads to
slow index diffs when a new JGit runs against an index produced
by older JGit because many timestamps will differ and JGit will
then do many content checks. See [1].

Handle this migration case by only comparing milliseconds if the
index entry has only millisecond precision.

The inverse may also occur; also compare only milliseconds if the
file timestamp has only millisecond precision.

Do the same also for microsecond resolution. On Windows, NTFS may
provide 100ns resolution and may be used by external programs writing
the index, but Java's WindowsFileAttributes may provide only
microseconds.

File timestamp precision in Java depends not only on the Java APIs
used by different JGit versions but may also change when running the
same Java code on different VMs. And of course the resolution may
vary among operating and file systems. Moreover, timestamp precision
in the index depends on the program that wrote the index. Canonical
git may use a different resolution, maybe even different between git
versions.

[1] https://www.eclipse.org/forums/index.php/t/1100344/

Change-Id: Idfd08606c883cb98787b2138f9baf0cc89a57b56
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-17 00:36:22 +02:00
Matthias Sohn 7f262b8745 Prepare 5.5.1-SNAPSHOT builds
Change-Id: Iaf929168770dfef54ce2a7bfcbee9b87c450ca8a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-11 11:46:58 +02:00
Matthias Sohn de2df8adde JGit v5.5.0.201909110433-r
Change-Id: I5715730ac47d32462f235c2f50581bf1579d46b9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-11 10:31:38 +02:00
Matthias Sohn 524fd0d8c6 Merge branch 'stable-5.4' into stable-5.5
* stable-5.4:
  Fix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL

Change-Id: Ibdda7687da015b17cdca67427202766fe102fee1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-10 22:03:06 +02:00
Matthias Sohn 3c0230d844 Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Fix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL

Change-Id: Ie8447fc28b03bfc918cee0cc2162a2aa3585f3ea
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-10 22:00:40 +02:00
Matthias Sohn 8f96e1bebb Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Fix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL

Change-Id: I57093dfef181645088767471159c204c50961c3a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-10 21:26:40 +02:00
Matthias Sohn 718a8b11b3 Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  Fix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL

Change-Id: Ic4ee37fb36f61dc7707391f768bf78a33094bfd3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-10 21:26:04 +02:00
Matthias Sohn 84ac86ee61 Fix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL
If CheckStat is MINIMAL or timestamps have no nanosecond part
WorkingTreeIterator.compareMetaData only checks the second part of
timestamps and ignores nanoseconds which may have ended up in the index
by using native git.

If

fileLastModified.getEpochSecond() == cacheLastModified.getEpochSecond()

we currently proceed comparing fileLastModified and cacheLastModified
with full precision which is wrong since we determined that we detected
reduced timestamp resolution.

Fix this and also handle smudged index entries for CheckStat.MINIMAL.

Change-Id: I6149885903ac63d79b42d234cc02aa4e19578f3c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-10 16:08:45 +02:00
Matthias Sohn b31d5360f0 Merge branch 'stable-5.4' into stable-5.5
* stable-5.4:
  Format BUILD files with buildifier
  Format BUILD files with buildifier
  [error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache
  Bazel: Format BUILD files with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Fix warning about deprecated lib.bzl
  Format lib/BUILD with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Bump minimum supported version to 0.29.0
  Bazel: Bump skylib library version to 0.8.0
  Use bazelisk to switch between used bazel version
  Bazel: Require minimum bazel version 0.17.1
  Fix wrong placeholder index in error message packInaccessible
  JGitText: Remove unused externalized strings
  RepoText: Remove unused externalized string
  CLI: Remove unused externalized strings

Change-Id: Idf3abd80ad3b00188f655e638d9908228770911f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-08 17:35:14 +02:00
Matthias Sohn 83a07246c1 bazel: fix running http tests
Other than Maven bazel seems unable to cope with abstract
AllFactoriesHttpTestCase having no test methods, hence tag this class
with @Ignore.

Change-Id: I9dfe43f882ad073b284648e24844b51877d87776
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-08 17:34:14 +02:00
Matthias Sohn 74937d0328 Set parameter name in parameterized http tests
This shows the class name of the HTTP factory used in each test run.

Change-Id: I7c1df20f0e138dc7e3120fe87e80d40ab17dd8c8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-08 17:34:13 +02:00
Matthias Sohn 3cd6eec0da Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Format BUILD files with buildifier

Change-Id: Iaf15196f31ec839fed4211d099bed991b4e5e9de
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-08 17:11:01 +02:00
Matthias Sohn 5bac162a00 Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Format BUILD files with buildifier

Change-Id: I9281a953a38dad0df7e5a2d6d7a11d4597513aa1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-08 17:10:12 +02:00