]> source.dussan.org Git - jgit.git/log
jgit.git
5 years agoAdd FileSnapshot test testing recognition of file size changes 05/141805/14
Matthias Sohn [Wed, 8 May 2019 01:25:53 +0000 (03:25 +0200)]
Add FileSnapshot test testing recognition of file size changes

Change-Id: Ibcd76a5e6e4183ada0be1d4436ce957243f2094d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoCapture reason for result of FileSnapshot#isModified 19/141919/10
Matthias Sohn [Thu, 9 May 2019 22:58:42 +0000 (00:58 +0200)]
Capture reason for result of FileSnapshot#isModified

This allows to verify the expected behavior in
FileSnapshotTest#testSimulatePackfileReplacement and enables extending
FileSnapshot for packfiles to read the packfile's checksum as another
criterion to detect modifications without reading the full content.

Also add another field capturing the result of the last check if
lastModified was racily clean.

Remove unnecessary determination of raciness in the constructor. It was
determined twice in all relevant cases.

Change-Id: I100a2f49d7949693d7b72daa89437e166f1dc107
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoSkip FileSnapshotTest#testSimulatePackfileReplacement on Windows 45/143045/1
Matthias Sohn [Wed, 29 May 2019 21:41:43 +0000 (23:41 +0200)]
Skip FileSnapshotTest#testSimulatePackfileReplacement on Windows

NTFS does not support FileKey hence ignore this test on Windows.

Change-Id: I7b53a591daa5e03eb5e401b5b26d612ab68ce10d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoTune max heap size for tests 94/142894/2
Matthias Sohn [Wed, 22 May 2019 12:42:43 +0000 (14:42 +0200)]
Tune max heap size for tests

This is an attempt to fix crashes observed on the new Jenkins
infrastructure running on Kubernetes [1].

Increase it to 512m for
- org.eclipse.jgit.ant.test
- org.eclipse.jgit.http.test
- org.eclipse.jgit.lfs.server.test
- org.eclipse.jgit.lfs.test
- org.eclipse.jgit.pgm.test

Decrease it to 768m for
- org.eclipse.jgit.test

[1] e.g. https://ci-staging.eclipse.org/jgit/job/stable/job/jgit.gerrit/16074/console

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

5 years agoFix FileSnapshotTest.testNewFileNoWait() to match its javadoc 04/141804/10
Matthias Sohn [Wed, 8 May 2019 01:19:15 +0000 (03:19 +0200)]
Fix FileSnapshotTest.testNewFileNoWait() to match its javadoc

testNewFileNoWait() was identical to testNewFileWithWait() but claims it
doesn't wait at all. Hence remove the waits.

Change-Id: I49b8ca5cb49a43c55fe61870c18c42f32fb4b74d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoObjectDirectory: fix closing of obsolete packs 36/142636/6
Marc Strapetz [Wed, 22 May 2019 21:51:12 +0000 (23:51 +0200)]
ObjectDirectory: fix closing of obsolete packs

This resolves a regression introduced in fef78212.

Change-Id: Ibb4521635a87012520566efc70870c59d11be874
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
5 years agoInclude filekey file attribute when comparing FileSnapshots 48/141748/12
Matthias Sohn [Tue, 7 May 2019 21:55:54 +0000 (23:55 +0200)]
Include filekey file attribute when comparing FileSnapshots

Due to finite filesystem timestamp resolution the last modified
timestamp of files cannot detect file changes which happened in the
immediate past (less than one filesystem timer tick ago).

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

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

Bug: 546891
Change-Id: I711a80328c55e1a31171d540880b8e80ec1fe095
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMeasure file timestamp resolution used in FileSnapshot 08/141608/17
Matthias Sohn [Sun, 5 May 2019 01:18:23 +0000 (03:18 +0200)]
Measure file timestamp resolution used in FileSnapshot

FileSnapshot.notRacyClean() assumed a worst case filesystem timestamp
resolution of 2.5 sec (FAT has a resolution of 2 sec). Instead measure
timestamp resolution to avoid unnecessary IO caused by false positives
in detecting the racy git problem caused by finite filesystem timestamp
resolution [1].

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

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

Measured Java file timestamp resolution: [2]

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

Bug: 546891
Change-Id: I493f3b57b6b306285ffa7d392339d253e5966ab8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix FileSnapshot's consideration of file size 47/141747/4
Matthias Sohn [Wed, 8 May 2019 00:36:30 +0000 (02:36 +0200)]
Fix FileSnapshot's consideration of file size

* fix equals() and hashCode() methods to consider size
* fix toString() to show size

Change-Id: I5485db55eda5110121efd65d86c7166b3b2e93d0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix API problem filters 65/142565/1
Matthias Sohn [Wed, 22 May 2019 06:03:29 +0000 (08:03 +0200)]
Fix API problem filters

Change-Id: I566391d7c51875f30cf580d64e6784819985709f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.1.8-SNAPSHOT builds 06/140906/1
Matthias Sohn [Sat, 20 Apr 2019 08:51:17 +0000 (10:51 +0200)]
Prepare 5.1.8-SNAPSHOT builds

