]> source.dussan.org Git - jgit.git/log
jgit.git
3 years agoMerge branch 'stable-5.1' into stable-5.2 75/181475/1
Matthias Sohn [Sat, 5 Jun 2021 20:19:47 +0000 (22:19 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Prepare 5.1.17-SNAPSHOT builds
  JGit v5.1.16.202106041830-r
  BatchRefUpdate: Skip saving conflicting ref names and prefixes in memory
  BatchRefUpdateTest: Accurately assert RefsChangedEvent(s) fired
  Optimize RefDirectory.isNameConflicting()
  Update bazlets and bazel version

Change-Id: If1b5a2b380cf155e66bf5d5c6d216f86c919bb37

3 years agoPrepare 5.1.17-SNAPSHOT builds 72/181472/1
Matthias Sohn [Fri, 4 Jun 2021 22:45:08 +0000 (00:45 +0200)]
Prepare 5.1.17-SNAPSHOT builds

Change-Id: I20c69728465f956a5744a75eb548ef18962286dd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoJGit v5.1.16.202106041830-r 71/181471/1 v5.1.16.202106041830-r
Matthias Sohn [Fri, 4 Jun 2021 22:31:03 +0000 (00:31 +0200)]
JGit v5.1.16.202106041830-r

Change-Id: I526ed2a08553bc0b2678aaefaff9e0c6529baefc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge changes I853ac6c7,I01878116,Ie994fc18 into stable-5.1
Matthias Sohn [Fri, 4 Jun 2021 22:21:31 +0000 (18:21 -0400)]
Merge changes I853ac6c7,I01878116,Ie994fc18 into stable-5.1

* changes:
  BatchRefUpdate: Skip saving conflicting ref names and prefixes in memory
  BatchRefUpdateTest: Accurately assert RefsChangedEvent(s) fired
  Optimize RefDirectory.isNameConflicting()

3 years agoBatchRefUpdate: Skip saving conflicting ref names and prefixes in memory 97/180697/4
Kaushik Lingarkar [Wed, 12 May 2021 23:12:27 +0000 (16:12 -0700)]
BatchRefUpdate: Skip saving conflicting ref names and prefixes in memory

Rather than getting all ref names and prefixes and saving them
in memory to perform the check for conflicting names, rely on
RefDirectory.isNameConflicting as it is no longer an expensive
call after it was optimized in Ie994fc.

The old optimization to save ref names and prefixes in memory
was targeted towards making clones faster. With this change,
the clone performance is unaffected when tests were done with
repos containing many(~500k) refs.

Here are few recorded elapsed times for creating 10 branches
using BatchRefUpdate on NFS based repositories with varying
loose refs count. As seen here, this change helps improve the
BatchRefUpdate performance from O(n^2) to O(1).

loose_refs_count  with_change  without_change
50                241 ms        310 ms
300               263 ms        1502 ms
1k                181 ms        4241 ms
2k                204 ms        6440 ms
9k                158 ms        25930 ms
20k               154 ms        60443 ms
50k               171 ms        135199 ms
110k              157 ms        329450 ms
160k              209 ms        396328 ms

This update improves the Gerrit notedb migration performance
as it uses BatchRefUpdate to write change meta refs similar to
the test performed above.

Change-Id: I853ac6c7feb4b39c3156c01876b38cbd182accfe
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
3 years agoBatchRefUpdateTest: Accurately assert RefsChangedEvent(s) fired 96/180696/7
Kaushik Lingarkar [Fri, 14 May 2021 21:24:41 +0000 (14:24 -0700)]
BatchRefUpdateTest: Accurately assert RefsChangedEvent(s) fired

Update tests to record the number of events fired post-setup and only
assert for events fired during BatchRefUpdate.execute. For tests which
use writeLooseRef to setup refs, create new tests which assert the
number of RefsChangedEvent(s) rather than updating the existing ones
to call RefDirectory.exactRef as it changes the code path.

Change-Id: I0187811628d179d9c7e874c9bb8a7ddb44dd9df4
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
3 years agoOptimize RefDirectory.isNameConflicting() 59/180559/4
Kaushik Lingarkar [Wed, 12 May 2021 21:57:49 +0000 (14:57 -0700)]
Optimize RefDirectory.isNameConflicting()

Avoid having to scan over ALL loose refs to determine if the
name is nested within or is a container of an existing reference.
This can get really expensive if there are too many loose refs.
Instead use exactRef and getRefsByPrefix which scan based on a
prefix.

With a simple shell script(like below) using jgit client to create
1k refs in a new repository on NFS, this change brings down the time
from 12mins to 7mins.

for ref in $(seq 1 1000); do
    jgit branch "$ref"
done

Here are few recorded elapsed times to create a new branch on NFS
based repositories with varying loose refs count. As we see here,
this change improves the name conflicting check from O(n^2) to O(1).

loose_refs_count  with_change  without_change
50                44 ms        164 ms
300               45 ms        1193 ms
1k                38 ms        2610 ms
2k                44 ms        6003 ms
9k                46 ms        27860 ms
20k               45 ms        48591 ms
50k               51 ms        135471 ms
110k              43 ms        294252 ms
160k              52 ms        430976 ms

Change-Id: Ie994fc184b8f82811bfb37b111eb9733dbe3e6e0
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
3 years agoUpdate bazlets and bazel version 22/180622/1
Matthias Sohn [Thu, 16 Jan 2020 12:07:20 +0000 (13:07 +0100)]
Update bazlets and bazel version

- bazlets need to be updated to react on Maven central no longer
supporting http protocol but only https
- update bazel to 2.0

Change-Id: I07f5f050f3b1db2014a5198a28b6bbf893434814
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit d74daad1e064da9614c5ca2c0138c8046cfb0829)

3 years agoMerge branch 'stable-5.1' into stable-5.2 87/173187/1
Matthias Sohn [Wed, 2 Dec 2020 01:17:27 +0000 (02:17 +0100)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Prepare 5.1.16-SNAPSHOT builds
  JGit v5.1.15.202012011955-r
  Fix PackInvalidException when fetch and repack run concurrently

Change-Id: Id83e29e567646a3945a5b817860ea8f7c3e6e5cf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoPrepare 5.1.16-SNAPSHOT builds 86/173186/1
Matthias Sohn [Wed, 2 Dec 2020 01:02:48 +0000 (02:02 +0100)]
Prepare 5.1.16-SNAPSHOT builds

Change-Id: I50e59e1e73a92fa4fe366398fb8141f5e2e289c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoJGit v5.1.15.202012011955-r 85/173185/1 v5.1.15.202012011955-r
Matthias Sohn [Wed, 2 Dec 2020 00:53:39 +0000 (01:53 +0100)]
JGit v5.1.15.202012011955-r

Change-Id: Icb4f04a40ab366cbacbb3fdf0db1748f27277fda
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoFix PackInvalidException when fetch and repack run concurrently 40/173040/4
Petr Hrebejk [Mon, 30 Nov 2020 19:19:53 +0000 (20:19 +0100)]
Fix PackInvalidException when fetch and repack run concurrently

We are running several servers with jGit. We need to run repack from
time to time to keep the repos performant. I.e. after push we test how
many small packs are in the repo and when a threshold is reached we run
the repack.

After upgrading jGit version we've found that if someone does the clone
at the time repack is running the clone sometimes (not always) fails
because the repack removes .pack file used by the clone. Server
exception and client error attached.

I've tracked down the cause and it seems to be introduced between jGit
5.2 (which we upgraded from) and 5.3 and being caused by this commit:
Move throw of PackInvalidException outside the catch -
https://github.com/eclipse/jgit/commit/afef866a44cd65fef292c174cad445b3fb526400

The problem is that when the throw was inside of the try block the last
catch block catched the exception and called openFailed(false) method.
It is true that it called it with invalidate = false, which is wrong.
The real problem though is that with the throw outside of the try block
the openFail is not called at all and the fields activeWindows and
activeCopyRawData are not set to 0. Which affects the later called tests
like: if (++activeCopyRawData == 1 && activeWindows == 0).

The fix for this is relatively simple keeping the throw outside of the
try block and still having the invalid field set to true. I did
exhaustive testing of the change running concurrent clones and pushes
indefinitely and with the patch applied it never fails while without the
patch it takes relatively short to get the error.

See: https://www.eclipse.org/lists/jgit-dev/msg04014.html

Bug: 569349
Change-Id: I9dbf8801c8d3131955ad7124f42b62095d96da54
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.1' into stable-5.2 74/172874/1
Matthias Sohn [Thu, 26 Nov 2020 14:34:08 +0000 (15:34 +0100)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Prepare 5.1.15-SNAPSHOT builds
  JGit v5.1.14.202011251942-r
  GC#deleteOrphans: log warning for deleted orphaned files
  GC#deleteOrphans: handle failure to list files in pack directory
  Ensure that GC#deleteOrphans respects pack lock
  Update API warning filters
  Remove unused imports

Change-Id: I91cfe2820c40d2d773cbf018cc2a6c36b062801e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoPrepare 5.1.15-SNAPSHOT builds 73/172873/1
Matthias Sohn [Thu, 26 Nov 2020 14:02:01 +0000 (15:02 +0100)]
Prepare 5.1.15-SNAPSHOT builds

Change-Id: I70246b66c76e865aef4e3adada3a507750ca7c63
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoJGit v5.1.14.202011251942-r 62/172862/1 v5.1.14.202011251942-r
Matthias Sohn [Thu, 26 Nov 2020 00:42:17 +0000 (01:42 +0100)]
JGit v5.1.14.202011251942-r

Change-Id: Ibe124988be39feaa029c3770777126dd87b18abc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoGC#deleteOrphans: log warning for deleted orphaned files 61/172861/4
Matthias Sohn [Wed, 25 Nov 2020 23:58:03 +0000 (00:58 +0100)]
GC#deleteOrphans: log warning for deleted orphaned files

Change-Id: Ie245bf5c8c924dfb1f0f40b8bcdcb1e6f5815526
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoGC#deleteOrphans: handle failure to list files in pack directory 60/172860/3
Matthias Sohn [Wed, 25 Nov 2020 23:24:56 +0000 (00:24 +0100)]
GC#deleteOrphans: handle failure to list files in pack directory

- log an error
- either there is no list or it is incomplete hence return immediately

Change-Id: Ieee5378ca06304056b9ccc30c1acd5f52360052d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoEnsure that GC#deleteOrphans respects pack lock 29/172829/8
Matthias Sohn [Wed, 25 Nov 2020 16:00:09 +0000 (17:00 +0100)]
Ensure that GC#deleteOrphans respects pack lock

If pack or index files are guarded by a pack lock (.keep file)
deleteOrphans() should not touch the respective files protected by the
lock file. Otherwise it may interfere with PackInserter concurrently
inserting a new pack file and its index.

The problem was caused by the following race.

All mentioned files are located in  "objects/pack/".
File endings relevant in "pack" dir:
  .pack
  .keep
  .idx
  .bitmap

When ReceivePack receives a pack file it executes the following steps:

ReceivePack.service():
  receivePackAndCheckConnectivity():
    receivePack():
      receive the pack
      parse the pack, returns packLock (.keep file)
      PackInserter.flush():
        write tmpPck file:  "insert_<random>.pack"
        write tmpIdx file:  "insert_<random>.idx"
        real pack name: "pack-<SHA1>.pack"
        real index name: "pack-<SHA1>.idx"
        atomic rename tmpPack to realPack
        atomic rename tmpIdx to tmpIdx
  execute commands
  unlock pack by removing .keep file
  trigger auto gc if enabled

When PackInserter.flush() renames the temporary pack to the final
"pack-xxx.pack" file  the temporary pack index file "insert_xxx.idx"
has no matching .pack file with the same base name for a short interval.
If deleteOrphans() ran during that interval it deduced the pack index
file was orphaned. Subsequently the missing pack index caused
MissingObjectExceptions since objects contained in the pack couldn't be
looked up anymore.

Bug: https://bugs.chromium.org/p/gerrit/issues/detail?id=13544
Change-Id: I559c81e4b1d7c487f92a751bd78b987d32c98719
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoUpdate API warning filters 53/166553/1
Matthias Sohn [Sun, 19 Jul 2020 10:03:14 +0000 (12:03 +0200)]
Update API warning filters

Change-Id: I0fa9c7725ee15da9a932dab0abfb2525d2401149
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoRemove unused imports 52/166552/1
Matthias Sohn [Sun, 19 Jul 2020 10:00:35 +0000 (12:00 +0200)]
Remove unused imports

Change-Id: I7c44e3603df2dd368cb7c0ba0072413b887b6903
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.1' into stable-5.2 78/157478/1
Matthias Sohn [Tue, 11 Feb 2020 10:18:12 +0000 (11:18 +0100)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Prepare 5.1.14-SNAPSHOT builds
  JGit v5.1.13.202002110435-r

Change-Id: I57fc818e719bc94f90ab1aeb34016eea74d84719
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoPrepare 5.1.14-SNAPSHOT builds 77/157477/1
Matthias Sohn [Tue, 11 Feb 2020 10:12:20 +0000 (11:12 +0100)]
Prepare 5.1.14-SNAPSHOT builds

Change-Id: Ic7d6f1a6c3123af1a1fa782f052b0cea3b6f28c6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoJGit v5.1.13.202002110435-r 75/157475/1 v5.1.13.202002110435-r
Matthias Sohn [Tue, 11 Feb 2020 09:30:36 +0000 (10:30 +0100)]
JGit v5.1.13.202002110435-r

Change-Id: Iedc8699ad1a24efe7ddb47ae919c75b9d36141d4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.1' into stable-5.2 19/156919/2
David Pursehouse [Fri, 31 Jan 2020 00:12:08 +0000 (09:12 +0900)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Fix string format parameter for invalidRefAdvertisementLine
  WindowCache: add metric for cached bytes per repository
  pgm daemon: fallback to user and system config if no config specified
  WindowCache: add option to use strong refs to reference ByteWindows

Change-Id: I741059a1d0d5950ab5bc16ec70352655ee926a24
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoFix string format parameter for invalidRefAdvertisementLine 18/156918/1
David Pursehouse [Thu, 30 Jan 2020 23:38:24 +0000 (08:38 +0900)]
Fix string format parameter for invalidRefAdvertisementLine

The externalized error message added in f4fc640 ("BasePackConnection:
Check for expected length of ref advertisement", Dec 18, 2019) uses a
malformed string format. Since there is only one formatting argument,
it should be referenced with '{0}' rather than '{1}'.

Change-Id: Ibda864dfb0bb902fe07ae4bba73117b212046e8a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoWindowCache: add metric for cached bytes per repository 73/155173/7
Matthias Sohn [Fri, 3 Jan 2020 17:16:42 +0000 (18:16 +0100)]
WindowCache: add metric for cached bytes per repository

Since ObjectDatabase and PackFile don't know their repository use the
packfile's grand-grand-parent directory as an identifier for the
repository the packfile resides in.

Remove metric for a repository if the number of cached bytes for the
repository drops to 0 in order to ensure the map of cached bytes per
repository doesn't contain repositories which have no data cached in the
WindowCache.

Change-Id: I969ab8029db0a292e7585cbb36ca0baa797da20b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agopgm daemon: fallback to user and system config if no config specified 83/156683/2
Matthias Sohn [Mon, 27 Jan 2020 22:00:57 +0000 (23:00 +0100)]
pgm daemon: fallback to user and system config if no config specified

If a config file is passed via option --config-file then use only the
options defined in that file. This helps to concisely configure the
daemon without side effects from global and system level git configs.

Otherwise fallback to user and system level configs.

Change-Id: I242de248f257579874ad0bfe4882a22502353b1f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoWindowCache: add option to use strong refs to reference ByteWindows 49/155149/5
Matthias Sohn [Fri, 13 Dec 2019 00:18:12 +0000 (01:18 +0100)]
WindowCache: add option to use strong refs to reference ByteWindows

Java GC evicts all SoftReferences when the used heap size comes close to
the maximum heap size. This means peaks in heap memory consumption can
flush the complete WindowCache which was observed to have negative
impact on performance of upload-pack in Gerrit.

Hence add a boolean option core.packedGitUseStrongRefs to allow using
strong references to reference packfile pages cached in the WindowCache.

If this option is set to true Java gc can no longer flush the
WindowCache to free memory if the used heap comes close to the maximum
heap size. On the other hand this provides more predictable performance.

Bug: 553573
Change-Id: I9de406293087ab0fa61130c8e0829775762ece8d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.1' into stable-5.2 12/155912/2
David Pursehouse [Wed, 15 Jan 2020 11:03:28 +0000 (20:03 +0900)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Replace usage of ArrayIndexOutOfBoundsException in treewalk
  Add config constants for WindowCache configuration options

Change-Id: I17da3c5183eca536aa2be3972bc5df45c9d75f1b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoReplace usage of ArrayIndexOutOfBoundsException in treewalk 32/155532/3
Patrick Hiesel [Thu, 9 Jan 2020 09:23:12 +0000 (10:23 +0100)]
Replace usage of ArrayIndexOutOfBoundsException in treewalk

Using exceptions during normal operations - for example with the
desire of expanding an array in the failure case - can have a
severe performance impact. When exceptions are instantiated,
a stack trace is collected. Generating stack trace can be expensive.

Compared to that, checking an array for length - even if done many
times - is cheap since this is a check that can run in just a
handful of CPU cycles.

Change-Id: Ifaf10623f6a876c9faecfa44654c9296315adfcb
Signed-off-by: Patrick Hiesel <hiesel@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.1' into stable-5.2 23/155523/1
Matthias Sohn [Thu, 9 Jan 2020 01:03:45 +0000 (02:03 +0100)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Fix unclosed resource warning in SmartOutputStream
  JschConfigSessionFactory: fix boxing warning
  SshSupport#runSshCommand: don't throw exception in finally block
  Don't override already managed maven-compiler-plugin version
  Remove unused import from CreateFileSnapshotBenchmark
  Remove duplicate ignore_optional_problems entry in .classpath
  Update maven-site-plugin used by benchmark module to 3.8.2
  Add dependency to enable site generation for benchmark module
  Ignore warnings for generated source code in
org.eclipse.jgit.benchmark
  Fix MBean registration
  Enhance WindowCache statistics

Change-Id: Ic90aacf1ea40e13dc564d4d659e79535e86d0300
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoFix API problem filters 22/155522/1
Matthias Sohn [Sat, 4 Jan 2020 12:01:39 +0000 (13:01 +0100)]
Fix API problem filters

Change-Id: Icc78570f949ad64beb58caa192c829e536aa8dad
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoAdd config constants for WindowCache configuration options 48/155148/2
Matthias Sohn [Thu, 2 Jan 2020 23:52:37 +0000 (00:52 +0100)]
Add config constants for WindowCache configuration options

Change-Id: Icc5265f87ae58aa1e667ed1827075c4a30f75c32
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoFix unclosed resource warning in SmartOutputStream 12/155212/2
Matthias Sohn [Sat, 4 Jan 2020 16:03:52 +0000 (17:03 +0100)]
Fix unclosed resource warning in SmartOutputStream

Change-Id: Ia4b96ae1c2cc9357802487384ee32a80ed40334b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoJschConfigSessionFactory: fix boxing warning 11/155211/2
Matthias Sohn [Sat, 4 Jan 2020 15:06:54 +0000 (16:06 +0100)]
JschConfigSessionFactory: fix boxing warning

Change-Id: I1735033c56b444a9a7160cb7df89292a228d5b34
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoSshSupport#runSshCommand: don't throw exception in finally block 10/155210/2
Matthias Sohn [Sat, 4 Jan 2020 14:44:19 +0000 (15:44 +0100)]
SshSupport#runSshCommand: don't throw exception in finally block

The CommandFailedException which was thrown in finally block is silently
discarded [1]. Refactor this method to throw the exception after the
finally block.

This fixes the warning "Null comparison always yields false: The
variable failure can only be null at this location".

[1] https://wiki.sei.cmu.edu/confluence/display/java/ERR04-J.+Do+not+complete+abruptly+from+a+finally+block
https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.20.2

Change-Id: Idbfc303d9c9046ab9a43e0d4c6d65d325bdaf0ed
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoDon't override already managed maven-compiler-plugin version 09/155209/1
Matthias Sohn [Sat, 4 Jan 2020 12:15:37 +0000 (13:15 +0100)]
Don't override already managed maven-compiler-plugin version

Change-Id: Ie2cb178cf8d805aadc76a2096bcdde95a146d07c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoRemove unused import from CreateFileSnapshotBenchmark 08/155208/1
Matthias Sohn [Sat, 4 Jan 2020 12:11:06 +0000 (13:11 +0100)]
Remove unused import from CreateFileSnapshotBenchmark

Change-Id: Iad0bcc01ada4252e9ab4f60d4375f98f084f6a5f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoRemove duplicate ignore_optional_problems entry in .classpath 07/155207/1
Matthias Sohn [Sat, 4 Jan 2020 12:10:00 +0000 (13:10 +0100)]
Remove duplicate ignore_optional_problems entry in .classpath

Change-Id: I326377c90af59ecaada7f5185a638726a8e909b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoUpdate maven-site-plugin used by benchmark module to 3.8.2 69/154769/1
Matthias Sohn [Wed, 18 Dec 2019 14:50:35 +0000 (15:50 +0100)]
Update maven-site-plugin used by benchmark module to 3.8.2

The benchmark module currently has no parent, adjust the version used
here to the one used by all the other jgit Maven modules.

Change-Id: I8807a694fe23f8f131d1d22a58a3e18874d756cc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoAdd dependency to enable site generation for benchmark module 68/154768/1
Matthias Sohn [Wed, 18 Dec 2019 14:49:18 +0000 (15:49 +0100)]
Add dependency to enable site generation for benchmark module

Change-Id: Iae4524ddc730d57993e9c6d6807282e4b07d1336
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoIgnore warnings for generated source code in org.eclipse.jgit.benchmark 38/154638/1
Matthias Sohn [Mon, 16 Dec 2019 14:22:08 +0000 (15:22 +0100)]
Ignore warnings for generated source code in org.eclipse.jgit.benchmark

The source code in the folder .apt_generated is generated by the JMH
code generator, so there's no point in raising any warnings as this
could only be fixed in the upstream code generator.

Change-Id: I882888e7bf924f9ae74182598fcb91671a5c9818
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoFix MBean registration 94/154494/1
Matthias Sohn [Fri, 13 Dec 2019 16:32:51 +0000 (17:32 +0100)]
Fix MBean registration

Change-Id: I6f6b8641f6c3e8ab9f625594085014272305656a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoEnhance WindowCache statistics 01/153601/6
Matthias Sohn [Sat, 30 Nov 2019 02:38:13 +0000 (03:38 +0100)]
Enhance WindowCache statistics

Add the following statistics
- cache hit count and hit ratio
- cache miss count and miss ratio
- count of successful and failed loads
- rate of failed loads
- load, eviction and request count
- average and total load time

Use LongAdder instead of AtomicLong to implement counters in order to
improve scalability.

Optionally expose these metrics via JMX, they are registered with the
platform MBean server if the config option jmx.WindowCacheStats = true
in the user or system level git config.

Bug: 553573
Change-Id: Ia2d5246ef69b9c2bd594a23934424bc5800774aa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.1' into stable-5.2 79/153379/1
David Pursehouse [Tue, 26 Nov 2019 08:41:04 +0000 (17:41 +0900)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl
  Bazel: Add missing newlines at end of BUILD files

Change-Id: Ic1dc84a6c4a1cf430d329627642583fd6e0d0eaa
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoBazel: Use java_plugin and java_binary from @rules_java in jmh.bzl 64/153364/2
David Pursehouse [Tue, 26 Nov 2019 03:17:52 +0000 (12:17 +0900)]
Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl

Change-Id: I80456f74bc17a1ebb0248fce8050a4cb07bf18f1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoBazel: Add missing newlines at end of BUILD files 63/153363/2
David Pursehouse [Tue, 26 Nov 2019 03:16:47 +0000 (12:16 +0900)]
Bazel: Add missing newlines at end of BUILD files

Change-Id: I11afc45141da988e28382898246995f6b45eb09c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoMerge branch 'stable-5.1' into stable-5.2 79/152179/1
Matthias Sohn [Wed, 6 Nov 2019 19:57:46 +0000 (20:57 +0100)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Fix benchmark pom.xml to include distribution managment config

Change-Id: I20e8b7155397771b1bc77e628f535f27458a24bb

4 years agoFix benchmark pom.xml to include distribution managment config 64/152164/2
Matthias Sohn [Wed, 6 Nov 2019 16:49:48 +0000 (17:49 +0100)]
Fix benchmark pom.xml to include distribution managment config

Also fix indentation.

Change-Id: I6d223c493d537bb8aac23c7ddf0a602aff22a3c2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.1' into stable-5.2 73/151973/2
Matthias Sohn [Tue, 5 Nov 2019 14:07:39 +0000 (15:07 +0100)]
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>
4 years agoRun JMH benchmarks using bazel 23/147023/12
Matthias Sohn [Sun, 4 Aug 2019 17:04:41 +0000 (19:04 +0200)]
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>
4 years agoBenchmark for creating files and FileSnapshots 71/147171/7
Matthias Sohn [Wed, 7 Aug 2019 09:51:30 +0000 (11:51 +0200)]
Benchmark for creating files and FileSnapshots

Change-Id: I953fd8b6b9743b0b9cada244331253eb2121784d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoImplement benchmark for looking up FileStore of a given Path 66/147066/7
Matthias Sohn [Mon, 5 Aug 2019 14:26:20 +0000 (16:26 +0200)]
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>
4 years agoJMH benchmark for SimpleLruCache 22/147022/10
Matthias Sohn [Sat, 3 Aug 2019 10:02:34 +0000 (12:02 +0200)]
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>
4 years agoUpdate API problem filters 72/151972/1
Matthias Sohn [Mon, 4 Nov 2019 15:24:55 +0000 (16:24 +0100)]
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>
4 years agoRemove unused API problem filters 48/151948/1
Matthias Sohn [Mon, 4 Nov 2019 12:28:23 +0000 (13:28 +0100)]
Remove unused API problem filters

Change-Id: I0ae0fd4919b7ccc5218c6eb0fab22350bb9c9714
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoSilence API errors for new API added since 5.1.0 47/151947/1
Matthias Sohn [Mon, 4 Nov 2019 12:25:37 +0000 (13:25 +0100)]
Silence API errors for new API added since 5.1.0

Change-Id: I92a7c1b0319d61aeb25f58048bd07c144068c3db
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 68/150968/1
Matthias Sohn [Fri, 11 Oct 2019 18:00:56 +0000 (20:00 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Bazel: Bump bazel version to 1.0.0

Change-Id: I067d8ebd15f35f139d86bc67473b42afac4f0f53

5 years agoBazel: Bump bazel version to 1.0.0 24/150924/2
David Pursehouse [Fri, 11 Oct 2019 00:41:43 +0000 (09:41 +0900)]
Bazel: Bump bazel version to 1.0.0

Change-Id: I607915af0556efe8b2fb640e9387029b755d1a7f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 80/150480/1
Matthias Sohn [Wed, 2 Oct 2019 08:56:15 +0000 (10:56 +0200)]
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>
5 years agoPrepare 5.1.13-SNAPSHOT builds 62/150462/1
Matthias Sohn [Tue, 1 Oct 2019 22:40:49 +0000 (00:40 +0200)]
Prepare 5.1.13-SNAPSHOT builds

Change-Id: Ic1dca14924f49ad07eb5cd0570ce7ece9f319d0d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.1.12.201910011832-r 61/150461/1 v5.1.12.201910011832-r
Matthias Sohn [Tue, 1 Oct 2019 22:32:04 +0000 (00:32 +0200)]
JGit v5.1.12.201910011832-r

Change-Id: I69fef9b2cdc18bbf1c8b9b290fb3d190684be13c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoDo not rely on ArrayIndexOutOfBoundsException to detect end of input 54/150254/1
Saša Živkov [Fri, 27 Sep 2019 13:58:10 +0000 (15:58 +0200)]
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

5 years agoMerge branch 'stable-5.1' into stable-5.2 17/149617/1
Matthias Sohn [Mon, 16 Sep 2019 22:38:16 +0000 (00:38 +0200)]
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>
5 years agoWorkingTreeIterator: handle different timestamp resolutions 40/149440/6
Thomas Wolf [Thu, 12 Sep 2019 19:05:19 +0000 (21:05 +0200)]
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>
5 years agoMerge branch 'stable-5.1' into stable-5.2 89/149289/1
Matthias Sohn [Tue, 10 Sep 2019 19:25:45 +0000 (21:25 +0200)]
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>
5 years agoFix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL 66/149266/1
Matthias Sohn [Tue, 10 Sep 2019 14:08:45 +0000 (16:08 +0200)]
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>
5 years agoMerge branch 'stable-5.1' into stable-5.2 24/149124/1
Matthias Sohn [Sun, 8 Sep 2019 15:08:39 +0000 (17:08 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Format BUILD files with buildifier

Change-Id: I5a8413470fd0fbb6db3ca553f455b3e3dc10ab33
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFormat BUILD files with buildifier 23/149123/1
David Pursehouse [Sun, 8 Sep 2019 13:30:19 +0000 (22:30 +0900)]
Format BUILD files with buildifier

Using buildifier from master branch and the command:

$ buildifier -r -lint fix -warnings all .

Change-Id: I19c8ff183081093cb73bed7221a78a91b6cba4dc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years ago[error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache 03/149103/5
Matthias Sohn [Sat, 7 Sep 2019 09:38:58 +0000 (11:38 +0200)]
[error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache

We don't need to update time atomically since it's only used to order
cache entries in LRU order.

Change-Id: I756fa6d90b180c519bf52925f134763744f2c1f1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoBazel: Format BUILD files with buildifier 14/149114/1
David Pursehouse [Sun, 8 Sep 2019 01:09:07 +0000 (10:09 +0900)]
Bazel: Format BUILD files with buildifier

Change-Id: I8b4abf67fba592be42b2b5b029fa0e972d746dcb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoBazel: Add fixes for --incompatible_load_java_rules_from_bzl 13/149113/1
David Pursehouse [Sun, 8 Sep 2019 01:08:39 +0000 (10:08 +0900)]
Bazel: Add fixes for --incompatible_load_java_rules_from_bzl

Change-Id: Ifc47ae22209fdb7a5d7bede4da002640ed26a43a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 01/149101/2
Matthias Sohn [Sat, 7 Sep 2019 09:07:21 +0000 (11:07 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  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: Iea37a8e39e9d4872dc607c9222dcf191ce4e4757
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoBazel: Fix warning about deprecated lib.bzl 98/149098/3
David Pursehouse [Sat, 7 Sep 2019 06:28:32 +0000 (15:28 +0900)]
Bazel: Fix warning about deprecated lib.bzl

Change-Id: Ifdbaaf9ec020a621070eea351f791a819d554012
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoFormat lib/BUILD with buildifier 85/149085/4
David Pursehouse [Sat, 7 Sep 2019 00:32:19 +0000 (09:32 +0900)]
Format lib/BUILD with buildifier

Change-Id: I4f0ad64371b160b67797f49b9fde521e5dea9396
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoBazel: Add fixes for --incompatible_load_java_rules_from_bzl 33/148933/7
David Pursehouse [Thu, 5 Sep 2019 00:46:59 +0000 (09:46 +0900)]
Bazel: Add fixes for --incompatible_load_java_rules_from_bzl

Change-Id: I24746335db132bf20f400cb3db400737596d4542
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoBazel: Bump minimum supported version to 0.29.0 96/148996/5
David Ostrovsky [Thu, 5 Sep 2019 20:07:46 +0000 (22:07 +0200)]
Bazel: Bump minimum supported version to 0.29.0

Change-Id: I069e56deb964624791bb0aa3ae095629adfe3bbb
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
5 years agoBazel: Bump skylib library version to 0.8.0 97/149097/3
David Ostrovsky [Sat, 8 Jun 2019 15:31:33 +0000 (17:31 +0200)]
Bazel: Bump skylib library version to 0.8.0

Change-Id: I2089899c9f197b2c93b93390fdd55f6fe11e5ce4
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
5 years agoUse bazelisk to switch between used bazel version 99/149099/2
David Ostrovsky [Sat, 8 Jun 2019 15:33:28 +0000 (17:33 +0200)]
Use bazelisk to switch between used bazel version

Bazelisk is utility to switch to the right Bazel version, that we
used to have with Buck build tool: [1].

Bazelisk will download the right Bazel version only once and will use
it in subsequent calls:

  $ bazelisk build :release
  2019/06/06 16:22:15 Downloading \
  https://releases.bazel.build/0.26.1/release/bazel-0.26.1-linux-x86_64...

Bazelisk is storing the binaries in user's cache directory: [2], e.g.
on Linux OS:

  $ ls -1 ~/.cache/bazelisk/bin
  bazel-0.26.1-linux-x86_64

* [1] https://github.com/bazelbuild/bazelisk
* [2] https://golang.org/pkg/os/#UserCacheDir

Change-Id: Ia9180fb75f8cc17a0a0232622cf33a13bfad6b60
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
5 years agoBazel: Require minimum bazel version 0.17.1 96/149096/3
David Pursehouse [Wed, 10 Oct 2018 01:53:35 +0000 (10:53 +0900)]
Bazel: Require minimum bazel version 0.17.1

Check the bazel version using the checker from bazel_skylib, and
require at least version 0.17.1 which is the minimum version that
does not suffer from the Java API mismatch issue [1].

The implementation is borrowed from the Gerrit project.

[1] https://github.com/bazelbuild/bazel/issues/6027

Change-Id: I224250088a1f5072fcaa3ec81228f4d2cb8cb389
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoFix wrong placeholder index in error message packInaccessible 05/149005/4
Matthias Sohn [Thu, 5 Sep 2019 22:52:48 +0000 (00:52 +0200)]
Fix wrong placeholder index in error message packInaccessible

See: https://www.eclipse.org/lists/jgit-dev/msg03850.html
Change-Id: I0e121a2b7ac399f4a663fa49ab330d27363e9a55
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGitText: Remove unused externalized strings 09/149009/3
David Pursehouse [Fri, 6 Sep 2019 02:06:33 +0000 (11:06 +0900)]
JGitText: Remove unused externalized strings

Change-Id: I995d7a1b6ab2866221eee9f5cb828b97192daf4a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoRepoText: Remove unused externalized string 07/149007/3
David Pursehouse [Fri, 6 Sep 2019 01:04:42 +0000 (10:04 +0900)]
RepoText: Remove unused externalized string

Change-Id: Ida47637f54afdb76513be9b04aae32107567d4e3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoCLI: Remove unused externalized strings 06/149006/3
David Pursehouse [Fri, 6 Sep 2019 00:20:55 +0000 (09:20 +0900)]
CLI: Remove unused externalized strings

Change-Id: Id44117dd72b0e71e9bf0046a3c965eeae64cf3ea
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 51/148851/2
Matthias Sohn [Tue, 3 Sep 2019 21:41:03 +0000 (23:41 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Prepare 5.1.12-SNAPSHOT builds
  JGit v5.1.11.201909031202-r
  Prepare 4.11.10-SNAPSHOT builds
  JGit v4.11.9.201909030838-r
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: Iac5dc9683cea97db04d20f27c10f2e103d3ae7b5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.1.12-SNAPSHOT builds 49/148849/1
Matthias Sohn [Tue, 3 Sep 2019 20:56:39 +0000 (22:56 +0200)]
Prepare 5.1.12-SNAPSHOT builds

Change-Id: I353ac3f23024063722abc7340bc9a6df3c615741
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.1.11.201909031202-r 21/148821/1 v5.1.11.201909031202-r
Matthias Sohn [Tue, 3 Sep 2019 16:01:55 +0000 (18:01 +0200)]
JGit v5.1.11.201909031202-r

Change-Id: I288acf670160b9bcd2d04f572a902b5838b4d4f8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.0' into stable-5.1 06/148806/2
Matthias Sohn [Tue, 3 Sep 2019 14:02:44 +0000 (16:02 +0200)]
Merge branch 'stable-5.0' into stable-5.1

* stable-5.0:
  Prepare 4.11.10-SNAPSHOT builds
  JGit v4.11.9.201909030838-r
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: I172136a031ff0730e575327cafb3527c9650a71d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.11' into stable-5.0 97/148797/2 stable-5.0
Matthias Sohn [Tue, 3 Sep 2019 13:54:54 +0000 (15:54 +0200)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Prepare 4.11.10-SNAPSHOT builds
  JGit v4.11.9.201909030838-r
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: Ifb6a4dbea2f48fd2ffa66eb737d61920aefedfbd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 4.11.10-SNAPSHOT builds 94/148794/1 stable-4.11
Matthias Sohn [Tue, 3 Sep 2019 12:49:20 +0000 (14:49 +0200)]
Prepare 4.11.10-SNAPSHOT builds

Change-Id: Ic98bd87d96ce627d38e1ecc2c3cb28b517ab489e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v4.11.9.201909030838-r 87/148787/1 v4.11.9.201909030838-r
Matthias Sohn [Tue, 3 Sep 2019 12:37:49 +0000 (14:37 +0200)]
JGit v4.11.9.201909030838-r

Change-Id: Ie60468569074197d49e19cbd0ffaedfe88f3d74e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.10' into stable-4.11 86/148786/1
Matthias Sohn [Tue, 3 Sep 2019 12:23:29 +0000 (14:23 +0200)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: If672b4f0c350f4e8ff7e1e706485cffd8137236d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.9' into stable-4.10 80/148780/2 stable-4.10
Matthias Sohn [Tue, 3 Sep 2019 12:21:04 +0000 (14:21 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file

Change-Id: I8bb74aacc1c010cfed9a0c8acffb520724f0e395
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.9' into stable-4.10 79/148779/2
Matthias Sohn [Tue, 3 Sep 2019 11:24:28 +0000 (13:24 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: Id5bf44645655fca40ad22bb1f1ad20a7c2e8f6db
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoBazel: Update bazlets to the latest master revision 78/148778/1 stable-4.9
David Pursehouse [Tue, 3 Sep 2019 11:35:47 +0000 (20:35 +0900)]
Bazel: Update bazlets to the latest master revision

The latest revision includes various fixes to allow the build
to work with recent versions of Bazel.

Change-Id: I72c100b99762010946d9b2784286af560bbdf185
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoBazel: Remove FileTreeIteratorWithTimeControl from BUILD file 77/148777/1
David Pursehouse [Tue, 16 Jul 2019 02:19:09 +0000 (11:19 +0900)]
Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file

FileTreeIteratorWithTimeControl was deleted in a024759, but was
not removed from the BUILD file, thus causing the bazel build to
fail.

Change-Id: I892c0ffcac947298d0d6009374ee2c5d9afefb66
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
(cherry picked from commit e54fde8616f53a6fab5201db4a0c7e67dd0145c5)

5 years agoBatchRefUpdate: repro racy atomic update, and fix it 06/148706/8
Han-Wen Nienhuys [Sat, 31 Aug 2019 19:33:58 +0000 (21:33 +0200)]
BatchRefUpdate: repro racy atomic update, and fix it

PackedBatchRefUpdate was creating a new packed-refs list that was
potentially unsorted. This would be papered over when the list was
read back from disk in parsePackedRef, which detects unsorted ref
lists on reading, and sorts them. However, the BatchRefUpdate also
installed the new (unsorted) list in-memory in
RefDirectory#packedRefs.

With the timestamp granularity code committed to stable-5.1, we can
more often accurately decide that the packed-refs file is clean, and
will return the erroneous unsorted data more often. Unluckily timed
delays also cause the file to be clean, hence this problem was
exacerbated under load.

The symptom is that refs added by a BatchRefUpdate would stop being
visible directly after they were added. In particular, the Gerrit
integration tests uses BatchRefUpdate in its setup for creating the
Admin group, and then tries to read it out directly afterward.

The tests recreates one failure case. A better approach would be to
revise RefList.Builder, so it detects out-of-order lists and
automatically sorts them.

Fixes https://bugs.eclipse.org/bugs/show_bug.cgi?id=548716 and
https://bugs.chromium.org/p/gerrit/issues/detail?id=11373.

Bug: 548716
Change-Id: I613c8059964513ce2370543620725b540b3cb6d1
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoDelete unused FileTreeIteratorWithTimeControl 65/148765/1
Matthias Sohn [Thu, 11 Jul 2019 08:00:23 +0000 (10:00 +0200)]
Delete unused FileTreeIteratorWithTimeControl

The only usage of this test iterator was removed in df637928d. Hence
delete this iterator and associated test.

Change-Id: I47710133ec3edc675c21db210960c024982668c6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit a024759cf5bf1cd6b9beb4f790d484943761a7e1)

5 years agoFix RacyGitTests#testRacyGitDetection 64/148764/1
Matthias Sohn [Tue, 18 Jun 2019 09:32:59 +0000 (11:32 +0200)]
Fix RacyGitTests#testRacyGitDetection

This test case assumed file system timestamp resolution of 1 second. On
filesystems with a finer resolution this test fails since the index
entry is only smudged if the file index entry's lastModified and the
lastModified of the git index itself are within the same filesystem
timer tick. Fix this by ensuring that these timestamps are identical
which should work for any filesystem timer resolution.

Bug: 548188
Change-Id: Id84d59e1cfeb48fa008f8f27f2f892c4f73985de
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
(cherry picked from commit 1159f9dd7c80a53c2509cd75d997a6afed37f9a6)

5 years agoChange RacyGitTests to create a racy git situation in a stable way 63/148763/1
Masaya Suzuki [Mon, 24 Dec 2018 03:31:10 +0000 (19:31 -0800)]
Change RacyGitTests to create a racy git situation in a stable way

By using File#setLastModified, we can create a racy git situation
stably.

Tested with --runs_per_test=100

Bug: 526111
Change-Id: I60b3632d353e19f335668325aa603640be423f58
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
(cherry picked from commit df637928d2ef4b9ee06af7e37344c7848f870ce4)