summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Prepare 4.7.2-SNAPSHOT buildsMatthias Sohn2017-06-0856-321/+321
| | | | | Change-Id: I7c127bd402cd84c68d8f33a32c6aad093a2264c8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.7.1.201706071930-rv4.7.1.201706071930-rMatthias Sohn2017-06-0856-59/+59
| | | | | Change-Id: I28cd8fbe995d76c8a00e7db6ddf826e983d89043 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* ArchiveCommand: Create prefix entry with commit timeYasuhiro Takagi2017-06-052-4/+10
| | | | | | | | | | | | | | | The cgit archive command creates a prefix (root) directory entry in the archive file. That entry's time is set to the commit time. This patch makes jgit's behavior consistent with with cgit: prefix: hoge/ -> creates prefix directory "hoge/" entry. prefix: hoge//// -> creates prefix directory "hoge/" entry. prefix: hoge/foo -> does not create prefix directory entry, but for each file/directory entry, prefix is added. Change-Id: I2610e40ce37972c5f7456fdca6337e7fb07176e5 Signed-off-by: Yasuhiro Takagi <ytakagi@bea.hi-ho.ne.jp>
* Run auto GC in the backgroundDavid Turner2017-06-069-2/+320
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When running an automatic GC on a FileRepository, when the caller passes a NullProgressMonitor, run the GC in a background thread. Use a thread pool of size 1 to limit the number of background threads spawned for background gc in the same application. In the next minor release we can make the thread pool configurable. In some cases, the auto GC limit is lower than the true number of unreachable loose objects, so auto GC will run after every (e.g) fetch operation. This leads to the appearance of poor fetch performance. Since these GCs will never make progress (until either the objects become referenced, or the two week timeout expires), blocking on them simply reduces throughput. In the event that an auto GC would make progress, it's still OK if it runs in the background. The progress will still happen. This matches the behavior of regular git. Git (and now jgit) uses the lock file for gc.log to prevent simultaneous runs of background gc. Further, it writes errors to gc.log, and won't run background gc if that file is present and recent. If gc.log is too old (according to the config gc.logexpiry), it will be ignored. Change-Id: I3870cadb4a0a6763feff252e6eaef99f4aa8d0df Signed-off-by: David Turner <dturner@twosigma.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Cleanup and test trailing slash handling in ManifestParserHan-Wen Nienhuys2017-04-113-13/+155
| | | | | | | | | This is a workaround for https://bugs.openjdk.java.net/browse/JDK-4666701. Change-Id: Idd04657e8d95a841d72230f8881b6b899daadbc2 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* ManifestParser: Throw exception if remote does not have fetch attributeHan-Wen Nienhuys2017-04-104-1/+41
| | | | | | | | | | | | | | In the repo manifest documentation [1] the fetch attribute is marked as "#REQUIRED". If the fetch attribute is not specified, this would previously result in NullPointerException. Throw a SAXException instead. [1] https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.txt Change-Id: Ib8ed8cee6074fe6bf8f9ac6fc7a1664a547d2d49 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Merge branch 'stable-4.6' into stable-4.7David Pursehouse2017-04-090-0/+0
|\ | | | | | | | | | | | | | | | | * stable-4.6: Prepare 4.5.3-SNAPSHOT builds JGit v4.5.2.201704071617-r Change-Id: I5d2044c59af7bc2786fb66ebf5130e412884d74b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * Merge branch 'stable-4.5' into stable-4.6David Pursehouse2017-04-090-0/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.5: Prepare 4.5.3-SNAPSHOT builds JGit v4.5.2.201704071617-r Change-Id: I4e1915d3a88e15c9ef1fb2b470b7f3b821243ff5 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | * Prepare 4.5.3-SNAPSHOT buildsMatthias Sohn2017-04-0856-302/+302
| | | | | | | | | | | | | | | Change-Id: I69681b7a5687ca76bd0dd5d3e7ce2cff841d0e32 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * JGit v4.5.2.201704071617-rv4.5.2.201704071617-rMatthias Sohn2017-04-0756-59/+59
| | | | | | | | | | | | | | | Change-Id: I66402643d7c84c90bf5cefed4d2ec3aa68c94cfb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | PushConnectionTest: Increase maxCommandBytes againDavid Pursehouse2017-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It was already increased in 61a943e, but that was still not enough to take into account the length of snapshot versions. Change-Id: Ib54cec97e97042fe274b87a3a1afa9bb06c8bf19 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | Prepare 4.7.1-SNAPSHOTMatthias Sohn2017-04-0656-323/+323
| | | | | | | | | | | | | | | Change-Id: I16a45035258276217446bccc0ad1b0991383aa0c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | JGit v4.7.0.201704051617-rv4.7.0.201704051617-rMatthias Sohn2017-04-0556-59/+59
| | | | | | | | | | | | | | | Change-Id: Ic2bd6aca0b7a7e0597ffc1f7cf647b49878f9950 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | TarFormat: Use commit time as timestamp for entriesYasuhiro Takagi2017-04-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | This was already done for ZipFormat in 1448ec3. Change-Id: Ie131938a3f640c68718dc793d18dd35be5c71e7c Signed-off-by: Yasuhiro Takagi <ytakagi@bea.hi-ho.ne.jp> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | PushConnectionTest#limitCommandBytes: Increase maxCommandBytesDavid Pursehouse2017-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A higher limit is required to account for proper JGit version number being sent in the UserAgent. The version string "4.7.0.201704031717-r" is 20 characters, however the strings used during development are shorter: - When running from mvn, "4.7.0.qualifier" is used; 15 characters - When running in Eclipse, "unknown" is used; 7 characters Change-Id: I9aca2f71389a42fedce305e9078db016869c3d1a Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | Downgrade Jetty to 9.3.17.v20170317 in Bazel buildDavid Pursehouse2017-04-031-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | Jetty was downgraded on stable-4.6 which doesn't have a Bazel build. Change-Id: Ibeb91436169e852a4241189f80e4895b54ce3cd0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | Merge branch 'stable-4.6'Matthias Sohn2017-04-0215-145/+152
|\| | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.6: Update Jetty to 9.3.17.v20170317 Revert "Update Jetty to 9.4.1.v20170120 in buck build" Revert "Update Jetty to 9.4.1.v20170120" Change-Id: I9193b568cce9c72da899a8f3eaaf833956438e13 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Update Jetty to 9.3.17.v20170317Matthias Sohn2017-04-0216-147/+147
| | | | | | | | | | | | | | | | | | | | | | | | Update to the latest 9.3 version until we have a solution for bug 514336 we face with 9.4.x versions. Change-Id: I6d8d476abe8677ce865a08099bb77330effc700a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Revert "Update Jetty to 9.4.1.v20170120 in buck build"Matthias Sohn2017-04-012-14/+13
| | | | | | | | | | | | | | | | | | This reverts commit d3b80b951c0bf995f7d210710e3d31e9d529efe2. Change-Id: I596ba596f3e857346020e01b0a018d90a0b27edd
| * | Revert "Update Jetty to 9.4.1.v20170120"David Pursehouse2017-03-3115-117/+103
| | | | | | | | | | | | | | | | | | This reverts commit e05caf91f1df86a95d3e0454000d345bb90a415e. Change-Id: Ia4287f130034a790759b5035505a093b4616a05a
* | | Remove unused import from ManifestParserMatthias Sohn2017-03-311-1/+0
| | | | | | | | | | | | Change-Id: Ie60ef9c7bc6ce0fdf017949ebfb9a21753e70506 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Downgrade jetty to 9.3.9.v20160517Matthias Sohn2017-03-3112-129/+129
| | | | | | | | | | | | | | | | | | | | | This works around the problems we faced with jetty 9.4.3.v20170317. Bug: 514336 Change-Id: I7e9dd539414624d71587c55cb436b843949aa296 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Require jetty 9.4.0 consistentlyMatthias Sohn2017-03-304-44/+45
| | | | | | | | | | | | Change-Id: If9de4c0e43850dec46858bd58e9692a7e099cbc3
* | | Document the intended use of RepoCommand#setURI()Han-Wen Nienhuys2017-03-291-3/+8
| | | | | | | | | | | | | | | Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: I4a59dd8278b7b0026094692127b7f55e89c10bae
* | | Noop changes to ManifestParserHan-Wen Nienhuys2017-03-291-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Parse the base URL in ManifestParser construction. This will signal errors earlier. * Simplify stripping of trailing slashes. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: I4a86f68c9d7737f71cf20352cfe26288fbd2b463
* | | Consistently use 'path' for the path to a subrepo in RepoCommandHan-Wen Nienhuys2017-03-271-18/+18
| | | | | | | | | | | | | | | Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: I79ea7eb7b4d319e0100e3121aca5ef82eb8ad92a
* | | Merge branch 'stable-4.6'Matthias Sohn2017-03-276-18/+268
|\| | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.6: Only mark packfile invalid if exception signals permanent problem Don't flag a packfile invalid if opening existing file failed Prepare 4.5.2-SNAPSHOT builds Change-Id: Ife4efad1135d3870a5a0fb71e60b9524fb8777ab Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Merge branch 'stable-4.5' into stable-4.6David Pursehouse2017-03-276-18/+252
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.5: Only mark packfile invalid if exception signals permanent problem Don't flag a packfile invalid if opening existing file failed Prepare 4.5.2-SNAPSHOT builds Change-Id: I20b50981adc54c426666015ff04fe3bb1db9abd9 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | * Only mark packfile invalid if exception signals permanent problemMatthias Sohn2017-03-266-18/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add NoPackSignatureException and UnsupportedPackVersionException to explicitly mark permanent unrecoverable problems with a pack Assume problem with a pack is permanent only if we are sure the exception signals a non-transient problem we can't recover from: - AccessDeniedException: we lack permissions - CorruptObjectException: we detected corruption - EOFException: file ended unexpectedly - NoPackSignatureException: pack has no pack signature - NoSuchFileException: file has gone missing - PackMismatchException: pack no longer matches its index - UnpackException: unpacking failed - UnsupportedPackIndexVersionException: unsupported pack index version - UnsupportedPackVersionException: unsupported pack version Do not attempt to handle Errors since they are thrown for serious problems applications should not try to recover from. Change-Id: I2c416ce2b0e23255c4fb03a3f9a0ee237f7a484a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * Don't flag a packfile invalid if opening existing file failedLuca Milanesio2017-03-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A packfile random file open operation may fail with a FileNotFoundException even if the file exists, possibly for the temporary lack of resources. Instead of managing the FileNotFoundException as any generic IOException it is best to rethrow the exception but prevent the packfile for being flagged as invalid until it is actually opened and read successfully or unsuccessfully. Bug: 514170 Change-Id: Ie37edba2df77052bceafc0b314fd1d487544bf35 Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * Prepare 4.5.2-SNAPSHOT buildsMatthias Sohn2017-03-2556-302/+302
| | | | | | | | | | | | | | | Change-Id: I8485de1f3f63dc9ec445b8fb08093ca144aedc59 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Raise minimum version of o.e.jetty.security to 9.4.0Matthias Sohn2017-03-254-8/+8
| | | | | | | | | | | | | | | | | | | | | This is required since we now use AbstractLoginService which was introduced in Jetty 9.4.0. Change-Id: Iee6e4ae456123099f7a99cc53c5ae02fd43bfa46 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Upgrade error_prone_core to 2.0.19David Pursehouse2017-03-241-1/+1
| | | | | | | | | | | | | | | Change-Id: I019f6e8ce4b074697c2dfc6020b10dc003d0804d Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | PullCommand: Add support for recursing into submodulesDavid Pursehouse2017-03-242-38/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new API method to set the recurse mode, and pass the mode into the fetch command. Extend the existing FetchCommandRecurseSubmodulesTest to also perform the same tests for fetch. Rename the test class accordingly. Change-Id: I12553af47774b4778f7011e1018bd575a7909bd0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | bazel: Consume hamcrest through transitive dependencyDavid Ostrovsky2017-03-232-22/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | In I3ab958ce8 explicit dependency in lib/BUILD were defined and most of the bazel build implementation was switched to using it. Switch test.bzl test implementation to using explicit dependencies as well. Change-Id: I4413d1a45addeeb2a980d07669fa034c2eebb3a4 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* | | Explain in error message how to recover from lock failureMatthias Sohn2017-03-221-1/+1
| | | | | | | | | | | | | | | Bug: 483897 Change-Id: I70f8d9c82c1efe2928f072a2fb69461160f7c5f7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Update orbit to S20170306214312 (Oxygen M6)Matthias Sohn2017-03-227-11/+11
| | | | | | | | | | | | | | | Change-Id: I44d2483c045c126e01751fed9365d4889a30ab2e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge "Update Jetty to 9.4.3.v20170317"Matthias Sohn2017-03-2210-91/+91
|\ \ \
| * | | Update Jetty to 9.4.3.v20170317Matthias Sohn2017-03-2210-91/+91
| | | | | | | | | | | | | | | | Change-Id: I900c74bb76b6cfaee838e6f79d80c9b2840806df Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Merge branch 'stable-4.6'David Pursehouse2017-03-220-0/+0
|\ \ \ \ | |/ / / |/| / / | |/ / | | | | | | | | | | | | * stable-4.6: JGit v4.5.1.201703201650-r Change-Id: I16cac951cdafbe22afe597198fe3b86ecc2437e8 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * | Merge branch 'stable-4.5' into stable-4.6David Pursehouse2017-03-220-0/+0
| |\| | | | | | | | | | | | | | | | | | | | | | * stable-4.5: JGit v4.5.1.201703201650-r Change-Id: Ic9dda2317456308c222928cb8453cb00a231eea1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | * JGit v4.5.1.201703201650-rv4.5.1.201703201650-rMatthias Sohn2017-03-2056-59/+59
| | | | | | | | | | | | | | | Change-Id: I88de7c9f52abbc4921a82208ed74d22aa19fb3cd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Remove Buck buildDavid Pursehouse2017-03-2221-686/+0
| | | | | | | | | | | | | | | | | | Buck will be replaced with Bazel Change-Id: I3cf07d7aaaa2a58bac34e16c50af5416693254ac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Add remaining parts of the bazel buildDavid Ostrovsky2017-03-2112-2/+504
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add bazel build for ui and junit.http, and the test packages. A number of different test labels are supported: api attributes dfs diff http lfs lfs-server nls notes pack patch pgm reftree revplot revwalk storage submodule symlinks transport treewalk util To run all tests: bazel test //... To run specific tests, using labels: bazel test --test_tag_filters=api,dfs,revplot,treewalk //... Change-Id: Ic41b05a79d855212e67b1b4707e9c6b4dc9ea70d Signed-off-by: David Ostrovsky <david@ostrovsky.org> Signed-off-by: Jonathan Nieder <jrn@google.com>
* | | Delegate crypto algorithm creation to InsecureCipherFactoryDavid Ostrovsky2017-03-211-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparation change to Bazel build implementation. Error Prone rejects the code with variable crypto algorithm as insecure see: [1]. [1] http://errorprone.info/bugpattern/InsecureCryptoUsage Change-Id: I92db70a7da454bc364597a995e8be5dccc2d6427 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* | | bazel: Mark junit targets testonlyJonathan Nieder2017-03-193-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only testonly targets (such as tests) need to use junit. In particular this involves making the toplevel :all rule testonly. It's not clear to me what that rule is for --- "bazel build //..." already works to build all targets. In any case it appears to be for testing, so marking it as testonly shouldn't be harmful. Change-Id: I28ff508ab8ce2ec0a0111109110aa9680d30600e
* | | bazel: Add explicit targets for library dependenciesJonathan Nieder2017-03-197-14/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provides a place to declare visibility restrictions and transitive dependencies for each library. Other targets should only declare dependencies on what they directly use, making dependencies easier to maintain. Trim the dependencies of org.eclipse.jgit:jgit to follow that rule. It declares dependencies on Apache httpcomponents and the servlet API but doesn't use them. Tested: * 'bazel build //...' succeeds * applying the change https://gerrit-review.googlesource.com/90843 to a copy of Gerrit, following the instructions there, and running 'bazel test //...' in that copy of Gerrit still succeeds Change-Id: I3ab958ce8b3227019cdbe4cc81e0f042e1541034
* | | Fix test configuration to run RacyGitTests, and fix testRacyGitDetectionDavid Pursehouse2017-03-192-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the filename suffix "Tests", the module was not included in tests when building with Maven, and without the @Test annotations the tests didn't get executed under Eclipse or buck test. testRacyGitDetection was failing because the index file did not exist. Add the missing configuration, the missing annotations, and add a call to reset() in testRacyGitDetection to force creation of the index file. Change-Id: I29dd8f89c36fef4ab40bedce7f4a26bd9b2390e4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | LongObjectIdTest: Remove self comparison testDavid Ostrovsky2017-03-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes test flagged by error prone: LongObjectIdTest.java:294: error: [SelfComparison] An object is compared to itself assertEquals(0, id1.compareTo(id1)); Change-Id: Ife339c92b9570db2471a2fc029b3bfa114044790 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* | | RevFlagSetTest: Fix compilation error flagged by error proneDavid Ostrovsky2017-03-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes error flagged by error prone: Java compilation in rule '//org.eclipse.jgit.test:jgit' failed: Worker process sent response with exit code: 1. org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevFlagSetTest.java:149: error: [CollectionIncompatibleType] Argument '"bob"' should not be passed to this method; its type String is not compatible with its collection's type argument RevFlag assertFalse(set.contains("bob")); Change-Id: I4a971ce92fee55e28b2ab0c7b716ac20fa9c6709 Signed-off-by: David Ostrovsky <david@ostrovsky.org>