Skip to main content
aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-03-13Merge branch 'stable-4.10' into stable-4.11Matthias Sohn6-13/+97
* 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>
2019-03-13Merge branch 'stable-4.9' into stable-4.10Matthias Sohn6-13/+97
* 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>
2019-03-13Prepare 4.9.10-SNAPSHOT buildsMatthias Sohn56-333/+333
Change-Id: I2bdbe822ee623c5f15a26d092136d8602cef06ac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13JGit v4.9.9.201903122025-rv4.9.9.201903122025-rMatthias Sohn56-59/+59
Change-Id: I807d24461b3557eee48294bfaa652b2a13d78113 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13Merge branch 'stable-4.8' into stable-4.9Matthias Sohn6-13/+97
* 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>
2019-03-13Merge branch 'stable-4.7' into stable-4.8Matthias Sohn6-13/+97
* 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>
2019-03-12Prepare 4.7.9-SNAPSHOT buildsMatthias Sohn56-321/+321
Change-Id: I1602a6b811fd9f95e284153b560d8d9f855fae9f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-12JGit v4.7.8.201903121755-rv4.7.8.201903121755-rMatthias Sohn56-59/+59
Change-Id: Ia6dbde615671ed09789326aacad1655e7a7a59ad Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-12Merge branch 'stable-4.6' into stable-4.7Matthias Sohn6-13/+97
* 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>
2019-03-12Merge branch 'stable-4.5' into stable-4.6Matthias Sohn6-13/+113
* 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>
2019-03-12Prepare 4.5.7-SNAPSHOT buildsMatthias Sohn56-302/+302
Change-Id: I5c275c542e12746c3d8ecf8462791969f9e89e12 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-12JGit v4.5.6.201903121547-rv4.5.6.201903121547-rMatthias Sohn56-59/+59
Change-Id: I5a071ed10e1ac1ab28f992d45cde335c12556a80 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-12Check for packfile validity and fd before readingLuca Milanesio1-0/+8
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>
2019-03-12Move throw of PackInvalidException outside the catchLuca Milanesio1-2/+3
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>
2019-03-12Use FileSnapshot to get lastModified on PackFileLuca Milanesio1-1/+1
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>
2019-03-12Include size when comparing FileSnapshotLuca Milanesio5-9/+107
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>
2019-03-12Do not reuse packfiles when changed on filesystemLuca Milanesio2-2/+15
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>
2019-03-12Silence API warnings for new API introduced for fixesMatthias Sohn1-0/+14
Change-Id: I3ea7ff2efd33ca6c780afaef9010cec82780d7fa Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-11Merge branch 'stable-4.10' into stable-4.11Matthias Sohn1-26/+35
* stable-4.10: Reduce contention on PackFile.idx() function. Change-Id: I5dd7576018ab2e85d77d336f97c8e77ad71520c9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-11Merge branch 'stable-4.9' into stable-4.10Matthias Sohn1-26/+35
* stable-4.9: Reduce contention on PackFile.idx() function. Change-Id: I277e53aa752c8ffb8560de710d27ecb58871ec02 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-11Reduce contention on PackFile.idx() function.Juergen Denner1-26/+35
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>
2019-03-06Merge branch 'stable-4.10' into stable-4.11David Pursehouse7-11/+74
* 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-06Merge branch 'stable-4.9' into stable-4.10David Pursehouse7-11/+74
* 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-06Fix error log message in ObjectDirectory.handlePackError()Matthias Sohn2-3/+3
Change-Id: I154f392ad025c4b642eb1123d375a0afaa853885 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> (cherry picked from commit 997d785418d55dce5a1188fdb95e6d2b4ab0bde5)
2019-03-06Properly format pack checksums in PackFile.idx()Matthias Sohn1-2/+3
Change-Id: Id805850dbe9a3d633168f3056e06ddeafd86f961 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> (cherry picked from commit a33e4dc58a87daf34072b82643aba0fd4456c165)
2019-03-06Cancel gc if thread was interruptedMatthias Sohn2-1/+53
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)
2019-03-06PackFile: report correct message for checksum mismatchLuca Milanesio2-6/+7
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)
2019-03-06ObjectDirectory: Clean up loggingDavid Pursehouse3-2/+7
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)
2019-03-06Bazel: Stop using native.git_repositoryDavid Pursehouse1-1/+3
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)
2019-03-06ObjectDirectory: extra logging on packfile exceptionsLuca Milanesio1-0/+2
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)
2018-12-25Prepare 4.11.7-SNAPSHOT buildsMatthias Sohn57-363/+357
Change-Id: I97dc0f4aeb51c2084f40531ceac84e90bf70608d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24JGit v4.11.6.201812241910-rv4.11.6.201812241910-rMatthias Sohn56-59/+59
Change-Id: I21bfe7a76450184bce43cbe8ebcaa7891e4b12ed Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24Merge branch 'stable-4.10' into stable-4.11Matthias Sohn5-16/+109
* 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>
2018-12-24Merge branch 'stable-4.9' into stable-4.10Matthias Sohn4-16/+103
* 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>
2018-12-24Prepare 4.9.9-SNAPSHOT buildsMatthias Sohn56-333/+333
Change-Id: I0f7238ce8f79063a410c85701020ffce2b1234cf Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24JGit v4.9.8.201812241815-rv4.9.8.201812241815-rMatthias Sohn56-59/+59
Change-Id: Ic75e4611cce396b186680bc962f0c73b2ee5fff1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24UploadPack: Test filtering by AdvertiseRefsHook in stateless transportsMasaya Suzuki3-3/+94
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, causing the server to serve commits reachable from branches the client should not be able to access, if asked to via a request naming a guessed object id. Until 3a529361a76e8267467071e0b13ebb36b97d8fb2 (Call AdvertiseRefsHook before validating wants, 2018-12-18), UploadPack would invoke this hook at ref advertisement time but not during negotiation and when serving a pack file. Add a test to avoid regressing. Stateful bidirectional transports were not affected, so the test uses HTTP. [jn: split out when backporting the fix to stable-4.5. The test passes as long as v4.9.0.201710071750-r~169 (fetch: Accept any SHA-1 on lhs of refspec, 2017-06-04) is cherry picked along with it.] Change-Id: I8c017107336adc7cb4c826985779676bf043e648 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>
2018-12-24Merge branch 'stable-4.8' into stable-4.9Matthias Sohn2-14/+10
* stable-4.8: 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: Ib44e314a68bca2349b45f4937257aa1298c8d74b Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24Merge branch 'stable-4.7' into stable-4.8Matthias Sohn1-13/+9
* stable-4.7: 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: I68a21067705b580b40840f8039001ff1e5273c15 Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24Prepare 4.7.8-SNAPSHOT buildsMatthias Sohn57-324/+324
Change-Id: Ic4ab4aae6d87392d1a5a8bbda06384b7a5b64182 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24JGit v4.7.7.201812240805-rv4.7.7.201812240805-rMatthias Sohn56-59/+59
Change-Id: I57b6001b1fbd6042299ccd4dd7d70765a46ea10b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24Merge branch 'stable-4.6' into stable-4.7Matthias Sohn2-15/+11
* stable-4.6: 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: If637694f80dbd1e774d60c672fe78a6500650bb8 Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24Fix feature versions imported by feature org.eclipse.jgit.pgmMatthias Sohn1-2/+2
On stable-4.6 we are currently at version 4.6.2-SNAPSHOT Change-Id: Ia2972d0697c3476850ecf4a3c6691b3987866cd9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24Merge branch 'stable-4.5' into stable-4.6Matthias Sohn1-13/+9
* stable-4.5: Prepare 4.5.6-SNAPSHOT builds JGit v4.5.5.201812240535-r Call AdvertiseRefsHook before validating wants Change-Id: I0fd67ddd9c4966c20d82cdfe78b2f9d4898b4665 Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24Prepare 4.5.6-SNAPSHOT buildsMatthias Sohn56-302/+302
Change-Id: I57c55187ada6d824b94a17f5a79a5bcff61f9ee9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24JGit v4.5.5.201812240535-rv4.5.5.201812240535-rMatthias Sohn56-59/+59
Change-Id: I6e89e937c08757887967d91afb39cfbe8372d6b5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24Call AdvertiseRefsHook before validating wantsMasaya Suzuki1-13/+9
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, causing the server to serve commits reachable from branches the client should not be able to access, if asked to via a request naming a guessed object id. This bug was introduced in v2.0.0.201206130900-r~123 (Modify refs in UploadPack/ReceivePack using a hook interface, 2012-02-08). Stateful bidirectional transports are not affected. Fix it by moving the AdvertiseRefsHook call to getAdvertisedOrDefaultRefs, ensuring the hook is called in all cases. [jn: backported to stable-4.5 by splitting out tests and the protocol v2 specific parts] Change-Id: I159f396216354f2eda3968d17802e166d8c8ec2d 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>
2018-11-26Fix DescribeCommand with multiple match optionsMatthias Sohn2-12/+10
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-09Fix git-describe tie-breakersHåvard Wall2-16/+62
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-10-20Prepare 4.11.6-SNAPSHOT buildsMatthias Sohn56-356/+356
Change-Id: Ic823775aad59530f516602e7e848474d65763314 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>

Back to the top