Commit Graph

7630 Commits

Author SHA1 Message Date
Han-Wen Nienhuys 63fba337b2 Run Eclipse formatter on BatchRefUpdateTest
Change-Id: I583491f621e54401c60150efb285fcc7243a9355
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2019-11-14 13:48:28 -08:00
Matthias Sohn 63fc6970cc Suppress the API errors introduced by 3e9a5f99
I1ce92869435d5eebb7d671be44561e69c6233134 merged BaseReceivePack into
ReceivePack which breaks API but is only affecting the few jgit based
servers out in the wild.

Change-Id: Iad856a2afaf3cad95d01ad81a0116cebcd9de2d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-14 10:08:24 -08:00
David Pursehouse 57bb09ade9 ReceivePack: Remove unused getLockMessageProcessName method
Change-Id: I85a0c3e3a53f87ad6f6eda41c7c6cb41b403b3bb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-11-13 16:33:34 -08:00
David Pursehouse b89e5ecc9f ReceivePack: Remove unnecessary ReceivePack. prefix on static call
Change-Id: I2d9a95266f5baa5a2298451adbd9ca0259b26c4b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-11-13 16:31:48 -08:00
Masaya Suzuki 3e9a5f993b transport: Merge BaseReceivePack into ReceivePack
Move the BaseReceivePack implementation back into ReceivePack. This is a
backward-incompatible change. For example, BaseReceivePack.FirstLine no
longer exists and cannot be referenced.  However, most of the code
should just work by replacing BaseReceivePack with ReceivePack.

Although this is an API change, it only affects callers using JGit as a
server, and there are very few of those in the wild.

Change-Id: I1ce92869435d5eebb7d671be44561e69c6233134
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
2019-11-13 15:57:04 -08:00
Han-Wen Nienhuys 74bfec4112 Move KetchSystem.delay to FileUtils.
This will provide exponential backoff with jitter to other JGit
components too.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: Idd44e3bbaef6d71134ce2e3f7d405f35e7397cbd
2019-11-13 15:14:09 -08:00
David Pursehouse fd798d326e BaseReceivePack: Add hasReceivedPack method
The getPackSize method will throw IllegalStateException if it is
called when the pack size is not set. This is the case for example
when the received commands are all DELETE and there is no pack.

Add a new method hasReceivedPack that can be called prior to calling
getPackSize, to avoid causing the IllegalStateException.

See [1] for context.

[1] https://bugs.chromium.org/p/gerrit/issues/detail?id=11918

Change-Id: I56397256a05e92c8398e65c07a859cee59b46317
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-11-13 14:56:45 -08:00
Matthias Sohn 566a46e9ec Silence API errors for new API introduced in 5.5.2
Change-Id: I9fee5138ea8f407d9d34cad4659c3a2d4f3ebf35
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-12 18:51:22 +01:00
David Pursehouse ee00877a56 Upgrade wagon-ssh to 3.3.4
Change-Id: I6162b72fc06376f33fe34b9fef1c106800e3a920
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-11-12 08:08:51 -08:00
Thomas Wolf ca8887a074 Merge branch 'stable-5.5'
* stable-5.5:
  Fix NPE in SystemReader in tests

Change-Id: I8500caeca99fe05ce9a80b54330b72e23670a46b
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2019-11-12 12:23:56 +01:00
Thomas Wolf 22e153177c Fix NPE in SystemReader in tests
SystemReader.updateAll() must _not_ test whether the file exists. In
tests at least there are FileBasedConfigs with a null file. Test
configs should (and do) override isOutdated() to deal with this case.

Change-Id: I56303fe0d56afeb9f2203ee807a92c5dcf3809e9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2019-11-12 09:39:45 +01:00
Matthias Sohn 826317942f Merge branch 'stable-5.5'
* stable-5.5:
  BaseReceivePack: Fix the format
  Prepend hostname to subsection used to store file timestamp resolution
  Store filesystem timestamp resolution in extra jgit config
  SystemReader: extract updating config and its parents if outdated

