Commit Graph

2254 Commits

Author SHA1 Message Date
Matthias Sohn b513b77477 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>
2019-05-22 08:13:22 +02:00
Matthias Sohn c2945bd261 Prepare 5.1.8-SNAPSHOT builds
Change-Id: I331bbaefd42ef94673ae8565c9b2b3af9eadfda0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-20 10:51:17 +02:00
Matthias Sohn 22e41cfd56 JGit v5.1.7.201904200442-r
Change-Id: Ifaa3a88c5e117912a8c691b8b8369dd9a17faebb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-20 10:42:58 +02:00
Matthias Sohn 08a5d2771d 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>
2019-03-21 16:07:23 +01:00
Matthias Sohn b29bb5cbb0 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>
2019-03-21 15:55:47 +01:00
Matthias Sohn 1a289e3420 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>
2019-03-21 15:35:26 +01:00
Matthias Sohn f06de6b575 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>
2019-03-21 15:07:05 +01:00
Matthias Sohn 534ede2d81 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>
2019-03-20 14:10:30 +01:00
Matthias Sohn 639d53721c Prepare 5.1.7-SNAPSHOT builds
Change-Id: Ica716b2ad18f8390e75466430ef81c86ea06f004
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 07:49:33 +01:00
Matthias Sohn a31756fbfc JGit v5.1.6.201903130242-r
Change-Id: Iaf5e451f72dc8512afee99a9f3fb91aa348e3cf5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 07:41:27 +01:00
Matthias Sohn 6a30ffd033 Prepare 4.11.8-SNAPSHOT builds
Change-Id: I92789b0c02e83786961b81556bf2faec5d26b0c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 02:13:36 +01:00
Matthias Sohn a888f80856 JGit v4.11.7.201903122105-r
Change-Id: I4fc62c304b5a8452ca72a3b305e5732a26120000
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 02:04:31 +01:00
Matthias Sohn 2b64345f53 Prepare 4.9.10-SNAPSHOT builds
Change-Id: I2bdbe822ee623c5f15a26d092136d8602cef06ac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 01:34:49 +01:00
Matthias Sohn c28c3ab9f0 JGit v4.9.9.201903122025-r
Change-Id: I807d24461b3557eee48294bfaa652b2a13d78113
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 01:27:02 +01:00
David Pursehouse 01cf73c7ab 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>
2019-03-06 14:15:36 +09:00
David Pursehouse 3fc9d43339 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>
2019-03-06 14:14:40 +09:00
David Pursehouse ae5ea80363 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>
2019-03-06 14:13:48 +09:00
Matthias Sohn e8bd9556c0 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 882fed0d96)
2019-03-06 02:36:38 +01:00
Matthias Sohn 882fed0d96 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>
2019-03-03 18:35:04 +01:00
Matthias Sohn fafad4196d Prepare 5.1.6-SNAPSHOT builds
Change-Id: If3313d602aa57cfa031ba2c9ec03bd51b464dc19
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-27 01:35:30 +01:00
Matthias Sohn 510011b05c JGit v5.1.5.201812261915-r
Change-Id: I249a440d1ca1c997343da942ae55fcb27a645b92
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-27 01:16:15 +01:00
Matthias Sohn d14209e81b Prepare 5.1.5-SNAPSHOT builds
Change-Id: I3eeb24b01a4f955e7e933238defb42635ebfec7d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-26 00:57:01 +01:00
Matthias Sohn c93aec2b73 JGit v5.1.4.201812251853-r
Change-Id: I30ba167bcd8144074553d7446a45fa6be19584fe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-26 00:53:51 +01:00
Jonathan Nieder 1638a2fce8 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>
2018-12-26 00:39:44 +01:00
Matthias Sohn 23e4765a65 Prepare 4.11.7-SNAPSHOT builds
Change-Id: I97dc0f4aeb51c2084f40531ceac84e90bf70608d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 01:08:03 +01:00
Matthias Sohn cc76de549a JGit v4.11.6.201812241910-r
Change-Id: I21bfe7a76450184bce43cbe8ebcaa7891e4b12ed
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 00:56:54 +01:00
Matthias Sohn 8f1fd09bea Prepare 4.9.9-SNAPSHOT builds
Change-Id: I0f7238ce8f79063a410c85701020ffce2b1234cf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 00:10:49 +01:00
Matthias Sohn 67af2d46dd JGit v4.9.8.201812241815-r
Change-Id: Ic75e4611cce396b186680bc962f0c73b2ee5fff1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 00:01:29 +01:00
David Pursehouse 9372cf496f Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  Fix DescribeCommand with multiple match options
  Fix git-describe tie-breakers

Change-Id: I63e7a56bb617b5ce8774e1dc7f5efdde25e7cd97
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-11-27 20:01:11 +09:00
David Pursehouse 28f0ef8509 Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Fix DescribeCommand with multiple match options
  Fix git-describe tie-breakers

Change-Id: Ibb98f143ee0ce7635beb30ec404b4134a73788f6
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-11-27 19:51:01 +09:00
Matthias Sohn df6263644b Fix DescribeCommand with multiple match options
when multiple match options are given in git describe the result must
not depend on the order of the match options. JGit wrongly picked the
first match using the match options in the order they were defined. Fix
this by concatenating the streams of matching tags for all match options
and then choosing the first match on the concatenated stream sorted in
tie break order.

