aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | Merge branch 'master' into stable-7.0Matthias Sohn2024-08-307-161/+22
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: walks: Remove deprecated #createReachabilityChecker() method RepoCommand.RemoteReader: Remove @Deprecated method ReachabilityChecker: Remove @Deprecated method UploadPack: Remove @Deprecated classes and methods ObjectId: Add method to read an ObjectId from a ByteBuffer DfsPackFile: re-add metrics for bitmap index loads Change-Id: I383c9784ced95dfd58f01454fd13b086b180d462
| * | | | | | | walks: Remove deprecated #createReachabilityChecker() methodIvan Frade2024-08-292-41/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: If9375ac49fa82e988e0708d89f0f929495e6e7cc
| * | | | | | | RepoCommand.RemoteReader: Remove @Deprecated methodIvan Frade2024-08-291-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaning up before 7.0 release. Change-Id: I83db715a8170a54957dd5bcf38df5b0911a12107
| * | | | | | | ReachabilityChecker: Remove @Deprecated methodIvan Frade2024-08-291-34/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaning up before 7.0 release. Change-Id: I620c3a485785b3d1efc950317fe552b8465a479e
| * | | | | | | UploadPack: Remove @Deprecated classes and methodsIvan Frade2024-08-291-60/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The coming 7.0 release is a chance to clean up these deprecated classes and methods. Change-Id: I23d263c9244c1e0096eb7c96c290213c9e668a03
| * | | | | | | ObjectId: Add method to read an ObjectId from a ByteBufferIvan Frade2024-08-291-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some storages return data in a convenient ByteBuffer wrapper, but there is no straigh-forward method to read ObjectIds from it. Add ObjectId#fromRaw(ByteBuffer) to read object ids from byte buffers. Change-Id: Ia3b244005e4d9a613294f5ad9dab3b8e7bc3d7df
| * | | | | | | DfsPackFile: re-add metrics for bitmap index loadsSam Delmerico2024-08-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The calculations for readBitmapIdxBytes and readBitmapIdxMicros metrics were unintentionally removed in https://gerrithub.io/c/eclipse-jgit/jgit/+/1177262, so this change adds those metrics back. Change-Id: I7ac7769acd092680933a27b2b3e70dd67690cfbf
* | | | | | | | Remove unused API warning filtersMatthias Sohn2024-08-281-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: If5cfd8963db0699669be3594e844e14d38f97943
* | | | | | | | PackObjectSizeIndexV1: fix boxing warningsMatthias Sohn2024-08-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I25e6194fb8bf09dcac1613cec8349c3893a4f81a
* | | | | | | | Suppress non-externalized string warningsMatthias Sohn2024-08-283-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for texts which don't need to be translatable. Change-Id: Iacac5df9525ddbc9942b7c440450b6aad4864135
* | | | | | | | Prepare 7.0.0-SNAPSHOT buildsMatthias Sohn2024-08-283-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ifa0a549e9551a2016241169e1c1e9052174c49d1
* | | | | | | | JGit v7.0.0.202408271414-rc1v7.0.0.202408271414-rc1Matthias Sohn2024-08-273-4/+4
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: I969947a7c5fef72ed0c2f50e96a60787474f9906
* | | | | | | DfsReaderIoStats: getters to object size index micros/bytesIvan Frade2024-08-271-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These properties of the stats object don't have a getter and it is required to export those values in logs. Change-Id: I7f91a38ee4d02668aff1cbc8424ea669cdb1d2f7
* | | | | | | Merge branch 'stable-6.10'Matthias Sohn2024-08-272-4/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: AmazonS3: Ensure SAXParserFactory sets valid/expected input params LockFile: Retry lock creation if parent dirs were removed Change-Id: I599f698f812e11ae37843cac2333c9971ec30dd8
| * | | | | | AmazonS3: Ensure SAXParserFactory sets valid/expected input paramsMatthias Sohn2024-08-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change Ie8a9d411fc19e8b7bf86c0b4df0b02153a0e9444 broke setting valid/expected input parameters for the XML parser. This can be fixed by calling SaxParserFactory#setNamespaceAware, see [1]. Also see earlier fix in [2]. [1] https://stackoverflow.com/questions/24891323/namespace-handling-with-sax-in-java [2] I05e993032ab3a6afb78634290b578ebc73cf1cbd Bug: jgit-87 Change-Id: Id4e9eebac8d9de81e5d48a608066db3cc862e15c
| * | | | | | LockFile: Retry lock creation if parent dirs were removedKaushik Lingarkar2024-08-211-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the small window between creation of the lock file's parent dirs and the lock file itself, the parent dirs may be cleaned by an external process packing refs in the repository. When this scenario occurs, retry creating the lock file (along with its parent dirs). Change-Id: Id7ec60c3f7f373b59f1dc8de6b8fa6df6bdf2570 Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
* | | | | | | Signing: refactor interfacesThomas Wolf2024-08-2421-732/+761
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a big API-breaking change cleaning up the signing interfaces. Initially, these interfaces were GPG/OpenPGP-specific. When EGit added new signers and signature verifiers that called an external GPG executable, they were found inadequate and were extended to be able to pass in the GpgConfig to get access to the "gpg.program" setting. With the introduction of X.509 S/MIME signing, it was discovered that the interfaces were still not quite adequate, and the "Gpg" prefix on the class names were confusing. Since 7.0 is a major version bump, I'm taking this chance to overhaul these interfaces from ground up. For signing, there is a new Signer interface. With it goes a SignerFactory SPI interface, and a final Signers class managing the currently set signers. By default, signers for the different signature types are created from the signer factories, which are discovered via the ServiceLoader. External code can install its own signers, overriding the default factories. For signature verification, exactly the same mechanism is used. This simplifies the setup of signers and signature verifiers, and makes it all more regular. Signer instances just get a byte[] to sign and don't have to worry about ObjectBuilders at all. SignatureVerifier instances also just get the data and signature as byte[] and don't have to worry about extracting the signature from a commit or tag, or about what kind of signature it is. Both Signers and SignatureVerifiers always get passed the Repository and the GpgConfig. The repository will be needed in an implementation for SSH signatures because gpg.ssh.* configs may need to be loaded explicitly, and some of those values need the current workspace location. For signature verification, there is exactly one place in core JGit in SignatureVerifiers that extracts signatures, determines the signature type, and then calls the right signature verifier. Change RevTag to recognize all signature types known in git (GPG, X509, and SSH). Change-Id: I26d2731e7baebb38976c87b7f328b63a239760d5 Signed-off-by: Thomas Wolf <twolf@apache.org>
* | | | | | | GpgConfig: Add missing @sinceThomas Wolf2024-08-211-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie56e7d8f2defe10a87565056a1763288d5b1e1a6 Signed-off-by: Thomas Wolf <twolf@apache.org>
* | | | | | | DfsReaderIoStats: Order fields and methods consistentlyIvan Frade2024-08-201-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As fields and getters were added, we didn't respect the (hard to see) existing order. Reorder with the following criteria: Methods: xCacheHits() (for all indexes in index order), xCount() (same), xBytes() (same), xMicros() (same). Index order: primary, reverse, bitmap, commit-graph, object-size Change-Id: I28f1d8121070d4357d566e3683947a26ceb3ba04
* | | | | | | Merge branch 'stable-6.10'Matthias Sohn2024-08-203-5/+24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: Update tycho to 4.0.8 Update org.eclipse.dash:license-tool-plugin to 1.1.0 Fix "Comparison of narrow type with wide type in loop condition" RepoProject: read the 'dest-branch' attribute of a project Make RepoProject#setUpstream public RepoCommand: Add error to ManifestErrorException RepoCommand: Copy manifest upstream into .gitmodules ref field RepoProject: read the "upstream" attribute of a project JGit v5.13.3.202401111512-r Change-Id: If67534f8954703e107e8477456325af3d868612c
| * | | | | | Merge branch 'stable-6.9' into stable-6.10Matthias Sohn2024-08-201-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.9: Update tycho to 4.0.8 Update org.eclipse.dash:license-tool-plugin to 1.1.0 Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I68e73b6e0c6cda003bc18b3e82266c1d8a1f183e
| | * | | | | Merge branch 'stable-6.8' into stable-6.9Matthias Sohn2024-08-201-1/+1
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.8: Update tycho to 4.0.8 Update org.eclipse.dash:license-tool-plugin to 1.1.0 Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I29478165b8304316713ffd6a4c6d669dd5760c88
| | | * | | | Merge branch 'stable-6.7' into stable-6.8Matthias Sohn2024-08-201-1/+1
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.7: Update tycho to 4.0.8 Update org.eclipse.dash:license-tool-plugin to 1.1.0 Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I513a1cbb2bfd002d125b04f7944a625ca52decea
| | | | * | | Merge branch 'stable-6.6' into stable-6.7Matthias Sohn2024-08-201-1/+1
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.6: Update tycho to 4.0.8 Update org.eclipse.dash:license-tool-plugin to 1.1.0 Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I79bb467325e5c09d93e0220be8233ba0d91562cb
| | | | | * | Merge branch 'stable-6.5' into stable-6.6Matthias Sohn2024-08-201-1/+1
| | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.5: Update org.eclipse.dash:license-tool-plugin to 1.1.0 Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I54d1776b3ea096d458b8005e70c02e7edef71c2b
| | | | | | * \ Merge branch 'stable-6.4' into stable-6.5stable-6.5Matthias Sohn2024-08-181-1/+1
| | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.4: Update org.eclipse.dash:license-tool-plugin to 1.1.0 Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: Ieae366586ac4c449a4f9454dc4b63513e7573776
| | | | | | | * \ Merge branch 'stable-6.3' into stable-6.4stable-6.4Matthias Sohn2024-08-181-1/+1
| | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: Ia9eefc4004ca01d97ff0c4dae9a6220d48e76b88
| | | | | | | | * \ Merge branch 'stable-6.2' into stable-6.3stable-6.3Matthias Sohn2024-08-141-1/+1
| | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I6bce3a4d64a617d74d0cbf4e79887b067e1ea2c5
| | | | | | | | | * \ Merge branch 'stable-6.1' into stable-6.2stable-6.2Matthias Sohn2024-08-141-1/+1
| | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: Ib536297ef20a75b36cff8f41d57855913f7d7f26
| | | | | | | | | | * \ Merge branch 'stable-6.0' into stable-6.1stable-6.1Matthias Sohn2024-08-141-1/+1
| | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: I23afe07585ff17ad8486cbe2c667f6acbe912542
| | | | | | | | | | | * \ Merge branch 'stable-5.13' into stable-6.0stable-6.0Matthias Sohn2024-08-141-1/+1
| | | | | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: Fix "Comparison of narrow type with wide type in loop condition" JGit v5.13.3.202401111512-r Change-Id: Ib15aa83972d81986959889dc03e943fe55c78873
| | | | | | | | | | | | * | Fix "Comparison of narrow type with wide type in loop condition"stable-5.13Matthias Sohn2024-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This issue was detected by a GitHub CodeQL security scan run on JGit source code. Description of the error raised by the security scan: "In a loop condition, comparison of a value of a narrow type with a value of a wide type may always evaluate to true if the wider value is sufficiently large (or small). This is because the narrower value may overflow. This can lead to an infinite loop." Fix this by using type `long` for the local variable `done`. Change-Id: Ibd4f71299e3f2e40d4331227bd143569a4264d8c
| | | | | | | | | | | | * | JGit v5.13.3.202401111512-rv5.13.3.202401111512-rMatthias Sohn2024-01-113-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: Iacf106ce4013e9e12876e85ae341022a44bccb5c
| | | | | | | | | | | | * | Checkout: better directory handlingThomas Wolf2023-10-229-141/+674
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This backports the upstream security fix to downstream stable-5.13 branch. (cherry picked from commit 9072103f3b3cf64dd12ad2949836ab98f62dabf1) When checking out a file into the working tree ensure that all parent directories of the file below the working tree root are actually directories and do exist before we try to create the file. When multiple files are to be checked out (or even a whole tree), this may check the same directories over and over again. Asking the file system every time for file attributes is a potentially expensive operation. As a remedy, introduce an in-memory cache of directory states for a particular check-out operation. Apply the same fix also in the ResolveMerger, which may also check out files, and also in the PatchApplier. In PatchApplier, also validate paths. Change-Id: Ie12864c54c9f901a2ccee7caddec73027f353111 Signed-off-by: Thomas Wolf <twolf@apache.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | | | | | | | | | | RepoProject: read the 'dest-branch' attribute of a projectKaushik Lingarkar2024-07-083-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The manifest spec [1] defines a "dest-branch" attribute. Parse its value and store it in the RepoProject. Also, create a getter/setter for dest-branch. [1] https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.md#Element-project Change-Id: I8ad83b0fec59d2b0967864e4de4fefde4ab971ff (cherry picked from commit 47fd412affd8d7578606ae9b3015a911b71b13ed)
| * | | | | | | | | | | | | Make RepoProject#setUpstream publicKaushik Lingarkar2024-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applications using JGit such as Gerrit plugins may have their own manifest parsers. They can start using RepoProject to some extent with this change. Eventually, they can be migrated to use the ManifestParser in JGit, however until then, this change can help make the migration incremental. Change-Id: I6a32d4f4622c3842eedf7873cdfed2f1ca998f6f (cherry picked from commit e3e0a1ea35a27e50e0280715a417be7d69fa3345)
| * | | | | | | | | | | | | RepoCommand: Add error to ManifestErrorExceptionIvan Frade2024-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RepoCommand wraps errors in the manifest in a ManifestErrorException with a fixed message ("Invalid manifest"). Callers like supermanifest plugin cannot return a meaningful error to the client without digging into the cause chain. Add the actual error message to the ManifestErrorException, so callers can rely on #getMessage() to see what happens. Change-Id: I18be17fb5e4aaaf4f11ebd627580a91fe330eaca (cherry picked from commit b41187429359cf9830fd34368d28a454653e187d)
| * | | | | | | | | | | | | RepoCommand: Copy manifest upstream into .gitmodules ref fieldIvan Frade2024-07-082-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Project entries in the manifest with a specific sha1 as revision can use the "upstream" field to report the ref pointing to that sha1. This information is very valuable for downstream tools, as they can limit their search for a blob to the relevant ref, but it gets lost in the translation to .gitmodules. Save the value of the upstream field when available/relevant in the ref field of the .gitmodules entry. Change-Id: I14a2395925618d5e6b34be85466e32f5ef8fbf6e (cherry picked from commit 48465f84014904edddcdd48258c67bc19555d4c3)
| * | | | | | | | | | | | | RepoProject: read the "upstream" attribute of a projectIvan Frade2024-07-082-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The manifest spec [1] defines the "upstream" attribute: "name of the git ref in which a sha1 can be found", when the revision is a sha1. The parser is ignoring it, but RepoCommand could use it to populate the "ref=" field of pinned submodules. Parse the value and store it in the RepoProject. RepoProject is public API and the current constructors are not telescopic, so we cannot just add a new constructor with an extra argument. Use plain getter/setters.j [1] https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.md#Element-project Change-Id: Ia50b85b95bfd3710f9fbda2050be5950dd686941 (cherry picked from commit 1dd6324d4b4d9596813b18a44e315295f559ea12)
* | | | | | | | | | | | | | ConfigConstants: Add missing @since 7.0Thomas Wolf2024-08-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1ea31c1f0735b7c8fd09fbedc413d613e4baa803 Signed-off-by: Thomas Wolf <twolf@apache.org>
* | | | | | | | | | | | | | ObjectWalk: Remove duplicated word "the" in class documentationSergey Zakharov2024-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I0ca0b5fc65b5cafc768a053b1de40aea9f14231c
* | | | | | | | | | | | | | Lib: Fix ssh value for gpg.format throwing an IllegalArgumentExceptiongranny2024-07-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git version 2.34 and later supports signing commits and tags with SSH keys. This means gpg.format now supports "ssh" as a value. Change-Id: Iee1e5a68a816bec149a17a73a6916d2884a54163
* | | | | | | | | | | | | | DfsPackFile: Abstract the loading of pack indexesIvan Frade2024-07-301-70/+183
| |_|_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DfsPackFile assumes that the indexes are stored in file streams and their references need to be cached in DFS. This doesn't allow us to experiment other storage options, like key-value databases. In these experiments not all indexes are together in the same storage. Define an interface per index to load it, so implementors can focus on the specifics of their index. Put them together in the IndexFactory interface. The implementation of the IndexFactory chooses the right combination of storages. At the moment we do this only for primary and reverse indexes. Following changes can do the same for other indexes. Change-Id: Icf790d8ba64b34dbe984759f1c6d8ec702554149
* | | | | | | | | | | | | Merge "PackExtBlockCacheTable: spread extensions over multiple dfs tables"Ivan Frade2024-07-304-2/+317
|\ \ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | | PackExtBlockCacheTable: spread extensions over multiple dfs tablesLaura Hamelin2024-07-244-2/+317
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing DfsBlockCache uses a single table for all extensions (idx, ridx, ...). This change introduces an implementation of the table interface that can keep extensions in different cache tables. This selects the appropriate cache to use for a specific PackExt or DfsStreamKey's PackExt type, allowing the separation of entries from different pack types to help limit churn in cache caused by entries of differing sizes. This is especially useful in fine-tuning caches and influencing interactions by extension type. For example, a table holding INDEX types only will not influence evictions of other PackExt types and vice versa. The PackExtBlockCacheTable allowing setting the underlying DfsBlockCacheTables and mappinh directly, letting users implement and use custom DfsBlockCacheTables. Change-Id: Icee7b644ef6b600aa473d35645469d6aa1bce345
* | | | | | | | | | | | | | PackObjectSizeIndex: Read all bytes and use the byte[] directlyIvan Frade2024-07-243-61/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parser reads N integers one by one from the stream, assuming the InputStream does some ahead reading from storage. We see some very slow loading of indexes and suspect that this preemptive reading is not happening. The slow loading can be reproduced in clones, and it produces higher latencies and locks many threads waiting for the loading. Read the whole array from storage in one shot to avoid many small IO reads. Work directly on the resulting byte[], so there is no need of a second copy to cast to int/long. This is how other indexes, like primary or commit graph, work. Change-Id: I60058606e2c457f60aa4646a1f10ae7b28ce34c2
* | | | | | | | | | | | | | DfsPackFile: Do not set local reverse index ref from cache callbackIvan Frade2024-07-161-17/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DfsBlockCache loading callback sets the local reference to the index in the DfsPackFile. This prevents abstracting the loading to implement it over multiple backends. Reorg the code so the loadReverseIndex do only the loading, the caller sets it into DfsBlockCache and the external code sets the local reference in DfsPackFile. This is the same pattern we did with the PackIndex in the parent commit. Change-Id: I3a395b347965fa7b0e5a3398c4da311dc11c58a1
* | | | | | | | | | | | | | Merge changes Id077d58f,Idf61f481Matthias Sohn2024-07-1519-62/+304
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: Add worktrees read support Merge branch 'stable-7.0'
| * | | | | | | | | | | | | Add worktrees read supportJanne Valkealahti2024-07-1419-62/+304
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on deritative work done in Andre's work in [1]. This change focuses on adding support for reading the repository state when branches are checked out using git's worktrees. I've refactored original work by removing all unrelevant changes which were mostly around refactoring to extract i.e. constants which mostly created noise for a review. I've tried to address original review comments: - Not adding non-behavioral changes - "HEAD" should get resolved from gitDir - Reftable recently landed in cgit 2.45, see https://github.com/git/git/blob/master/Documentation/RelNotes/2.45.0.txt#L8 We can add worktree support for reftable in a later change. - Some new tests to read from a linked worktree which is created manually as there's no write support. [1] https://git.eclipse.org/r/c/jgit/jgit/+/163940/18 Change-Id: Id077d58fb6c09ecb090eb09d5dbc7edc351a581d
* | | | | | | | | | | | | | DfsBlockCacheTable: extract stats get* methods to interfaceLaura Hamelin2024-07-153-54/+77
|/ / / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having the DfsBlockCacheTable methods extracted to an interface will allow alternative implementations of BlockCacheStats not tied to the current implementation. Change-Id: I534f7998f46253cdb7a68d5ec21d4f42ea586e8e