Change-Id: Iecfddce8081303af29badcdcd3d72a0da50c964f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-11 11:07:17 -08:00
Masaya Suzuki ca800b55c8 BaseReceivePack: Fix the format
Change-Id: I6136ef5318f81a6feb1267338ca76e60122fd15b
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
2019-11-10 09:38:00 -08:00
Matthias Sohn e102bbed99 Prepend hostname to subsection used to store file timestamp resolution
This ensures the measured filesystem timestamp resolution will be only
used on the machine where it was measured and avoid errors in case the
~/.jgitconfig file is copied to another machine.

Bug: 551850
Change-Id: Iff2a11be62ca94c3bbe4a955182988dc50852f9f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-09 18:01:33 +01:00
Matthias Sohn 838b5a84b5 Store filesystem timestamp resolution in extra jgit config
This avoids polluting hand-crafted user level config with
auto-configured options which might disturb in environments where
the user level config is replicated between different machines.

Add a jgit config as parent of the system level config. Persist
measured timestamp resolutions always in this jgit config and read it
via the user global config. This has the effect that auto-configured
timestamp resolution will be used by default and can be overridden in
either the system level or user level config.

Store the jgit config under the XDG_CONFIG_HOME directory following the
XDG base directory specification [1] in order to ensure that we have
write permissions to persist the file. This has the effect that each OS
user will use its jgit config since they typically use different
XDG_CONFIG_HOME directories.

If the environment variable XDG_CONFIG_HOME is defined the jgit config
file is located at $XDG_CONFIG_HOME/jgit/config otherwise the default is
~/.config/jgit/config.

If you want to avoid redundant measurement for different OS users
manually copy the values measured and auto-configured for one OS user to
the system level git config.

[1] https://wiki.archlinux.org/index.php/XDG_Base_Directory

Bug: 551850
Change-Id: I0022bd40ae62f82e5b964c2ea25822eb55d94687
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-09 18:01:19 +01:00
David Ostrovsky a7412b544b Update bouncycastle version to 1.64 and Orbit to I20191106190530
The recent versions fixed number of defects and added new features: [1].
Use Orbit I20191106190530 until a S-build is available.

[1] https://www.bouncycastle.org/releasenotes.html

Change-Id: I0f2fd3a218ea31f6f6b58b1816af9361e4de54e4
Signed-off-by: David Ostrovsky <d.ostrovsky@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-09 00:39:38 +01:00
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
David Pursehouse 6bae5a88bc Upgrade maven-jar-plugin to 3.2.0
Change-Id: I74fc2a6b1a79f1433914b909e92e524668817081
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-11-06 22:26:58 +01:00
David Pursehouse 5220e18010 Upgrade maven-source-plugin to 3.2.0
Change-Id: I0c683e100b64f6d66e2598cb06970a547aaeaed6
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-11-06 22:26:58 +01:00
Matthias Sohn 6c3bb402ea Merge branch 'stable-5.5'
* stable-5.5:
  Fix benchmark pom.xml to include distribution managment config

Change-Id: Ife566e83777e3282892d6f7a90400b00e9065292
2019-11-06 21:07:09 +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 abecc9587f Merge branch 'stable-5.5'
* stable-5.5:
  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: If87a13d0f809d9968ad2921b786f4b18e1b494d0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 16:31:58 +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
Thomas Wolf e8c3619063 DirCacheCheckout: don't use deprecated method
Pass the CheckoutMetadata to checkoutEntry(), otherwise cr-lf settings
and smudge filters would be ignored.

Change-Id: Ifb1c4cb098a0b47c9752d0231d530db6a92b25a4
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2019-11-03 10:14:40 +01:00
Thomas Wolf 64f2407f19 WorkingTreeModifiedEvent: must be fired explicitly after merge
A merge may write files to the working tree. After a successful
merge one must fire a WorkingTreeModifiedEvent explicitly if
getModifiedFiles() is not empty.