See https://git-scm.com/docs/git-describe#git-describe---matchltpatterngt

Change-Id: Id01433d35fa16fb4c30526605bee041ac1d954b2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-26 18:49:30 +01:00
Håvard Wall f9de917547 Fix git-describe tie-breakers
Correct behaviour as git 1.7.1.1 is to resolve tie-breakers to choose
the most recent tag.

https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.1.1.txt:
* "git describe" did not tie-break tags that point at the same commit
   correctly; newer ones are preferred by paying attention to the
   tagger date now.

Bug: 538610
Change-Id: Ib0b2a301997bb7f75935baf7005473f4de952a64
Signed-off-by: Håvard Wall <haavardw@gmail.com>
2018-11-09 08:54:44 +01:00
Matthias Sohn b65e247568 Prepare 5.1.4-SNAPSHOT builds
Change-Id: Iee86860f3b4eb9f4af818c60342fd29465c0474c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-20 10:39:16 +02:00
Matthias Sohn cf24983b23 JGit v5.1.3.201810200350-r
Change-Id: Ib2c5a79d4fdf77680b7b65652fc3659527df27ad
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-20 09:50:16 +02:00
Matthias Sohn 9b6d30f2c1 Prepare 4.11.6-SNAPSHOT builds
Change-Id: Ic823775aad59530f516602e7e848474d65763314
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-20 02:08:35 +02:00
Matthias Sohn 92aca6195d JGit v4.11.5.201810191925-r
Change-Id: I9d11536062de74775ca545c26f341610d0ddaeb2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-20 01:27:52 +02:00
Matthias Sohn 7ae004509c Prepare 4.9.8-SNAPSHOT builds
Change-Id: Iab7b0f2a21a76f801a83fbeb54f09d1525878f4d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-20 00:10:02 +02:00
Matthias Sohn 97534056fc JGit v4.9.7.201810191756-r
Change-Id: Ib980731eb9ec7f4c92deac9b4cf2f7a994d670c2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-19 23:58:47 +02:00
Matthias Sohn 2078b23cee Prepare 5.1.3-SNAPSHOT builds
Change-Id: I75c1a01885115fc709ab37f181234264c3f7423a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 18:54:50 +02:00
Matthias Sohn b63870200b JGit v5.1.2.201810061102-r
Change-Id: Id34e4ae12a796460862edc37c5eb072314199bf4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 17:10:45 +02:00
Matthias Sohn dff99a272a Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  Prepare 4.11.5-SNAPSHOT builds
  JGit v4.11.4.201810060650-r
  Fix configuration of maven-javadoc-plugin
  Prepare 4.9.7-SNAPSHOT builds
  JGit v4.9.6.201810051924-r
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

* Fix todos in SubmoduleAddTest

Change-Id: I53272081094b8948a40a1ce409af08b6ef330c1e
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 16:56:12 +02:00
Matthias Sohn 23ebbe5662 Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Prepare 4.11.5-SNAPSHOT builds
  JGit v4.11.4.201810060650-r
  Fix configuration of maven-javadoc-plugin
  Prepare 4.9.7-SNAPSHOT builds
  JGit v4.9.6.201810051924-r
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

* Fix configuration of maven-javadoc-plugin for site generation

Change-Id: Ic6ff8d324867ee41f15a5b890c7eee5092e8453e
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 16:40:46 +02:00
Matthias Sohn 620370ab6a Prepare 4.11.5-SNAPSHOT builds
Change-Id: Ifbe76e14264e8b547930e2320e8e81d728bd6e38
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 14:17:48 +02:00
Matthias Sohn c2a866b109 JGit v4.11.4.201810060650-r
Change-Id: I5700ebd341b6b997a7757b17e7d731c4ce608ec2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 14:05:29 +02:00
Matthias Sohn f016e32471 Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Prepare 4.9.7-SNAPSHOT builds
  JGit v4.9.6.201810051924-r
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

Change-Id: Ibd759f5d425f714e79b3137ff8e5b0f989933de0
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 02:26:05 +02:00
Matthias Sohn c0a973657f Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Prepare 4.9.7-SNAPSHOT builds
  JGit v4.9.6.201810051924-r
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

Change-Id: Ie59e34eb591a827d1ce8e483eec6d390a3c81702
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 01:52:38 +02:00
Matthias Sohn bf7a611dac Prepare 4.9.7-SNAPSHOT builds
Change-Id: I20e7bd6bdebcdb55a8c771314759bd8f98f04ef6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 01:32:40 +02:00
Matthias Sohn 73e6a93ba2 JGit v4.9.6.201810051924-r
Change-Id: Ib39aaae26da17aa37d654b24c1defd45126f4ea2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 01:24:42 +02:00
Matthias Sohn 7d94b446fe Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

Change-Id: Ia7a826399d8d5b8a0eb7169b40e98a6f5c207a4c
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 01:16:08 +02:00
Matthias Sohn a8bd7dcc58 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

Change-Id: Id6fabec4d0b682a7e20a46e88cbc05432efca062
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 01:03:20 +02:00