]> source.dussan.org Git - jgit.git/log
jgit.git
2 years agoAdd missing @since tags 39/188539/1
Matthias Sohn [Sat, 4 Dec 2021 17:34:48 +0000 (18:34 +0100)]
Add missing @since tags

Change-Id: Iaeca1d6154c1383ebe27b723e8814e262328eb48

2 years agoMerge branch 'stable-5.6' into stable-5.7 38/188538/1
Matthias Sohn [Sat, 4 Dec 2021 17:12:11 +0000 (18:12 +0100)]
Merge branch 'stable-5.6' into stable-5.7

* stable-5.6:
  Add missing @since tag
  Add missing @since tags
  Remove unused import in ApacheSshTest
  Update maven plugins
  Ignore missing javadoc in test bundles
  storage: file: De-duplicate File.exists()+File.isFile()
  RefDirectory.scanRef: Re-use file existence check done in snapshot creation
  FileSnapshot: Lazy load file store attributes cache
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix p2 repository URLs

Change-Id: I53e6cb4b3a34b32d964e486c1ff3d130eed6e406

2 years agoAdd missing @since tag 37/188537/1
Matthias Sohn [Sat, 4 Dec 2021 17:07:09 +0000 (18:07 +0100)]
Add missing @since tag

Change-Id: I665c860696b6981dfec87a60c4eb95060a02436f

2 years agoMerge branch 'stable-5.5' into stable-5.6 36/188536/1
Matthias Sohn [Sat, 4 Dec 2021 16:52:04 +0000 (17:52 +0100)]
Merge branch 'stable-5.5' into stable-5.6

* stable-5.5:
  Add missing @since tags
  Remove unused import in ApacheSshTest
  Update maven plugins
  Ignore missing javadoc in test bundles
  storage: file: De-duplicate File.exists()+File.isFile()
  RefDirectory.scanRef: Re-use file existence check done in snapshot creation
  FileSnapshot: Lazy load file store attributes cache
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix p2 repository URLs

Change-Id: I007e92c12fde8d765b75f103e9d530aa0834b7d7

2 years agoAdd missing @since tags 35/188535/1
Matthias Sohn [Sat, 4 Dec 2021 16:47:48 +0000 (17:47 +0100)]
Add missing @since tags

Change-Id: Id21e626201363dd3d0358bd709765e7fd07a0cbf