Change-Id: I331bbaefd42ef94673ae8565c9b2b3af9eadfda0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.1.7.201904200442-r 04/140904/1 v5.1.7.201904200442-r
Matthias Sohn [Sat, 20 Apr 2019 08:42:58 +0000 (10:42 +0200)]
JGit v5.1.7.201904200442-r

Change-Id: Ifaa3a88c5e117912a8c691b8b8369dd9a17faebb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoObjectUploadListener: Add callback interface 46/140646/4
David Pursehouse [Tue, 16 Apr 2019 04:12:15 +0000 (13:12 +0900)]
ObjectUploadListener: Add callback interface

The callback interface is invoked after object upload was
completed.

Change-Id: I705d8becaf4f35188caf098aa75cff8963d64a60
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-5.0' into stable-5.1 99/140899/2
Matthias Sohn [Fri, 19 Apr 2019 10:40:27 +0000 (12:40 +0200)]
Merge branch 'stable-5.0' into stable-5.1

* stable-5.0:
  Prepare 4.11.9-SNAPSHOT builds
  JGit v4.11.8.201904181247-r
  Prepare 4.9.11-SNAPSHOT builds
  JGit v4.9.10.201904181027-r
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: I685d8a797209bc1b9c1bb9caba40ac8713c6ce5b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.11' into stable-5.0 65/140865/1
Matthias Sohn [Fri, 19 Apr 2019 10:35:26 +0000 (12:35 +0200)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Prepare 4.11.9-SNAPSHOT builds
  JGit v4.11.8.201904181247-r
  Prepare 4.9.11-SNAPSHOT builds
  JGit v4.9.10.201904181027-r
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: I9b7f9faf3dc584068456f1ae2cacc4ce5137d4ad
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 4.11.9-SNAPSHOT builds 63/140863/1
Matthias Sohn [Fri, 19 Apr 2019 10:05:01 +0000 (12:05 +0200)]
Prepare 4.11.9-SNAPSHOT builds

Change-Id: Ie0ef10159bac6daf4db3f68e8c0825bc1608e40f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v4.11.8.201904181247-r 41/140841/1 v4.11.8.201904181247-r
Matthias Sohn [Thu, 18 Apr 2019 16:47:14 +0000 (18:47 +0200)]
JGit v4.11.8.201904181247-r

Change-Id: I0356bde8fbb789faa74ed3635046f4fd0dce28de
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.10' into stable-4.11 40/140840/1
Matthias Sohn [Thu, 18 Apr 2019 16:44:23 +0000 (18:44 +0200)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Prepare 4.9.11-SNAPSHOT builds
  JGit v4.9.10.201904181027-r
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: Ib2a170e24bddad0e8c9c7be6688269f6318bf30f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.9' into stable-4.10 39/140839/1
Matthias Sohn [Thu, 18 Apr 2019 16:42:45 +0000 (18:42 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Prepare 4.9.11-SNAPSHOT builds
  JGit v4.9.10.201904181027-r
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: I94c9e6300b5f77b185ec6661fa76f0c74a5fc2a9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 4.9.11-SNAPSHOT builds 38/140838/1
Matthias Sohn [Thu, 18 Apr 2019 16:05:43 +0000 (18:05 +0200)]
Prepare 4.9.11-SNAPSHOT builds

Change-Id: I99137bc4958167773d2fc8b1d48fbb508af52be5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v4.9.10.201904181027-r 36/140836/1 v4.9.10.201904181027-r
Matthias Sohn [Thu, 18 Apr 2019 14:26:30 +0000 (16:26 +0200)]
JGit v4.9.10.201904181027-r

Change-Id: I3034d1ad263fdfb23347304f866309354930fd19
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.8' into stable-4.9 17/140817/1
Matthias Sohn [Thu, 18 Apr 2019 12:43:23 +0000 (14:43 +0200)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: Idaa789e699f1ef568ea957184d0641355d9e3181

5 years agoMerge branch 'stable-4.7' into stable-4.8 21/140721/1 stable-4.8
Matthias Sohn [Tue, 16 Apr 2019 22:49:03 +0000 (00:49 +0200)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: I7984f68833f2d615399296e53cb9a64e5b4ca6ed
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 4.7.10-SNAPSHOT builds 20/140720/1 stable-4.7
Matthias Sohn [Tue, 16 Apr 2019 22:18:13 +0000 (00:18 +0200)]
Prepare 4.7.10-SNAPSHOT builds

Change-Id: I662ee441521c1370a31f274cc6d001723ad0c528
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v4.7.9.201904161809-r 18/140718/1 v4.7.9.201904161809-r
Matthias Sohn [Tue, 16 Apr 2019 22:08:39 +0000 (00:08 +0200)]
JGit v4.7.9.201904161809-r

Change-Id: Id6e379c3ce52c83455e37cbc3d77db0e188fdb85
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.6' into stable-4.7 17/140717/1
Matthias Sohn [Tue, 16 Apr 2019 21:53:21 +0000 (23:53 +0200)]
Merge branch 'stable-4.6' into stable-4.7

* stable-4.6:
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: I6ea51dde6608a4163d681aa1ebf710f06da44b21
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.5' into stable-4.6 16/140716/1 stable-4.6
Matthias Sohn [Mon, 15 Apr 2019 23:04:52 +0000 (01:04 +0200)]
Merge branch 'stable-4.5' into stable-4.6

* stable-4.5:
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: I0b4eaa521ebdea83ab18c05915d691c07a575a7d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 4.5.8-SNAPSHOT builds 42/140642/1 stable-4.5
Matthias Sohn [Mon, 15 Apr 2019 22:34:19 +0000 (00:34 +0200)]
Prepare 4.5.8-SNAPSHOT builds

Change-Id: I70628cb8fcad0a60598dc937abbed63606a78599
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v4.5.7.201904151645-r 29/140629/1 v4.5.7.201904151645-r
Matthias Sohn [Mon, 15 Apr 2019 20:46:38 +0000 (22:46 +0200)]
JGit v4.5.7.201904151645-r

Change-Id: I3e32cf13f5cb99d8e570412d80d941740399c07d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoRemember the cause for invalidating a packfile 88/140288/7
Luca Milanesio [Tue, 9 Apr 2019 09:44:06 +0000 (10:44 +0100)]
Remember the cause for invalidating a packfile

Keep track of the original cause for a packfile invalidation.
It is needed for the sysadmin to understand if there is a real
underlying filesystem problem and repository corruption or if it is
simply a consequence of a concurrency of Git operations (e.g. repack
or GC).

Change-Id: I06ddda9ec847844ec31616ab6d17f153a5a34e33
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix API problem filters 96/140396/1
Matthias Sohn [Wed, 10 Apr 2019 12:05:57 +0000 (14:05 +0200)]
Fix API problem filters

Change-Id: I96e0ddc34251348ec4877c9d94b045eb1c53e758
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix pack files scan when filesnapshot isn't modified 07/140207/4
Luca Milanesio [Mon, 8 Apr 2019 12:26:12 +0000 (13:26 +0100)]
Fix pack files scan when filesnapshot isn't modified

Do not reload packfiles when their associated filesnapshot is not
modified on disk compared to the one currently stored in memory.

Fix the regression introduced by fef78212 which, in conjunction with
core.trustfolderstats = false, caused any lookup of objects inside
the packlist to loop forever when the object was not found in the pack
list.

Bug: 546190
Change-Id: I38d752ebe47cefc3299740aeba319a2641f19391
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.0' into stable-5.1 44/139244/1
Matthias Sohn [Thu, 21 Mar 2019 15:07:11 +0000 (16:07 +0100)]
Merge branch 'stable-5.0' into stable-5.1

* stable-5.0:
  Fix GC to delete empty fanout directories after repacking

Change-Id: I5c0e7d59f137c27e4588f20f4472d3ea450cd59c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.11' into stable-5.0 42/139242/1
Matthias Sohn [Thu, 21 Mar 2019 14:55:39 +0000 (15:55 +0100)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Fix GC to delete empty fanout directories after repacking

Change-Id: Idce894a24e126e0fbe7bc9b6a3c64318f1a8eb75
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.10' into stable-4.11 40/139240/1
Matthias Sohn [Thu, 21 Mar 2019 14:35:18 +0000 (15:35 +0100)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Fix GC to delete empty fanout directories after repacking

Change-Id: I7118b9c668dcbb0f5435cc613e964c557bfebf01
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.9' into stable-4.10 38/139238/1
Matthias Sohn [Thu, 21 Mar 2019 14:06:47 +0000 (15:06 +0100)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Fix GC to delete empty fanout directories after repacking

Change-Id: Ibdbfe08eb290286fa738010bad1c604e857885cd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix GC to delete empty fanout directories after repacking 18/139118/1
Matthias Sohn [Wed, 20 Mar 2019 12:54:10 +0000 (13:54 +0100)]
Fix GC to delete empty fanout directories after repacking

The prune method did not delete empty fanout directories when loose
objects moved to a new pack file but only when loose unreferenced
objects were pruned.

Change-Id: Ia068f4914c54d9cf9f40b75e8ea50759402b5000
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.1.7-SNAPSHOT builds 20/138620/1
Matthias Sohn [Wed, 13 Mar 2019 06:49:33 +0000 (07:49 +0100)]
Prepare 5.1.7-SNAPSHOT builds

Change-Id: Ica716b2ad18f8390e75466430ef81c86ea06f004
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.1.6.201903130242-r 19/138619/1 v5.1.6.201903130242-r
Matthias Sohn [Wed, 13 Mar 2019 06:41:27 +0000 (07:41 +0100)]
JGit v5.1.6.201903130242-r

Change-Id: Iaf5e451f72dc8512afee99a9f3fb91aa348e3cf5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.0' into stable-5.1 18/138618/1
Matthias Sohn [Wed, 13 Mar 2019 06:37:36 +0000 (07:37 +0100)]
Merge branch 'stable-5.0' into stable-5.1

* stable-5.0:
  Prepare 4.11.8-SNAPSHOT builds
  JGit v4.11.7.201903122105-r
  Prepare 4.9.10-SNAPSHOT builds
  JGit v4.9.9.201903122025-r
  Prepare 4.7.9-SNAPSHOT builds
  JGit v4.7.8.201903121755-r
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: I71771dcc086a9a0097bad74d65ec71ad97106a38
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.11' into stable-5.0 13/138613/1
Matthias Sohn [Wed, 13 Mar 2019 01:21:54 +0000 (02:21 +0100)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Prepare 4.11.8-SNAPSHOT builds
  JGit v4.11.7.201903122105-r
  Prepare 4.9.10-SNAPSHOT builds
  JGit v4.9.9.201903122025-r
  Prepare 4.7.9-SNAPSHOT builds
  JGit v4.7.8.201903121755-r
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: I04c70f66c6f1e53bdc199fb5b24c9136c9a8e4f7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 4.11.8-SNAPSHOT builds 12/138612/1
Matthias Sohn [Wed, 13 Mar 2019 01:13:36 +0000 (02:13 +0100)]
Prepare 4.11.8-SNAPSHOT builds

Change-Id: I92789b0c02e83786961b81556bf2faec5d26b0c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v4.11.7.201903122105-r 11/138611/1 v4.11.7.201903122105-r
Matthias Sohn [Wed, 13 Mar 2019 01:04:31 +0000 (02:04 +0100)]
JGit v4.11.7.201903122105-r

Change-Id: I4fc62c304b5a8452ca72a3b305e5732a26120000
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.10' into stable-4.11 10/138610/1
Matthias Sohn [Wed, 13 Mar 2019 00:55:10 +0000 (01:55 +0100)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Prepare 4.9.10-SNAPSHOT builds
  JGit v4.9.9.201903122025-r
  Prepare 4.7.9-SNAPSHOT builds
  JGit v4.7.8.201903121755-r
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: Ic66dc00455c05f7627919f682a7221ffeef1629d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.9' into stable-4.10 09/138609/1
Matthias Sohn [Wed, 13 Mar 2019 00:48:06 +0000 (01:48 +0100)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Prepare 4.9.10-SNAPSHOT builds
  JGit v4.9.9.201903122025-r
  Prepare 4.7.9-SNAPSHOT builds
  JGit v4.7.8.201903121755-r
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: Ifcd8ea6a2b59f6f8e9d896d8407cfcaef0a9375d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 4.9.10-SNAPSHOT builds 08/138608/1
Matthias Sohn [Wed, 13 Mar 2019 00:34:49 +0000 (01:34 +0100)]
Prepare 4.9.10-SNAPSHOT builds

Change-Id: I2bdbe822ee623c5f15a26d092136d8602cef06ac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v4.9.9.201903122025-r 07/138607/1 v4.9.9.201903122025-r
Matthias Sohn [Wed, 13 Mar 2019 00:27:02 +0000 (01:27 +0100)]
JGit v4.9.9.201903122025-r

Change-Id: I807d24461b3557eee48294bfaa652b2a13d78113
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.8' into stable-4.9 06/138606/1
Matthias Sohn [Wed, 13 Mar 2019 00:17:47 +0000 (01:17 +0100)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  Prepare 4.7.9-SNAPSHOT builds
  JGit v4.7.8.201903121755-r
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: I9a47153831f8eb10d3cd91b4157cf45385e5b13a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.7' into stable-4.8 05/138605/1
Matthias Sohn [Wed, 13 Mar 2019 00:16:28 +0000 (01:16 +0100)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Prepare 4.7.9-SNAPSHOT builds
  JGit v4.7.8.201903121755-r
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: I1136eaa1590b225ceaf16ba7552af0374253a74e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 4.7.9-SNAPSHOT builds 03/138603/1
Matthias Sohn [Tue, 12 Mar 2019 22:26:43 +0000 (23:26 +0100)]
Prepare 4.7.9-SNAPSHOT builds

Change-Id: I1602a6b811fd9f95e284153b560d8d9f855fae9f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v4.7.8.201903121755-r 01/138601/1 v4.7.8.201903121755-r
Matthias Sohn [Tue, 12 Mar 2019 21:55:42 +0000 (22:55 +0100)]
JGit v4.7.8.201903121755-r

Change-Id: Ia6dbde615671ed09789326aacad1655e7a7a59ad
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.6' into stable-4.7 00/138600/1
Matthias Sohn [Tue, 12 Mar 2019 21:39:53 +0000 (22:39 +0100)]
Merge branch 'stable-4.6' into stable-4.7

* stable-4.6:
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: I3d1544d034783fe0fa1385dfe9b03ad8e9247c63
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.5' into stable-4.6 93/138593/1
Matthias Sohn [Tue, 12 Mar 2019 20:01:55 +0000 (21:01 +0100)]
Merge branch 'stable-4.5' into stable-4.6

* stable-4.5:
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: I029e1797447e6729de68bd89d4d69b324dbb3f5f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 4.5.7-SNAPSHOT builds 84/138584/1
Matthias Sohn [Tue, 12 Mar 2019 19:54:12 +0000 (20:54 +0100)]
Prepare 4.5.7-SNAPSHOT builds

Change-Id: I5c275c542e12746c3d8ecf8462791969f9e89e12
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v4.5.6.201903121547-r 83/138583/1 v4.5.6.201903121547-r
Matthias Sohn [Tue, 12 Mar 2019 19:47:04 +0000 (20:47 +0100)]
JGit v4.5.6.201903121547-r

Change-Id: I5a071ed10e1ac1ab28f992d45cde335c12556a80
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoCheck for packfile validity and fd before reading 44/138444/3
Luca Milanesio [Sun, 10 Mar 2019 22:03:40 +0000 (22:03 +0000)]
Check for packfile validity and fd before reading

When reading from a packfile, make sure that is valid
and has a non-null file-descriptor.

Because of concurrency between a thread invalidating a packfile
and another trying to read it, the read() may result into a NPE
that won't be able to be automatically recovered.

Throwing a PackInvalidException would instead cause the packlist
to be refreshed and the read to eventually succeed.

Bug: 544199
Change-Id: I27788b3db759d93ec3212de35c0094ecaafc2434
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
5 years agoMove throw of PackInvalidException outside the catch 63/138163/5
Luca Milanesio [Wed, 6 Mar 2019 11:30:07 +0000 (11:30 +0000)]
Move throw of PackInvalidException outside the catch

When a packfile is invalid, throw an exception explicitly
outside any catch scope, so that is not accidentally caught
by the generic catch-all cause, which would set the packfile
as valid again.

Flagging an invalid packfile as valid again would have
dangerous consequences such as the corruption of the in-memory
packlist.

Bug: 544199
Change-Id: If7a3188a68d7985776b509d636d5ddf432bec798
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
5 years agoUse FileSnapshot to get lastModified on PackFile 21/138521/2
Luca Milanesio [Tue, 12 Mar 2019 07:00:01 +0000 (07:00 +0000)]
Use FileSnapshot to get lastModified on PackFile

Do not redundantly call File.lastModified() for extracting the
timestamp of the PackFile but rather use consistently the FileSnapshot
which reads all file attributes in a single bulk call.

Change-Id: I932675ae4fe56dcd3833dac249816f097303bb09
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoInclude size when comparing FileSnapshot 00/138200/6
Luca Milanesio [Wed, 6 Mar 2019 17:51:59 +0000 (17:51 +0000)]
Include size when comparing FileSnapshot

Due to finite filesystem timestamp resolution the last modified
timestamp of files cannot detect file changes which happened in the
immediate past (less than one filesystem timer tick ago).

Read and consider file size also, so that differing file size can help
to more accurately detect file changes without reading the file content.
Use bulk read to avoid multiple stat calls to retrieve file attributes.

Change-Id: I974288fff78ac78c52245d9218b5639603f67a46
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoDo not reuse packfiles when changed on filesystem 90/138190/4
Luca Milanesio [Wed, 6 Mar 2019 00:31:45 +0000 (00:31 +0000)]
Do not reuse packfiles when changed on filesystem

The pack reload mechanism from the filesystem works only by name
and does not check the actual last modified date of the packfile.

This lead to concurrency issues where multiple threads were loading
and removing from each other list of packfiles when one of those
was failing the checksum.

Rely on FileSnapshot rather than directly checking lastModified
timestamp so that more checks can be performed.

Bug: 544199
Change-Id: I173328f29d9914007fd5eae3b4c07296ab292390
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
5 years agoSilence API warnings for new API introduced for fixes 60/138560/1
Matthias Sohn [Tue, 12 Mar 2019 13:30:20 +0000 (14:30 +0100)]
Silence API warnings for new API introduced for fixes

Change-Id: I3ea7ff2efd33ca6c780afaef9010cec82780d7fa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.0' into stable-5.1 09/138509/1
Matthias Sohn [Mon, 11 Mar 2019 23:10:51 +0000 (00:10 +0100)]
Merge branch 'stable-5.0' into stable-5.1

* stable-5.0:
  Reduce contention on PackFile.idx() function.

Change-Id: Ic50f375faa757076e2dfd6c25e9e0025482aa3d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.11' into stable-5.0 08/138508/1
Matthias Sohn [Mon, 11 Mar 2019 23:09:34 +0000 (00:09 +0100)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Reduce contention on PackFile.idx() function.

Change-Id: Ib1be8c04c9587c595f7d95df26f7be9b237bda40
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.10' into stable-4.11 07/138507/1
Matthias Sohn [Mon, 11 Mar 2019 23:08:13 +0000 (00:08 +0100)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Reduce contention on PackFile.idx() function.

Change-Id: I5dd7576018ab2e85d77d336f97c8e77ad71520c9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.9' into stable-4.10 06/138506/1
Matthias Sohn [Mon, 11 Mar 2019 23:05:55 +0000 (00:05 +0100)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Reduce contention on PackFile.idx() function.

Change-Id: I277e53aa752c8ffb8560de710d27ecb58871ec02
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoReduce contention on PackFile.idx() function. 99/138499/1
Juergen Denner [Tue, 15 Jan 2019 12:22:54 +0000 (13:22 +0100)]
Reduce contention on PackFile.idx() function.

In case of concurrent pack file access, threads may wait on the idx()
function even for already open files. This happens especially with a
slow file system.

Performance numbers are listed in the bug report.

Bug: 543739
Change-Id: Iff328d347fa65ae07ecce3267d44184161248978
Signed-off-by: Juergen Denner <j.denner@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.0' into stable-5.1 33/138133/1
David Pursehouse [Wed, 6 Mar 2019 05:16:07 +0000 (14:16 +0900)]
Merge branch 'stable-5.0' into stable-5.1

* stable-5.0:
  Fix error log message in ObjectDirectory.handlePackError()
  Properly format pack checksums in PackFile.idx()
  Cancel gc if thread was interrupted
  PackFile: report correct message for checksum mismatch
  ObjectDirectory: Clean up logging
  Bazel: Stop using native.git_repository
  ObjectDirectory: extra logging on packfile exceptions

Change-Id: I056f41f619a1bb22ca6be75ec21c32c1f6d4fd2f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-4.11' into stable-5.0 32/138132/1
David Pursehouse [Wed, 6 Mar 2019 05:15:23 +0000 (14:15 +0900)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Fix error log message in ObjectDirectory.handlePackError()
  Properly format pack checksums in PackFile.idx()
  Cancel gc if thread was interrupted
  PackFile: report correct message for checksum mismatch
  ObjectDirectory: Clean up logging
  Bazel: Stop using native.git_repository
  ObjectDirectory: extra logging on packfile exceptions

Change-Id: If75b149e693005dd3fe06b523e6e6784bedf44c1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-4.10' into stable-4.11 31/138131/1
David Pursehouse [Wed, 6 Mar 2019 05:14:29 +0000 (14:14 +0900)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Fix error log message in ObjectDirectory.handlePackError()
  Properly format pack checksums in PackFile.idx()
  Cancel gc if thread was interrupted
  PackFile: report correct message for checksum mismatch
  ObjectDirectory: Clean up logging
  Bazel: Stop using native.git_repository
  ObjectDirectory: extra logging on packfile exceptions

Change-Id: I9052e318b5d920770f7c7121d36e3c58df9d5f5a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-4.9' into stable-4.10 30/138130/1
David Pursehouse [Wed, 6 Mar 2019 05:13:35 +0000 (14:13 +0900)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Fix error log message in ObjectDirectory.handlePackError()
  Properly format pack checksums in PackFile.idx()
  Cancel gc if thread was interrupted
  PackFile: report correct message for checksum mismatch
  ObjectDirectory: Clean up logging
  Bazel: Stop using native.git_repository
  ObjectDirectory: extra logging on packfile exceptions

Change-Id: I0847251eb010616a705e0b91df4bdebc225fa95d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoFix error log message in ObjectDirectory.handlePackError() 27/138127/1
Matthias Sohn [Mon, 4 Mar 2019 12:44:24 +0000 (13:44 +0100)]
Fix error log message in ObjectDirectory.handlePackError()

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

5 years agoProperly format pack checksums in PackFile.idx() 26/138126/1
Matthias Sohn [Mon, 4 Mar 2019 12:28:25 +0000 (13:28 +0100)]
Properly format pack checksums in PackFile.idx()

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

5 years agoCancel gc if thread was interrupted 25/138125/1
Matthias Sohn [Thu, 6 Jul 2017 22:58:28 +0000 (00:58 +0200)]
Cancel gc if thread was interrupted

see
https://groups.google.com/d/msg/repo-discuss/oDB2rl3doDc/tFEh5Xt0CAAJ

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

5 years agoPackFile: report correct message for checksum mismatch 24/138124/1
Luca Milanesio [Sat, 23 Feb 2019 21:57:09 +0000 (21:57 +0000)]
PackFile: report correct message for checksum mismatch

When the packfile checksum does not match the expected one
report the correct checksum error instead of reporting that
the number of objects is incorrect.

Change-Id: I040f36dacc4152ae05453e7acbf8dfccceb46e0d
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit 436c99ce5946f31f06b8704b1fd33136f39dc814)

5 years agoObjectDirectory: Clean up logging 23/138123/1
David Pursehouse [Sun, 24 Feb 2019 23:35:12 +0000 (08:35 +0900)]
ObjectDirectory: Clean up logging

Externalize the message and log the pack file with absolute path.

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

5 years agoBazel: Stop using native.git_repository 22/138122/1
David Pursehouse [Sun, 3 Mar 2019 04:14:46 +0000 (13:14 +0900)]
Bazel: Stop using native.git_repository

The native.git_repository method doesn't work in the latest version
of bazel, and causes the build to fail with:

  type 'struct' has no method git_repository()

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

5 years agoObjectDirectory: extra logging on packfile exceptions 21/138121/1
Luca Milanesio [Mon, 11 Feb 2019 07:49:43 +0000 (07:49 +0000)]
ObjectDirectory: extra logging on packfile exceptions

Display extra logging, including the exception with the associated
stacktrace, whenever a packFile can't be read and thus removed
from the packlist.

Change-Id: I97a4e31dc427bfcc0baae438dcbe2dcd4704b824
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
(cherry picked from commit 962babc4b27ffd90058fe7734f17ed1c4e77d958)

5 years agoFix error log message in ObjectDirectory.handlePackError() 90/137990/1
Matthias Sohn [Mon, 4 Mar 2019 12:44:24 +0000 (13:44 +0100)]
Fix error log message in ObjectDirectory.handlePackError()

Change-Id: I154f392ad025c4b642eb1123d375a0afaa853885
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoProperly format pack checksums in PackFile.idx() 89/137989/1
Matthias Sohn [Mon, 4 Mar 2019 12:28:25 +0000 (13:28 +0100)]
Properly format pack checksums in PackFile.idx()

Change-Id: Id805850dbe9a3d633168f3056e06ddeafd86f961
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoCancel gc if thread was interrupted 45/137945/1
Matthias Sohn [Thu, 6 Jul 2017 22:58:28 +0000 (00:58 +0200)]
Cancel gc if thread was interrupted

see
https://groups.google.com/d/msg/repo-discuss/oDB2rl3doDc/tFEh5Xt0CAAJ

Change-Id: Ia6d4631c64e065d8b9b09e0b45e7a9ea8ac3f41d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPackFile: report correct message for checksum mismatch 83/137483/3
Luca Milanesio [Sat, 23 Feb 2019 21:57:09 +0000 (21:57 +0000)]
PackFile: report correct message for checksum mismatch

When the packfile checksum does not match the expected one
report the correct checksum error instead of reporting that
the number of objects is incorrect.

Change-Id: I040f36dacc4152ae05453e7acbf8dfccceb46e0d
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoObjectDirectory: Clean up logging 99/137499/3
David Pursehouse [Sun, 24 Feb 2019 23:35:12 +0000 (08:35 +0900)]
ObjectDirectory: Clean up logging

Externalize the message and log the pack file with absolute path.

Change-Id: I019052dfae8fd96ab67da08b3287d699287004cb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoBazel: Stop using native.git_repository 32/137932/1
David Pursehouse [Sun, 3 Mar 2019 04:14:46 +0000 (13:14 +0900)]
Bazel: Stop using native.git_repository

The native.git_repository method doesn't work in the latest version
of bazel, and causes the build to fail with:

  type 'struct' has no method git_repository()

Change-Id: Id6a57369b681c0afe811e9e3740b141fb7fb4653
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoObjectDirectory: extra logging on packfile exceptions 44/136644/2
Luca Milanesio [Mon, 11 Feb 2019 07:49:43 +0000 (07:49 +0000)]
ObjectDirectory: extra logging on packfile exceptions

Display extra logging, including the exception with the associated
stacktrace, whenever a packFile can't be read and thus removed
from the packlist.

Change-Id: I97a4e31dc427bfcc0baae438dcbe2dcd4704b824
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
5 years agoPrepare 5.1.6-SNAPSHOT builds 25/134525/1
Matthias Sohn [Thu, 27 Dec 2018 00:33:05 +0000 (01:33 +0100)]
Prepare 5.1.6-SNAPSHOT builds

Change-Id: If3313d602aa57cfa031ba2c9ec03bd51b464dc19
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.1.5.201812261915-r 24/134524/1 v5.1.5.201812261915-r
Matthias Sohn [Thu, 27 Dec 2018 00:16:15 +0000 (01:16 +0100)]
JGit v5.1.5.201812261915-r

Change-Id: I249a440d1ca1c997343da942ae55fcb27a645b92
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.0' into stable-5.1 16/134516/2
Jonathan Nieder [Wed, 26 Dec 2018 21:24:26 +0000 (13:24 -0800)]
Merge branch 'stable-5.0' into stable-5.1

* stable-5.0:
  UploadPack: Avoid calling AdvertiseRefsHook twice

Change-Id: Ie9ce67921e38fff8338a148c4d9f2776be01d0b0
Signed-off-by: Jonathan Nieder <jrn@google.com>
5 years agoUploadPack: Avoid calling AdvertiseRefsHook twice 15/134515/2
Jonathan Nieder [Wed, 26 Dec 2018 20:40:28 +0000 (12:40 -0800)]
UploadPack: Avoid calling AdvertiseRefsHook twice

The AdvertiseRefsHook can be called twice if the following conditions
hold:

 1. This AdvertiseRefsHook doesn't set this.refs.
 2. getAdvertisedOrDefaultRefs is called after getFilteredRefs.

For example, this can happen when fetchV2 is called after lsRefsV2
when using a stateful bidirectional transport.

The second call does not accomplish anything useful.  Guard it with
'if (!advertiseRefsHookCalled)' to avoid wasted work.

Reported-by: Jonathan Tan <jonathantanmy@google.com>
Change-Id: Ib746582e4ef645b767a5b3fb969596df99ac2ab5
Signed-off-by: Jonathan Nieder <jrn@google.com>
5 years agoPrepare 5.1.5-SNAPSHOT builds 05/134505/1
Matthias Sohn [Tue, 25 Dec 2018 23:55:40 +0000 (00:55 +0100)]
Prepare 5.1.5-SNAPSHOT builds

Change-Id: I3eeb24b01a4f955e7e933238defb42635ebfec7d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.1.4.201812251853-r 04/134504/1 v5.1.4.201812251853-r
Matthias Sohn [Tue, 25 Dec 2018 23:42:14 +0000 (00:42 +0100)]
JGit v5.1.4.201812251853-r

Change-Id: I30ba167bcd8144074553d7446a45fa6be19584fe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUploadPack: Filter refs used for want-ref resolution 57/134457/3
Jonathan Nieder [Wed, 19 Dec 2018 05:00:42 +0000 (21:00 -0800)]
UploadPack: Filter refs used for want-ref resolution

In the longer term, we can add support for this to the
RequestValidator interface.  In the short term, this is a minimal
band-aid to ensure any refs the client requests are visible to the
client.

Change-Id: I0683c7a00e707cf97eef6c6bb782671d0a550ffe
Reported-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUploadPack: Defer want-ref resolution to after parsing 56/134456/3
Jonathan Nieder [Wed, 19 Dec 2018 03:44:39 +0000 (19:44 -0800)]
UploadPack: Defer want-ref resolution to after parsing

ProtocolV2Parser explains:

  // TODO(ifrade): This validation should be done after the
  // protocol parsing. It is not a protocol problem asking for an
  // unexisting ref and we wouldn't need the ref database here.

Do so.  This way all ref database accesses are in one place, in the
UploadPack class.

No user-visible change intended --- this is just to make the code
easier to manipulate.

Change-Id: I68e87dff7b9a63ccc169bd0836e8e8baaf5d1048
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.0' into stable-5.1 55/134455/3
Matthias Sohn [Tue, 25 Dec 2018 22:58:53 +0000 (23:58 +0100)]
Merge branch 'stable-5.0' into stable-5.1

* stable-5.0:
  Call AdvertiseRefsHook for protocol v2
  Prepare 4.11.7-SNAPSHOT builds
  JGit v4.11.6.201812241910-r
  Prepare 4.9.9-SNAPSHOT builds
  JGit v4.9.8.201812241815-r
  UploadPack: Test filtering by AdvertiseRefsHook in stateless transports
  Prepare 4.7.8-SNAPSHOT builds
  JGit v4.7.7.201812240805-r
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: Icdc212bf5be2485d0f8028acf6c62fb8531d0e3c
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoCall AdvertiseRefsHook for protocol v2 54/134454/3
Masaya Suzuki [Tue, 18 Dec 2018 17:20:54 +0000 (09:20 -0800)]
Call AdvertiseRefsHook for protocol v2

AdvertiseRefsHook is used to limit the visibility of the refs in Gerrit.
If this hook is not called, then all refs are treated as visible.

In protocol v2, the hook is not called, causing the server to advertise
all refs.  This bug was introduced in v5.0.0.201805221745-rc1~1^2~9
(Execute AdvertiseRefsHook only for protocol v0 and v1, 2018-05-14).

Even before then, the hook was not called in requests after the
capability advertisement, so in transports like HTTP that do not retain
state between round-trips, the server would advertise all refs in
response to an ls-refs (ls-remote) request.

Fix both cases by using getAdvertisedOrDefaultRefs to retrieve the
advertised refs in lsRefs, ensuring the hook is called in all cases that
use its result.

[jn: backported to stable-5.0; split out from a larger patch that also
 fixes protocol v0; avoided filtering this.refs by ref prefix]

Change-Id: I64bce0e72d15b90baccc235c067e57b6af21b55f
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.11' into stable-5.0 53/134453/3
Matthias Sohn [Tue, 25 Dec 2018 22:27:13 +0000 (23:27 +0100)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Prepare 4.11.7-SNAPSHOT builds
  JGit v4.11.6.201812241910-r
  Prepare 4.9.9-SNAPSHOT builds
  JGit v4.9.8.201812241815-r
  UploadPack: Test filtering by AdvertiseRefsHook in stateless transports
  Prepare 4.7.8-SNAPSHOT builds
  JGit v4.7.7.201812240805-r
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: Ie81284ca6d580b0712c49eec610393d0c0c50203
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 4.11.7-SNAPSHOT builds 97/134497/1
Matthias Sohn [Tue, 25 Dec 2018 00:04:50 +0000 (01:04 +0100)]
Prepare 4.11.7-SNAPSHOT builds

Change-Id: I97dc0f4aeb51c2084f40531ceac84e90bf70608d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v4.11.6.201812241910-r 96/134496/1 v4.11.6.201812241910-r
Matthias Sohn [Mon, 24 Dec 2018 23:56:54 +0000 (00:56 +0100)]
JGit v4.11.6.201812241910-r

Change-Id: I21bfe7a76450184bce43cbe8ebcaa7891e4b12ed
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.10' into stable-4.11 52/134452/3
Matthias Sohn [Mon, 24 Dec 2018 23:49:46 +0000 (00:49 +0100)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Prepare 4.9.9-SNAPSHOT builds
  JGit v4.9.8.201812241815-r
  UploadPack: Test filtering by AdvertiseRefsHook in stateless transports
  Prepare 4.7.8-SNAPSHOT builds
  JGit v4.7.7.201812240805-r
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: I937e9a4547fc10e4de7c887163022d1ab0322d64
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.9' into stable-4.10 51/134451/3
Matthias Sohn [Mon, 24 Dec 2018 23:33:44 +0000 (00:33 +0100)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Prepare 4.9.9-SNAPSHOT builds
  JGit v4.9.8.201812241815-r
  UploadPack: Test filtering by AdvertiseRefsHook in stateless transports
  Prepare 4.7.8-SNAPSHOT builds
  JGit v4.7.7.201812240805-r
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: I2e499f34b1c481af794fa9325b0dfebaccdf3cb0
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 4.9.9-SNAPSHOT builds 95/134495/1
Matthias Sohn [Mon, 24 Dec 2018 23:10:49 +0000 (00:10 +0100)]
Prepare 4.9.9-SNAPSHOT builds

Change-Id: I0f7238ce8f79063a410c85701020ffce2b1234cf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>