Also, any touched files must be reported by the
WorkingTreeModifiedEvent fired by DirCacheCheckout.checkout().

Bug: 552636
Change-Id: I5fab8279ed8be8a4ae34cddfa726836b9277aea6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2019-11-03 10:10:16 +01:00
David Pursehouse b29e9bd1cb Merge "HttpSupport.proxyFor(): use only scheme, host, and port" 2019-10-30 19:20:30 -04:00
Han-Wen Nienhuys 7c75a68b96 reftable: enforce ascending order in sortAndWriteRefs
MergedReftableTest#scanDuplicates tests whether we can write duplicate
keys in a merged reftable. Apparently, the first key appearing should
get precedence, and this works because the sort() algorithm on ordered
collections is stable.

This is potentially confusing behavior, because you can write data
into the table that cannot be retrieved (Merged table can only have
one entry per key), and the APIs such as exactRef() only return a
single value.

Make this consistent with behavior introduced in I04f55c481 "reftable:
enforce ordering for ref and log writes" by considering a duplicate key
in sortAndWriteRefs as a fatal runtime error.

Change-Id: I1eedd18f028180069f78c5c467169dcfe1521157
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2019-10-30 18:00:24 +01:00
Thomas Wolf b7d1eb4185 HttpSupport.proxyFor(): use only scheme, host, and port
Some URLs cannot be converted via URL.toURI(). So don't convert
the full URL but only the bits that are needed to find a proxy
via java.net.ProxySelector.

Bug: 549690
Change-Id: I55b5ecee70c6b52f72f9bdba9ce552fde7f33976
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2019-10-30 15:16:51 +01:00
Han-Wen Nienhuys cf11a03bc2 Documentation/technical/reftable: change suggested file names
By using ${min_update}-${max_update} as file name template, we
guarantee that each file has a unique name.
This allows data from open files to be cached across reloads of the
stack.

This is in anticipation of Change I1837f268e 
("file: implement FileReftableDatabase"), which is the first
implementation of reftable on a filesystem.

Change-Id: I7ef0610eb60c494165382d0c372afcf41f074393
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2019-10-30 07:21:46 -04:00
Matthias Sohn b4e5ae3b34 Update Orbit to S20191025144108 and Ant to 1.10.7.v20190926-0324
This is the Orbit version for 2019-12 M2.

We tried earlier to update to Ant 1.10.7 but had to revert this since
there were issues with the previous artefact version in Orbit.

See platform bug 550793 for the list of changes since 1.10.6.

Change-Id: Ifb3212d4420e3656083784e842da2bd9bf750911
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-29 13:41:01 +01:00
Matthias Sohn 50e9de62d3 Update Tycho to 1.5.1
This release fixes bug 552346 [1].

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=552346

Change-Id: I53be02c3702e62d3b5ceb85141b9798571a8ca0c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-29 11:43:16 +01:00
Michael Keppler 333c20aa48 Upgrade Jetty to 9.4.22.v20191022
Change-Id: Ie2ee0a978949f9cf70833645132eedf26c3cf1c8
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-27 18:10:15 +01:00
David Pursehouse 078500ef1c Merge "[errorprone] Don't throw exception in finally" 2019-10-25 21:56:06 -04:00
David Pursehouse 66aa2cc30c Merge "[errorprone] Add parenthesis to clarify operator precedence" 2019-10-25 21:55:33 -04:00
Matthias Sohn 271051ef06 Replace "Rebase interactive" with "Interactive rebase"
The RepositoryState's description is shown in EGit's interactive rebase
view. Use the grammatically correct form.

Bug: 552359
Change-Id: I860ef730a67f2b34d7fabbfbda5ea65ead9270d2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-25 17:46:58 +02:00
Matthias Sohn 5625f70d25 [errorprone] Don't throw exception in finally
Instead log the problem. There is no reason to panic when we fail to
delete a single temporary file in java.io.tmpdir.

Change-Id: Idb867b3f07b090c7453ccd3688e94097df3b2672
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-10-25 15:27:36 +02:00