2 years agoMerge branch 'stable-5.4' into stable-5.5 34/188534/1
Matthias Sohn [Sat, 4 Dec 2021 08:48:19 +0000 (09:48 +0100)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Remove unused import in ApacheSshTest
  Update maven plugins
  Ignore missing javadoc in test bundles
  storage: file: De-duplicate File.exists()+File.isFile()
  RefDirectory.scanRef: Re-use file existence check done in snapshot creation
  FileSnapshot: Lazy load file store attributes cache
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix p2 repository URLs

Change-Id: I5ce55c6c152a59602fef9fb08c16dedf666444e2

2 years agoMerge branch 'stable-5.3' into stable-5.4 27/188527/1
Matthias Sohn [Sat, 4 Dec 2021 01:16:08 +0000 (02:16 +0100)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Remove unused import in ApacheSshTest
  Update maven plugins
  Ignore missing javadoc in test bundles
  storage: file: De-duplicate File.exists()+File.isFile()
  RefDirectory.scanRef: Re-use file existence check done in snapshot creation
  FileSnapshot: Lazy load file store attributes cache
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix p2 repository URLs

Change-Id: I0e80612c8ddb934466105312f9107e91d581de0b

2 years agoMerge branch 'stable-5.2' into stable-5.3 26/188526/1
Matthias Sohn [Sat, 4 Dec 2021 00:58:53 +0000 (01:58 +0100)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Remove unused import in ApacheSshTest
  Update maven plugins
  Ignore missing javadoc in test bundles
  storage: file: De-duplicate File.exists()+File.isFile()
  RefDirectory.scanRef: Re-use file existence check done in snapshot creation
  FileSnapshot: Lazy load file store attributes cache
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix p2 repository URLs

Change-Id: Id989365446cb55b9188e02e6e1f8cbc8ab71071c

2 years agoRemove unused import in ApacheSshTest 25/188525/1
Matthias Sohn [Sat, 4 Dec 2021 00:40:36 +0000 (01:40 +0100)]
Remove unused import in ApacheSshTest

Change-Id: I55ebddf232369389e717bbf8707f6e785de14bce

2 years agoMerge branch 'stable-5.1' into stable-5.2 24/188524/1
Matthias Sohn [Fri, 3 Dec 2021 23:43:05 +0000 (00:43 +0100)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Update maven plugins
  Ignore missing javadoc in test bundles
  storage: file: De-duplicate File.exists()+File.isFile()
  RefDirectory.scanRef: Re-use file existence check done in snapshot creation
  FileSnapshot: Lazy load file store attributes cache
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix p2 repository URLs

Change-Id: If3ad2cfb6c341b0ff5c2120a5a1646f6368d86e7

2 years agoUpdate maven plugins 20/188520/1
Matthias Sohn [Fri, 3 Dec 2021 21:45:05 +0000 (22:45 +0100)]
Update maven plugins

- build-helper-maven-plugin to 3.2.0
- jacoco-maven-plugin to 0.8.7
- maven-antrun-plugin to 3.0.0
- maven-dependency-plugin to 3.2.0
- maven-enforcer-plugin to 3.0.0
- maven-jar-plugin to 3.2.0
- maven-javadoc-plugin to 3.3.1
- maven-jxr-plugin to 3.1.1
- maven-pmd-plugin to 3.15.0
- maven-project-info-reports-plugin to 3.1.2
- maven-resources-plugin to 3.2.0
- maven-shade-plugin to 3.2.4
- maven-site-plugin to 3.9.1
- maven-source-plugin to 3.2.1
- maven-surefire-plugin to 3.0.0-M5
- spotbugs-maven-plugin to 4.3.0
- tycho and tycho-extras to 1.7.0

Change-Id: I7738fbfd7db60ddbeb372efcb4c72c71112ac231

2 years agoIgnore missing javadoc in test bundles 19/188519/1
Matthias Sohn [Thu, 24 Jun 2021 21:13:51 +0000 (23:13 +0200)]
Ignore missing javadoc in test bundles

Change-Id: I83ed20823dc6b22ff48c2a554acb2f7d3b6067b7
(cherry picked from commit 12f39c26b09bc3ebf1dd0216f56c37c808a53034)

2 years agostorage: file: De-duplicate File.exists()+File.isFile() 13/188513/2
Nasser Grainawi [Fri, 3 Dec 2021 17:05:53 +0000 (10:05 -0700)]
storage: file: De-duplicate File.exists()+File.isFile()

File.isFile() [1] checks if the file exists and is a normal file.

[1] https://docs.oracle.com/javase/8/docs/api/java/io/File.html#isFile--

Change-Id: I0a883f2482ecc5ac58b270351b416742b568eb68
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
2 years agoRefDirectory.scanRef: Re-use file existence check done in snapshot creation 90/188290/2
Kaushik Lingarkar [Mon, 29 Nov 2021 20:14:56 +0000 (12:14 -0800)]
RefDirectory.scanRef: Re-use file existence check done in snapshot creation

Return immediately in scanRef if the loose ref was identified as
missing when a snapshot was attempted for the ref. This will help
performance of scanRef when the ref is packed but has a corresponding
empty dir in 'refs/'.

For example, consider the case where we create 50k sharded refs in
a new namespace called 'new-refs' using an atomic 'BatchRefUpdate'.
The refs are named like 'refs/new-refs/01/1/1', 'refs/new-refs/01/1/2',
'refs/new-refs/01/1/3' and so on. After the refs are created, the
'new-refs' namespace looks like below:

$ find refs/new-refs -type f | wc -l
0

$ find refs/new-refs -type d | wc -l
5101

At this point, an 'exactRef' call on each of the 50k refs without
this change takes ~2.5s, where as with this change it takes ~1.5s.

Change-Id: I926bc41b9ae89a1a792b1b5ec9a17b05271c906b
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
2 years agoFileSnapshot: Lazy load file store attributes cache 10/187910/9
Kaushik Lingarkar [Thu, 18 Nov 2021 21:12:17 +0000 (13:12 -0800)]
FileSnapshot: Lazy load file store attributes cache

Doing a getFileStoreAttributes call even when the file doesn't
exist is unnecessary. This call is particularly slow on some
filesystems. Instead, do it only when the file exists and load
the appropriate cache.

This update can help speed up RefDirectory.exactRef when the ref
is packed, but has a corresponding empty dir for it under 'refs/'.
This scenario can happen when an atomic 'BatchRefUpdate' creates
new sharded refs.

For example, consider the case where we create 50k sharded refs in
a new namespace called 'new-refs' using an atomic 'BatchRefUpdate'.
The refs are named like 'refs/new-refs/01/1/1', 'refs/new-refs/01/1/2',
'refs/new-refs/01/1/3' and so on. After the refs are created, the
'new-refs' namespace looks like below:

$ find refs/new-refs -type f | wc -l
0

$ find refs/new-refs -type d | wc -l
5101

At this point, an 'exactRef' call on each of the 50k refs without
this change takes ~30s, where as with this change it takes ~2.5s.

Change-Id: I4a5d4c6a652dbeed1f4bc3b4f2b2f1416f7ca0e7
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
2 years agoUpdate eclipse-jarsigner-plugin to 1.3.2 56/188456/1
Matthias Sohn [Mon, 20 Sep 2021 22:18:03 +0000 (00:18 +0200)]
Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: Id5d05d96c392913de7b4451421c2ffb7b63ab83f
(cherry picked from commit c70c0acb4752f00672e3b856539587e4977bfaea)

2 years agoFix p2 repository URLs 49/188449/1
Matthias Sohn [Thu, 2 Dec 2021 08:56:07 +0000 (09:56 +0100)]
Fix p2 repository URLs

- the old jetty releases were moved to the archive server
- use https
- use eclipse 4.9 release repository

Change-Id: I2ca20dd828a9272a383e166e6ad82390415891cf

3 years agoMerge branch 'stable-5.6' into stable-5.7 96/186296/1
Matthias Sohn [Thu, 7 Oct 2021 22:18:42 +0000 (00:18 +0200)]
Merge branch 'stable-5.6' into stable-5.7

* stable-5.6:
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: I1c18f5f435f4a4a86e0548a310dbfc74191e1ed5

3 years agoreftable: drop code for truncated reads 02/185902/4
Han-Wen Nienhuys [Tue, 28 Sep 2021 18:05:03 +0000 (20:05 +0200)]
reftable: drop code for truncated reads

The reftable format is a block based format, but allows for variably
sized blocks. This obviously happens for reflog blocks (which are zlib
compressed), but is also accepted for index blocks: In the spec, this
is motivated as

     To achieve constant O(1) disk seeks for lookups the index must be
     a single level, which is permitted to exceed the file's
     configured block size, but not the format's max block size of
     15.99 MiB.

Hence, when parsing a block, one cannot be sure of its exact size:
after reading a default-size block (eg. 4kb), the block header may
state that the block is in fact larger.

Before, the code would mark the block as `truncated`, noting

     // Its OK during sequential scan for an index block to have been
     // partially read and be truncated in-memory. This happens when
     // the index block is larger than the file's blockSize. Caller
     // will break out of its scan loop once it sees the blockType.

This looks like either

* a remnant of never-implemented functionality. There is no reason to
  ever sequentially scan an index block.

* alluding to sequential scan of the data blocks before the index
  blocks (eg. scanning refs, which ends when we find the first ref index
  block, and we can then ignore the index block).

This comment is followed by code that populates the
restartTbl/restartCnt fields relative to the (possibly truncated)
buffer. If the buffer is truncated, this essentially reads garbage,
leading to OOB array access when using the index block.

Fix this by dropping the truncated logic and issuing a second read if
the first read was short.

Add a test.

We have never observed this failure scenario at Google. We use 64kb
blocksize, which requires us to need fewer index entries. The reftable
spec mentions an Android repo of size 36M. With 64kb blocks, that's
just 562 index entries. Even with historical growth, we are long from
requiring an index whose size exceeds a single block.

When adding the analogous test for seeking refs, there was no failure.
This points to another possibility which is that the code tries to
avoid writing large index blocks for refs.

I did not investigate further which one it is.

Fixes https://bugs.eclipse.org/bugs/show_bug.cgi?id=576250

Bug: 576250
Change-Id: I41ec21fac9e526ef57b3d6fb57b988bd353ee338
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
3 years agoreftable: pass on invalid object ID in conversion 56/185856/2
Han-Wen Nienhuys [Mon, 27 Sep 2021 14:07:27 +0000 (16:07 +0200)]
reftable: pass on invalid object ID in conversion

Before, while trying to determine if an object ID was a tag or not,
the reftable conversion would yield an exception.

Change-Id: I3688a0ffa9e774ba27f320e3840ff8cada21ecf0

3 years agoUpdate eclipse-jarsigner-plugin to 1.3.2 54/185754/1
Matthias Sohn [Mon, 20 Sep 2021 22:18:03 +0000 (00:18 +0200)]
Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: Id5d05d96c392913de7b4451421c2ffb7b63ab83f
(cherry picked from commit c70c0acb4752f00672e3b856539587e4977bfaea)

3 years agoMerge branch 'stable-5.6' into stable-5.7 79/183479/1
Thomas Wolf [Thu, 29 Jul 2021 11:08:01 +0000 (13:08 +0200)]
Merge branch 'stable-5.6' into stable-5.7

* stable-5.6:
  [test] Create keystore with the keytool of the running JDK
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: I1f6b4fc26f6ee6f22cc0aacd032c1e73ba246dbc
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoMerge branch 'stable-5.5' into stable-5.6 78/183478/1
Thomas Wolf [Thu, 29 Jul 2021 11:06:56 +0000 (13:06 +0200)]
Merge branch 'stable-5.5' into stable-5.6

* stable-5.5:
  [test] Create keystore with the keytool of the running JDK

Change-Id: Icb0bb6dc4ad05b1f3eb562547893f2e0aedf8775
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoMerge branch 'stable-5.4' into stable-5.5 77/183477/1
Thomas Wolf [Thu, 29 Jul 2021 11:05:59 +0000 (13:05 +0200)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  [test] Create keystore with the keytool of the running JDK

Change-Id: I5ff3dc1c771aeb33af39eb68f166c7282b478cf8
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoMerge branch 'stable-5.3' into stable-5.4 76/183476/1
Thomas Wolf [Thu, 29 Jul 2021 11:05:20 +0000 (13:05 +0200)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  [test] Create keystore with the keytool of the running JDK

Change-Id: If92372b7bfbfb9445fcb934c48dc1cd6610e061b
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoMerge branch 'stable-5.2' into stable-5.3 75/183475/1
Thomas Wolf [Thu, 29 Jul 2021 11:03:56 +0000 (13:03 +0200)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  [test] Create keystore with the keytool of the running JDK

Change-Id: I981de862c614986a7b443fed1cce7b895b758682
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoMerge branch 'stable-5.1' into stable-5.2 74/183474/1
Thomas Wolf [Thu, 29 Jul 2021 11:02:16 +0000 (13:02 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  [test] Create keystore with the keytool of the running JDK

Change-Id: Ic56f4f23c37432377be88e07d06c5ad75591d84f
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years ago[test] Create keystore with the keytool of the running JDK 71/183471/1
Thomas Wolf [Sun, 25 Jul 2021 13:44:35 +0000 (15:44 +0200)]
[test] Create keystore with the keytool of the running JDK

Call keytool with the absolute path of "java.home". Otherwise a keytool
for a different, maybe even newer Java version might be picked up, and
then the keystore may not be readable by the JVM used to run the tests.

(cherry picked from commit 2d73c702d3e9128b7dc03a01fe2cf18f119d3ffe)

Change-Id: Iea77024947a34267f008847d81312fe0abadc615
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoReachabilityCheckerTestCase: fix reachable from self test case 55/182055/1
Han-Wen Nienhuys [Wed, 16 Jun 2021 15:41:24 +0000 (17:41 +0200)]
ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: I8f94a0a0ff401f1691b3757002756b4e83dd8640
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
3 years agoMerge branch 'stable-5.6' into stable-5.7 79/181879/1
Matthias Sohn [Sun, 13 Jun 2021 21:52:46 +0000 (23:52 +0200)]
Merge branch 'stable-5.6' into stable-5.7

* stable-5.6:
  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: I4570cce185877cb4c50eee519a1cf9467a766dea

3 years agoMerge branch 'stable-5.5' into stable-5.6 79/181479/5
Matthias Sohn [Sun, 6 Jun 2021 08:45:57 +0000 (10:45 +0200)]
Merge branch 'stable-5.5' into stable-5.6

* stable-5.5:
  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: I504483a4dc979c5e7af18bad45dc18675e32afd2

3 years agoMerge branch 'stable-5.4' into stable-5.5 78/181478/1
Matthias Sohn [Sat, 5 Jun 2021 20:49:56 +0000 (22:49 +0200)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  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: If5232b68d3e25df7b71e417cbcbb39476e925f22

3 years agoMerge branch 'stable-5.3' into stable-5.4 77/181477/1
Matthias Sohn [Sat, 5 Jun 2021 20:49:07 +0000 (22:49 +0200)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  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: I1338fc79a7be6b77fb28df511dd7504fb19b6d1a

3 years agoMerge branch 'stable-5.2' into stable-5.3 76/181476/1
Matthias Sohn [Sat, 5 Jun 2021 20:48:01 +0000 (22:48 +0200)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  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: I7838f7d237a3598bf55995426d7ba1de146cb6ad

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.6' into stable-5.7 95/180495/1
Matthias Sohn [Tue, 11 May 2021 21:32:22 +0000 (23:32 +0200)]
Merge branch 'stable-5.6' into stable-5.7

* stable-5.6:
  Remove texts which were added by mistake in 00386272
  Fix formatting which was broken in 00386272

Change-Id: I45d444b360485564744bf3dfad2c2f5a5e7fcdf6

3 years agoRemove texts which were added by mistake in 00386272 87/180487/1
Matthias Sohn [Tue, 11 May 2021 16:37:37 +0000 (18:37 +0200)]
Remove texts which were added by mistake in 00386272

Change-Id: Iaed25dac0bc9af8f3fda6138a5f9fe553bff5d39
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoFix formatting which was broken in 00386272 86/180486/1
Matthias Sohn [Tue, 11 May 2021 16:36:05 +0000 (18:36 +0200)]
Fix formatting which was broken in 00386272

Change-Id: I10a3e2b117e790f64386a8e9e7663db8e59230d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.6' into stable-5.7 34/180434/1
Matthias Sohn [Mon, 10 May 2021 22:19:10 +0000 (00:19 +0200)]
Merge branch 'stable-5.6' into stable-5.7

* stable-5.6:
  LockFile: create OutputStream only when needed

Change-Id: I7c0e37d2cee0923662a7e39df5a802a84c017e4f

3 years agoLockFile: create OutputStream only when needed 32/180432/1
Thomas Wolf [Tue, 4 May 2021 21:48:56 +0000 (23:48 +0200)]
LockFile: create OutputStream only when needed

Don't create the stream eagerly in lock(); that may cause JGit to
exceed OS or JVM limits on open file descriptors if many locks need
to be created, for instance when creating many refs. Instead create
the output stream only when one really needs to write something.

Bug: 573328
Change-Id: If9441ed40494d46f594a896d34a5c4f56f91ebf4
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoRemove ReftableNumbersNotIncreasingException 10/159910/2
Han-Wen Nienhuys [Mon, 1 Mar 2021 11:17:54 +0000 (12:17 +0100)]
Remove ReftableNumbersNotIncreasingException

In a distributed setting, one can have multiple datacenters use
reftables for serving, while the ground truth for the Ref database is
administered centrally. In this setting, replication delays combined
with compaction can cause update-index ranges to overlap.

Such a setting is used at Google, and the JGit code already handles
this correctly (modulo a bugfix that applied in change I8f8215b99a).

Remove the restriction that was applied at FileReftableDatabase.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I6f9ed0fbd7fbc5220083ab808b22a909215f13a9

3 years agoMerge branch 'stable-5.6' into stable-5.7 32/173232/1
Matthias Sohn [Wed, 2 Dec 2020 14:25:44 +0000 (15:25 +0100)]
Merge branch 'stable-5.6' into stable-5.7

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

Change-Id: If5f001c414e677bb2bac59714421f0191b23ea1f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.5' into stable-5.6 31/173231/1
Matthias Sohn [Wed, 2 Dec 2020 14:21:10 +0000 (15:21 +0100)]
Merge branch 'stable-5.5' into stable-5.6

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

Change-Id: I986029816ef66fbfae1a59bd97179392320a485c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.4' into stable-5.5 30/173230/1
Matthias Sohn [Wed, 2 Dec 2020 14:15:58 +0000 (15:15 +0100)]
Merge branch 'stable-5.4' into stable-5.5

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

Change-Id: Iede8686198332d6271771bef6eb00c25f1103979
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.3' into stable-5.4 27/173227/1
Matthias Sohn [Wed, 2 Dec 2020 13:26:26 +0000 (14:26 +0100)]
Merge branch 'stable-5.3' into stable-5.4

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

Change-Id: I319b54ceffe095add60420c6ae83eac0ba9c14b6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoPrepare 5.3.10-SNAPSHOT builds 25/173225/1
Matthias Sohn [Wed, 2 Dec 2020 12:09:57 +0000 (13:09 +0100)]
Prepare 5.3.10-SNAPSHOT builds

Change-Id: I6f131ad04574bd0d569ae6a59c29ea987be0efb2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoJGit v5.3.9.202012012026-r 89/173189/1 v5.3.9.202012012026-r
Matthias Sohn [Wed, 2 Dec 2020 01:27:44 +0000 (02:27 +0100)]
JGit v5.3.9.202012012026-r

Change-Id: I75e03ef8630d7a369e97be0f797253b968575354
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.2' into stable-5.3 88/173188/1
Matthias Sohn [Wed, 2 Dec 2020 01:18:51 +0000 (02:18 +0100)]
Merge branch 'stable-5.2' into stable-5.3

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

Change-Id: If1d8034b5e0cbc004a11a31b228cb5732efb390d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
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.6' into stable-5.7 13/172913/1
Matthias Sohn [Fri, 27 Nov 2020 02:05:22 +0000 (03:05 +0100)]
Merge branch 'stable-5.6' into stable-5.7

* stable-5.6:
  Remove unused imports
  Silence API warnings
  Remove erraneously merged source features

Change-Id: Iad4da36d82e8a4dad965c0de52910a4ce4e2d2da
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.5' into stable-5.6 12/172912/1
Matthias Sohn [Fri, 27 Nov 2020 02:04:00 +0000 (03:04 +0100)]
Merge branch 'stable-5.5' into stable-5.6

* stable-5.5:
  Remove unused imports
  Silence API warnings
  Remove erraneously merged source features

Change-Id: Ifb6ebe56577719c0dfc6425557130b91e510d5c7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.4' into stable-5.5 11/172911/1
Matthias Sohn [Fri, 27 Nov 2020 01:37:17 +0000 (02:37 +0100)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Remove unused imports
  Silence API warnings
  Remove erraneously merged source features

Change-Id: I25eff574e4c1cd0aef7cf2c685aade2f87fb0409
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoRemove unused imports 05/172905/1
Matthias Sohn [Fri, 27 Nov 2020 01:27:25 +0000 (02:27 +0100)]
Remove unused imports

Change-Id: Id78f4fd7d11a8908f41160a2ab9f3d81b7f771da
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoSilence API warnings 04/172904/1
Matthias Sohn [Fri, 27 Nov 2020 01:26:23 +0000 (02:26 +0100)]
Silence API warnings

Change-Id: I5de476935e79f8f0beefc27885cbc3ffe31c0aed
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoRemove erraneously merged source features 03/172903/1
Matthias Sohn [Fri, 27 Nov 2020 01:20:00 +0000 (02:20 +0100)]
Remove erraneously merged source features

In 5.4 source features were combined into a single feature.

Change-Id: I4055ec805bb036d0f445c8b9b0bb670495a32cc0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.6' into stable-5.7 98/172898/1
Matthias Sohn [Fri, 27 Nov 2020 00:02:49 +0000 (01:02 +0100)]
Merge branch 'stable-5.6' into stable-5.7

* stable-5.6:
  Prepare 5.3.9-SNAPSHOT builds
  JGit v5.3.8.202011260953-r
  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: Ie24d381f295cccfb99068c7ed5817179da29c1db
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.5' into stable-5.6 97/172897/1
Matthias Sohn [Fri, 27 Nov 2020 00:01:17 +0000 (01:01 +0100)]
Merge branch 'stable-5.5' into stable-5.6

* stable-5.5:
  Prepare 5.3.9-SNAPSHOT builds
  JGit v5.3.8.202011260953-r
  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: I00c8ddad0059a20a978743dfb7ad1b513dc7fef6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.4' into stable-5.5 96/172896/1
Matthias Sohn [Thu, 26 Nov 2020 23:40:00 +0000 (00:40 +0100)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Prepare 5.3.9-SNAPSHOT builds
  JGit v5.3.8.202011260953-r
  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: Icc34f809a3bb019d8d640b9bdb71363e617942e2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.3' into stable-5.4 95/172895/1
Matthias Sohn [Thu, 26 Nov 2020 23:29:39 +0000 (00:29 +0100)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Prepare 5.3.9-SNAPSHOT builds
  JGit v5.3.8.202011260953-r
  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: I82576ad0f61cf3ff11b54691b32666c61401ad9b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoPrepare 5.3.9-SNAPSHOT builds 94/172894/1
Matthias Sohn [Thu, 26 Nov 2020 15:30:32 +0000 (16:30 +0100)]
Prepare 5.3.9-SNAPSHOT builds

Change-Id: I69f181453c79cef2b4f43fac38d9836917cdc973
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoJGit v5.3.8.202011260953-r 81/172881/1 v5.3.8.202011260953-r
Matthias Sohn [Thu, 26 Nov 2020 14:52:53 +0000 (15:52 +0100)]
JGit v5.3.8.202011260953-r

Change-Id: I7b128942ef224335f415f867c2d9d5da7498ed8b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.2' into stable-5.3 80/172880/1
Matthias Sohn [Thu, 26 Nov 2020 14:37:19 +0000 (15:37 +0100)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  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: Id9386846a202b5ae98dd602744963f8897ddaa8c

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 agoObjectDirectoryInserter: Open FileOutputStream in try-with-resource 23/164223/1
David Pursehouse [Fri, 5 Jun 2020 05:59:54 +0000 (14:59 +0900)]
ObjectDirectoryInserter: Open FileOutputStream in try-with-resource

Change-Id: Icc569aeefdc79baee5dfb71fb34d881c561dcf52
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoObjectDirectoryInserter: Remove redundant 'throws' declarations 22/164222/1
David Pursehouse [Fri, 5 Jun 2020 05:46:08 +0000 (14:46 +0900)]
ObjectDirectoryInserter: Remove redundant 'throws' declarations

ObjectWritingException and FileNotFoundException are subclasses
of IOException, which is already declared. Error does not need
to be explicitly declared.

Change-Id: I879820a33e10ec3a7ef676adc9c9148d2b3c4b27
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoObjectDirectory: Further clean up insertUnpackedObject 15/164215/1
David Pursehouse [Fri, 5 Jun 2020 02:34:49 +0000 (11:34 +0900)]
ObjectDirectory: Further clean up insertUnpackedObject

- The code to move the file is repeated. Split it out into a
  utility method.

- Remove the catch block for AtomicMoveNotSupportedException which
  is redundant because it's handled in exactly the same way as the
  IOException further down. The only exception we need to explicitly
  handle differently in this block is NoSuchFileException.

- Improve the comments.

Change-Id: Ifc5490953ffb25ecd1c48a06289eccb3f19910c6
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoObjectDirectory: Explicitly handle NoSuchFileException 21/164121/1
David Pursehouse [Thu, 4 Jun 2020 05:07:34 +0000 (14:07 +0900)]
ObjectDirectory: Explicitly handle NoSuchFileException

On the first attempt to move the temp file, NoSuchFileException can
be raised if the destination folder does not exist. Instead of handling
this implicitly in the catch of IOException and then continuing to
create the destination folder and try again, explicitly catch it and
create the destination folder. If any other IOException occurs, treat
it as an unexpected error and return FAILURE.

Subsequently, on the second attempt to move the temp file, if ANY kind
of IOException occurs, also consider this an unexpected error and
return FAILURE.

In both catch blocks for IOException, add logging at ERROR level.

Change-Id: I9de9ee3d2b368be36e02ee1c0daf8e844f7e46c8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoObjectDirectory: Fail immediately when atomic move is not supported 20/164120/1
David Pursehouse [Thu, 4 Jun 2020 04:51:17 +0000 (13:51 +0900)]
ObjectDirectory: Fail immediately when atomic move is not supported

If atomic move is not supported, AtomicMoveNotSupportedException will
be thrown on the first attempt to move the temp file. There is no
point attempting the move operation a second time because it will only
fail for the same reason.

Add an immediate return of FAILURE on the first occasion. Remove the
unnecessary handling of the exception in the second block.

Change-Id: I4658a8b37cfec2d7ef0217c8346e512968d0964c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoMerge branch 'stable-5.6' into stable-5.7 78/161778/1
Matthias Sohn [Wed, 29 Apr 2020 21:21:50 +0000 (23:21 +0200)]
Merge branch 'stable-5.6' into stable-5.7

* stable-5.6:
  Bump Bazel version to 3.1.0

Change-Id: I8a9f39370ab506d9ff5763ed2d05f0d970bbd10b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoBump Bazel version to 3.1.0 99/161699/1
David Pursehouse [Wed, 29 Apr 2020 04:53:45 +0000 (13:53 +0900)]
Bump Bazel version to 3.1.0

Change-Id: Id58d1603846a88be3493165583adca481c026eed
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoBazel: Disable SecurityManagerMissingPermissionsTest test 64/161164/5
David Ostrovsky [Fri, 17 Apr 2020 22:00:32 +0000 (00:00 +0200)]
Bazel: Disable SecurityManagerMissingPermissionsTest test

In Id5376f09f0d a test with dependency on log4j library was added, but
the library was missed to be added to the Bazel build tool chain.

Given that Bazel test runner doesn't suport custom security manager the
test wouldn't pass even if the missing dependency would be added. The
only solution we have for now is to exclude that test from Bazel tool
chain.

Filed a feature request for bazel to support such tests at
https://github.com/bazelbuild/bazel/issues/11146

Bug: 562274
Change-Id: I873a0e09addc583455b68122f66cd3952e485f0e
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.6' into stable-5.7 65/161165/1
Matthias Sohn [Fri, 17 Apr 2020 22:30:15 +0000 (00:30 +0200)]
Merge branch 'stable-5.6' into stable-5.7

* stable-5.6:
  Remove double blank from sentence start
  Bump Bazel version to 3.0.0

Change-Id: I26c3a8345020239d1c2ec5c6f70a633b43ddab86

4 years agoRemove double blank from sentence start 14/161114/1
Michael Keppler [Tue, 14 Apr 2020 07:31:50 +0000 (09:31 +0200)]
Remove double blank from sentence start

Multiple whitespaces are not normalized when reading properties files,
therefore leading to unwanted space/indentation in console or UI output.

Change-Id: I1f5224fe359e0cac493e0237872afc75dc8b9fbe
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
(cherry picked from commit ebbc3efce73278d6e0dbb1acd099db2446b1bed9)

4 years agoBump Bazel version to 3.0.0 67/160567/1
David Pursehouse [Tue, 7 Apr 2020 07:11:42 +0000 (16:11 +0900)]
Bump Bazel version to 3.0.0

Change-Id: I3866b58d3d288f37b1818be5b56d05e8be6ecb0f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoScan through all merged reftables for max/min update indices 20/159920/2
Minh Thai [Fri, 20 Mar 2020 06:10:41 +0000 (23:10 -0700)]
Scan through all merged reftables for max/min update indices

Since reftables might have update index ranges that are overlapped.

Change-Id: I8f8215b99a0a978d4dd0155dbaf33e5e06ea8202
Signed-off-by: Minh Thai <mthai@google.com>
(cherry picked from commit 06748c205c44bb4eaf6015387112de97f566c6a2)

4 years agoMerge branch 'stable-5.6' into stable-5.7 22/160422/1
Thomas Wolf [Fri, 3 Apr 2020 08:18:10 +0000 (10:18 +0200)]
Merge branch 'stable-5.6' into stable-5.7

* stable-5.6:
  FS.runInShell(): handle quoted filters and hooksPath containing blanks
  Handle non-normalized index also for executable files

Change-Id: I240377e87c073ee7a621a88e39fc319c59fa037a
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
4 years agoFS.runInShell(): handle quoted filters and hooksPath containing blanks 05/160405/2
Thomas Wolf [Thu, 2 Apr 2020 19:15:18 +0000 (21:15 +0200)]
FS.runInShell(): handle quoted filters and hooksPath containing blanks

Revert commit 2323d7a. Using $0 in the shell command call results in
the command string being taken literally. That was introduced to fix
a problem with backslashes, but is actually not correct.

First, the problem with backslashes occurred only on Win32/Cygwin,
and has been properly fixed in commit 6f268f8.

Second, this is used only for hooks (which don't have backslashes in
their names) and filter commands from the git config, where the user
is responsible for properly quoting or escaping such that the commands
work.

Third, using $0 actually breaks correctly quoted filter commands
like in the bug report. The shell really takes the command literally,
and then doesn't find the command because of quotes.

So revert this change.

At the same time there's a related problem with hooks. If the path to
the hook contains blanks, runInShell() would also fail to find the
hook. In this case, the command doesn't come from user input but is
just a Java File object with an absolute path containing blanks. (Can
occur if core.hooksPath points to such a path with blanks, or if the
repository has such a path.)

The path to the hook as obtained from the file system must be quoted.

Add a test for a hook path with a blank.

This reverts commit 2323d7a1ef909f9deb3f21329cf30bd1173ee9cf.

Bug: 561666
Change-Id: I4d7df13e6c9b245fe1706e191e4316685a8a9d59
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
4 years agoHandle non-normalized index also for executable files 80/159980/1
Thomas Wolf [Wed, 25 Mar 2020 08:13:20 +0000 (09:13 +0100)]
Handle non-normalized index also for executable files

Commit 60cf85a4 corrected the handling of check-in for files where
the index version is non-normalized, i.e., contains CR-LF line endings.
However, it did so only for regular files, not executable files.

Bug: 561438
Change-Id: I372cc990c5efeb00315460f36459c0652d5d1e77
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
4 years agoPrepare 5.7.1-SNAPSHOT builds 89/159189/1
Matthias Sohn [Wed, 11 Mar 2020 12:35:23 +0000 (13:35 +0100)]
Prepare 5.7.1-SNAPSHOT builds

Change-Id: I29cd1b9872603810f9c4d42424ac326fedf5569f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoJGit v5.7.0.202003110725-r 77/159177/1 v5.7.0.202003110725-r
Matthias Sohn [Wed, 11 Mar 2020 12:24:54 +0000 (13:24 +0100)]
JGit v5.7.0.202003110725-r

Change-Id: Ia4a9122eeb4eea0f379f6611984cfe1143a32f8d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoPrepare 5.7.1-SNAPSHOT builds 75/159075/1
Matthias Sohn [Mon, 9 Mar 2020 22:37:43 +0000 (23:37 +0100)]
Prepare 5.7.1-SNAPSHOT builds

Change-Id: I23748c20b69a1cfb47c5cd0d7858182d376b3ce1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoJGit v5.7.0.202003090808-r 34/159034/1 v5.7.0.202003090808-r
Matthias Sohn [Mon, 9 Mar 2020 13:09:24 +0000 (14:09 +0100)]
JGit v5.7.0.202003090808-r

Change-Id: Ia23bffa3952687f6107d496a8932d54b11c12412
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'master' into stable-5.7 88/158988/1
Matthias Sohn [Sat, 7 Mar 2020 20:09:48 +0000 (21:09 +0100)]
Merge branch 'master' into stable-5.7

* master:
  Silence API errors introduced by 093fbbd1
  Bump Bazel version to 2.2.0
  Add validation to hex decoder
  Expose FileStoreAttributes.setBackground()
  Update reftable storage repo layout
  Add 4.14 and 4.15-staging target platforms
  Update Orbit to R20200224183213 for final 2020-03
  Update Orbit to S20200224183213 for 2020-03 RC1
  Cygwin expects forward slashes for commands to be run via sh.exe
  [releng] Update year in copyright notices for features
  Using for-each loop in jdt
  Make Logger instances final
  Move array designators from the variable to the type
  ObjectWalk: Add null check before skip tree.
  Revert "RevWalk: stop mixing lines of history in topo sort"
  Do not fail if known hosts file does not contain valid host key

Change-Id: Ie7841d917b02c3579c4766e7214d6b1656c5f200