aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/internal
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'stable-7.1'Matthias Sohn2024-12-201-5/+126
|\ | | | | | | | | | | | | | | * stable-7.1: WindowCache: share removal work among multiple threads Update target platform version in maven build to 4.32 (2024-06) Change-Id: Ic88bb210c5ea080b7553fadec2a1b8d71924365c
| * Merge branch 'stable-7.0' into stable-7.1Matthias Sohn2024-12-201-5/+126
| |\ | | | | | | | | | | | | | | | | | | | | | * stable-7.0: WindowCache: share removal work among multiple threads Update target platform version in maven build to 4.32 (2024-06) Change-Id: Idd6a8a2c3b5c6f53645dbe7144afb2e1e24e8ca3
| | * Merge branch 'stable-6.10' into stable-7.0Matthias Sohn2024-12-201-5/+126
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: WindowCache: share removal work among multiple threads Update target platform version in maven build to 4.32 (2024-06) Change-Id: I6ca4988e9ea1e9fc6b3382b40f18f3d9db7b7acb
| | | * WindowCache: share removal work among multiple threadsMartin Fick2024-12-191-5/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split the removal process into blocks so that it can be shared by multiple threads. This potential work sharing can provide 2 optimizations for removals: 1) It provides an opportunity for separate removal requests to be consolidated into one removal pass. 2) It can reduce removing thread latencies by sharing the removal work with other removing threads which otherwise might not have any work to do due to their removal request being consolidated. This makes the system more efficient and can actually reduce latencies as system load increases due to pack removals! The optimizations above are all achieved without blockng threads to wait for other threads to complete (although naturally there are some synchronization points), and while ensuring that no threads do more work than if they were the only thread available to perform a removal. Change-Id: Ic6809a8abf056299abde0f0c58c77aaf245a8df5 Signed-off-by: Martin Fick <mfick@nvidia.com>
* | | | Merge branch 'stable-7.1'Matthias Sohn2024-12-153-55/+61
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.1: FileSnapshot: fix warnings Optionally.Hard: avoid Optional creation on every use, Pack: fix threading bug getting idx Fix potential NPE in TreeWalk#getFilterCommandDefinition Advertise "agent" capability when using protocol v2 FileSnapshot: silence "Stale file handle" exceptions Change-Id: I772dd3b3ce7f27e33c1879ce21ec024cc2f9c52a
| * | | Merge branch 'stable-7.0' into stable-7.1Matthias Sohn2024-12-153-53/+56
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: FileSnapshot: fix warnings Optionally.Hard: avoid Optional creation on every use, Pack: fix threading bug getting idx Fix potential NPE in TreeWalk#getFilterCommandDefinition Advertise "agent" capability when using protocol v2 FileSnapshot: silence "Stale file handle" exceptions Change-Id: I4fdea7450f27eebfa7ae08002fd51e67b58bf6bb
| | * | Merge branch 'stable-6.10' into stable-7.0Matthias Sohn2024-12-153-53/+56
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: FileSnapshot: fix warnings Optionally.Hard: avoid Optional creation on every use, Pack: fix threading bug getting idx Fix potential NPE in TreeWalk#getFilterCommandDefinition Advertise "agent" capability when using protocol v2 FileSnapshot: silence "Stale file handle" exceptions Change-Id: Ibe8bf9ad43cb1e56a5a5e4f4d9d5818334b2550a
| | | * FileSnapshot: fix warningsMatthias Sohn2024-12-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - comment empty code block - suppress non-translatable text warning Change-Id: Id49b4a56bbe5454edfe1ea8b79ceeaf51ceac370
| | | * Optionally.Hard: avoid Optional creation on every use,Martin Fick2024-12-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the getOptional() call created an new Optional for its element, and this appears to be somewhat expensive. During a time when a server is heavily loaded because of a poorly maintained repository with potentially 2K+ pack files, calls to Optionally.ofNullable() from within the getOptional() method appeared extensively in the Stacktrace. Reduce the getOptional() call overhead by storing an already created Optional of the element instead of the element itself. This trades the extra space of one extra reference for a potential speed gain in a hotspot. Since the current users of Optionally.Hard reference objects significantly larger than a single reference (and most users are likely to be, else why would they be using an Optionally?), this is likely a good tradeoff. Change-Id: I7adccc915480cbb97a43dcbe074cfb620888c936 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | * Pack: fix threading bug getting idxMartin Fick2024-12-131-46/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When converting to Optionally, a threading bug was introduced, fix it. The Optionally class itself is not thread safe, and previously it was being called from idx() without any thread synchronization mechanism. This was because previously the variable which held the cached index was volatile. The Optionally<PackIndex> kept the volatile attribute, but that only synchronizes the reference to the Optionally, and not the element inside the Optionally. A clear() from another thread could thus be missed by the idx() call, potentially allowing the idx() call to interact poorly with the Optionally, potentially even causing a memory leak. To fix this, extend the synchronized inside the idx() method to the entire method. Then, additionally remove the now redundant Optional fetch in idx() and the no longer needed volatile. Change-Id: I6077e1aaed96c53200805b4c87a67afb49c2b373 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | * FileSnapshot: silence "Stale file handle" exceptionsMartin Fick2024-12-051-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes a FileSystemException with "Stale file handle" can be thrown while creating a FileSnapshot, likely because the file or directory was deleted. Since NoSuchFileExceptions are already silenced, and the FileSnapshot already handles all IOExceptions, there is likely no value in seeing this info in the logs, treat these situation the same and silence them also. Change-Id: I922f4edf2d332cd704e60276f41a76df242f281c Signed-off-by: Martin Fick <mfick@nvidia.com>
* | | | Submodules: use relative paths for worktree and gitdirSimon Eder2024-12-111-4/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently absolute paths are used for a submodules 'worktree' and 'gitdir'. This has drawbacks if a git repository containing submodules is copied to a different location. Enable using relative paths when creating a file-based repository. Add optional relative path support to the clone and init commands, and use it in the submodule commands to generate relative paths. The new implementation mimics the cgit behavior which also uses relative paths instead of absolute ones. Bug: jgit-78 Change-Id: I31c5a938d5cbc030d273fc649c94ee0c90b4ce01
* | | | FileSnapshot: Delete malformed "catch" line (merge artifact?)Ivan Frade2024-12-101-2/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The merge of this file left an empty catch block: error: [EmptyCatch] Caught exceptions should not be ignored Delete the catch, as the exception is a subclass of the FileSystemException catched just under it. Change-Id: I78d6b1ca8152b6eee50a69d24ca987868866ba06
* | | Merge branch 'stable-7.0' into stable-7.1Matthias Sohn2024-12-064-37/+64
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: FileSnapshot: silence "Not a Directory" exceptions FileSnapshot: refactor to share error handling Mark Attribute#getValue as @Nullable Fix potential NPE in ResolveMerger#getAttributesContentMergeStrategy Fix NPE in DiffFormatter#getDiffDriver Pack: ensure packfile is still valid while still recoverable WindowCache: add bulk purge(), call from bulk sites UploadPack#implies: add missing @since tag Disable MergeToolTest#testEmptyToolName Change-Id: Icb25fed5b703c6a39a64231fd8ca93c1f1a581be
| * | Merge branch 'stable-6.10' into stable-7.0Matthias Sohn2024-12-064-37/+64
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: FileSnapshot: silence "Not a Directory" exceptions FileSnapshot: refactor to share error handling Mark Attribute#getValue as @Nullable Fix potential NPE in ResolveMerger#getAttributesContentMergeStrategy Fix NPE in DiffFormatter#getDiffDriver Pack: ensure packfile is still valid while still recoverable WindowCache: add bulk purge(), call from bulk sites UploadPack#implies: add missing @since tag Disable MergeToolTest#testEmptyToolName Change-Id: I854f44e76b73ae434a0d6b6ab782fd0aed72f219
| | * Merge changes I022639c4,I1fcce5ef into stable-6.10Matthias Sohn2024-12-051-15/+20
| | |\ | | | | | | | | | | | | | | | | | | | | * changes: FileSnapshot: silence "Not a Directory" exceptions FileSnapshot: refactor to share error handling
| | | * FileSnapshot: silence "Not a Directory" exceptionsMartin Fick2024-12-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes a FileSystemException with "Not a Directory" can be thrown while creating a FileSnapshot, likely because the file or directory was deleted. Since NoSuchFileExceptions are already silenced, and the FileSnapshot already handles all IOExceptions, there is likely no value in seeing this info in the logs, treat these situation the same and silence them also. Change-Id: I022639c42154a0a4c71065741f023f5eb95f9b55 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | | * FileSnapshot: refactor to share error handlingMartin Fick2024-12-051-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is important to keep the exception handling for getting file attributes the same in all places in this class; put that code into a common method. Change-Id: I1fcce5efd10aa562a4e0e34d3ce94bcc83850237 Signed-off-by: Martin Fick <mfick@nvidia.com>
| | * | Pack: ensure packfile is still valid while still recoverableMartin Fick2024-12-041-1/+7
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When copyAsIs2() needs to send a large object requiring multiple read iterations — any of which could fail if the object isn't already in the WindowCache — verify first that the packfile is still valid at the latest possible moment, just before sending the header that would make recovery impossible. Change-Id: I234fd4b315b579a0506c8fbdea0c6787bdc09fcd Signed-off-by: Martin Fick <mfick@nvidia.com>
| | * WindowCache: add bulk purge(), call from bulk sitesMartin Fick2024-12-023-21/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Purging a Pack from the WindowCache requires a linear search over all the entries in the cache, and thus is rather expensive. Since git gc often deletes more than one packfile at a time, avoid multiplying this expensive operation when possible by purging a Set of Packs when closing deleted pack files during a directory scan. Purge the Set of Packs with a single linear search of the cache. Closing the PackDirectory also cccbngljkihltghcnbiftcubdvgugdcvujkejehbjr Change-Id: Ic9b45cab57e1ef610c2e20ad392d8b45f8091f41 Signed-off-by: Martin Fick <mfick@nvidia.com>
* | | Merge branch 'stable-7.0'Matthias Sohn2024-11-263-143/+162
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: PackDirectory: Filter out tmp GC pack files Test advertised capabilities with protocol V0 and allow*Sha1InWant Align request policies with CGit Pack.java: Recover more often in Pack.copyAsIs2() Change-Id: Iddb994a747bc860dd9286e74190ecdd285ce6832
| * | Merge branch 'stable-6.10' into stable-7.0Matthias Sohn2024-11-263-143/+162
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: PackDirectory: Filter out tmp GC pack files Test advertised capabilities with protocol V0 and allow*Sha1InWant Align request policies with CGit Pack.java: Recover more often in Pack.copyAsIs2() Change-Id: Ib301efa54aaf2196d764a0fc1f91f652b4d68396
| | * Merge "Pack.java: Recover more often in Pack.copyAsIs2()" into stable-6.10Matthias Sohn2024-11-261-142/+153
| | |\
| | | * Pack.java: Recover more often in Pack.copyAsIs2()Martin Fick2024-11-111-142/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PACK class is designed to throw StoredObjectRepresentationNotAvailableException at times when it cannot find an object which previously was believed to be in its packfile and it is still possible for the caller, PackWriter.writeObjectImpl(), to retry copying the object from another file and potentially avoid causing a user facing error for this fairly common expected situation. This retry helps handle when repacking causes a packfile to be replaced by new files with the same objects. Improve copyAsIs2() to drastically make recovery possible in more situations. Once any data for a specific object, has been sent it is very difficult to recover from that object being relocated to another pack. But if a read error is detected in copyAsIs2() before sending the object header (and thus any data), then it should still be recoverable. Fix three places where we could have recovered because we hadn't sent the header yet, and adjust another place to send the header a bit later, after having read some data from the object successfully. Basically, if the header has not been written yet, throw StoredObjectRepresentationNotAvailableException to signal that this is still recoverable. These fixes should drastically improve the chances of recovery since due to unix file semantics, if the partial read succeeds, then the full read will very likely succeed. This is because while the file may no longer be open when the first read is done (the WindowCache may have evicted it), once the first read completes it will likely still be open and even if the file is deleted the WindowCache will continue to be able to read from it until it closes it. Change-Id: Ib87e294e0dbacf71b10db55be511e91963b4a84a Signed-off-by: Martin Fick <mfick@nvidia.com>
| | * | PackDirectory: Filter out tmp GC pack filesMartin Fick2024-11-222-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git repack passes a ".tmp-XXXX-" prefix to git pack-objects when repacking. git pack-objects then adds a "pack-XXXXX.pack" to this to create the name of new packfiles it writes to. PackDirectory was previously very lenient and would allow these files to be added to its list of known packfiles. Fix PackDirectory to filter these out since they are not meant to be consumed yet, and doing so can cause user facing errors. Change-Id: I072e57d9522e02049db17d3f4977df7eda14bba7 Signed-off-by: Martin Fick <mfick@nvidia.com>
* | | | Add pack-refs command to the CLIYash Chaturvedi2024-11-225-42/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This command can be used to optimize storage of references. For a RefDirectory database, it packs non-symbolic, loose refs into packed-refs. By default, only the references under '$GIT_DIR/refs/tags' are packed. The '--all' option can be used to pack all the references under '$GIT_DIR/refs'. For Reftable, all refs are compacted into a single table. Change-Id: I92e786403f8638d35ae3037844a7ad89e8959e02
* | | | Merge branch 'stable-7.0'Matthias Sohn2024-11-211-1/+17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: DiffDriver: fix doc for rust built-in DiffDriver: fix formatting of javadoc Add numberOfObjectsSinceBitmap to RepoStatistics Support built-in diff drivers for hunk header function names Don't fail when trying to prune pack which is already gone Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap Change-Id: I98beec1186132e749a749706f399237de7d7e45e
| * | | Merge branch 'stable-6.10' into stable-7.0Matthias Sohn2024-11-211-5/+21
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: DiffDriver: fix doc for rust built-in DiffDriver: fix formatting of javadoc Add numberOfObjectsSinceBitmap to RepoStatistics Support built-in diff drivers for hunk header function names Don't fail when trying to prune pack which is already gone Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap Change-Id: I7f18e96cc98c56ee7c5e6256fe9e83957e733aa8
| | * | Add numberOfObjectsSinceBitmap to RepoStatisticsJacek Centkowski2024-11-201-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a numberOfObjectsSinceBitmap that contains the number of objects stored in pack files and as loose objects created since the latest bitmap generation. Note that the existing GcNumberOfPackFilesAfterBitmapStatisticsTest.java was renamed to GcSinceBitmapStatisticsTest.java and extended to cover also this statistic. Change-Id: I8ae1db142ddfcd42a5a1d6da01bc67f695562e0e
| | * | Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmapJacek Centkowski2024-11-121-4/+4
| | |/ | | | | | | | | | | | | | | | As sugested in I608011462f1. Change-Id: If66226dd7b08ae768413fa614df5dcb6b44dc118
* | | Suppress non-externalized string warningsMatthias Sohn2024-11-193-11/+9
| | | | | | | | | | | | Change-Id: Ib0737f7ec6b9872f6d4514d140e7d32a4a40809d
* | | Merge branch 'stable-7.0'Matthias Sohn2024-11-121-3/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-7.0: Replace custom encoder Constants#encodeASCII by JDK implementation Replace custom encoder `Constants#encode` by JDK implementation Add `numberOfPackFilesAfterBitmap` to RepoStatistics Enhance CommitBuilder#parent to tolerate null parent Change-Id: I46f961144f2e3c4c57ef0f63a9c8954fee8133e9
| * | Merge branch 'stable-6.10' into stable-7.0Matthias Sohn2024-11-111-1/+12
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.10: Replace custom encoder Constants#encodeASCII by JDK implementation Replace custom encoder `Constants#encode` by JDK implementation Add `numberOfPackFilesAfterBitmap` to RepoStatistics Enhance CommitBuilder#parent to tolerate null parent Change-Id: If05b0d474c728b54cab9af2b7416be30b2754d1b
| | * Add `numberOfPackFilesAfterBitmap` to RepoStatisticsJacek Centkowski2024-11-071-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a `numberOfPackFilesAfterBitmap` that contains the number of packfiles created since the latest bitmap generation. Notes: * the `repo.getObjectDatabase().getPacks()` that obtains the list of packs (in the existing `getStatistics` function) uses `PackDirectory.scanPacks` that boils down to call `PackDirectory.scanPacksImpl` which is sorting packs prior returning them therefore the `numberOfPackFilesAfterBitmap` is just all packs before the one that has bitmap attached * the improved version of `packAndPrune` function (one that skips non-existent packfiles) was introduced for testing Change-Id: I608011462f104fc002ac527aa405f492a8a4b0c2
* | | Merge "DfsBlockCacheConfig: propagate hotmap configs to pack ext cache configs"Ivan Frade2024-11-111-0/+22
|\ \ \
| * | | DfsBlockCacheConfig: propagate hotmap configs to pack ext cache configsLaura Hamelin2024-11-081-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CacheHotMap is currently only set on the base DfsBlockCacheConfig and is not propagated down to PackExt specific caches. Because CacheHotMap is set from a method call rather than from Configs, this change sets per-PackExt CacheHotMap configs on PackExt cache configs both when DfsBlockCacheConfig#setCacheHotMap(...) is called, and when DfsBlockCacheConfig#configure(...) is called after setCacheHotMap. The outer DfsBlockCacheConfig keeps the full CacheHotMap for the same reason that the CacheHotMap config is propagated in both setCacheHotMap and configure: the order of operations setting the configuration from Configs and calling setCacheHotMap is not guaranteed. Change-Id: Id9dc32fedca99ecc83c9dc90c24d9616873a202e
* | | | Merge "Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap"Matthias Sohn2024-11-111-4/+4
|\ \ \ \
| * | | | Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmapJacek Centkowski2024-11-111-4/+4
| |/ / / | | | | | | | | | | | | | | | | | | | | As sugested in I608011462f1. Change-Id: If66226dd7b08ae768413fa614df5dcb6b44dc118
* / / / DfsGarbageCollector: #setReflogExpire with Instant instead of DateIvan Frade2024-11-081-5/+6
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Date API is full of major design flaws and pitfalls and should be avoided at all costs. Prefer the java.time APIs, specifically, java.time.Instant (for physical time) and java.time.LocalDate[Time] (for civil time). [1] Replace the Date with Instant in the DfsGarbageCollector#setReflogExpire method. [1] https://errorprone.info/bugpattern/JavaUtilDate Change-Id: Ie98e426e63621e8bef96c31bca56aec0c8eef5a6
* | | Merge "DfsPackCompactor: write object size index"Ivan Frade2024-11-041-0/+17
|\ \ \
| * | | DfsPackCompactor: write object size indexIvan Frade2024-11-011-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the compactor is not writing the object size index for packs. As it is using PackWriter to generate the packs, it needs to explicitely call the writes of each extension. Invoke writeObjectSizeIndex in the compactor. The pack writer will write one if the configuration says so. Change-Id: I8d6bbbb5bd67bfc7dd511aa76463512b1e86a45d
* | | | [errorprone] Remove deprecated security managerIvan Frade2024-11-011-2/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Errorprone warns about this deprecated classes. The recommendation is stop using SecurityManager all together. The Security Manager is deprecated and subject to removal in a future release. There is no replacement for the Security Manager. See JEP 411 [1] for discussion and alternatives. [1] https://openjdk.org/jeps/411 Change-Id: I3c67136e97d13cf24b85e41d94408631c26e8be8
* | | Merge "DfsGarbageCollector: Add setter for reflog expiration time."Ivan Frade2024-10-311-0/+21
|\ \ \
| * | | DfsGarbageCollector: Add setter for reflog expiration time.Saril Sudhakaran2024-10-311-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JGit reftable writer/compator knows how to prune the history, but the DfsGarbageCollector doesn't expose the time limit. Add a method to DfsGarbageCollector to set the reflog time limit. This value is then passed to the reftable compactor. Callers usually pass here the value from gc.reflogExpire. The reflog block length is stored in 24 bits [1], limiting the size to 16MB. I have observed that in repositories with frequent commits, reflogs hit that size in 6-12 months. [1] https://git-scm.com/docs/reftable Bug: jgit-96 Change-Id: I8b32d6d2b2e1d8af8fb7d9f86225d75f1877eb2f
* | | | [errorprone] PackWriter: Fix javadoc tag in new #writeIndex methodIvan Frade2024-10-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We introduced this method recently and the javadoc is not correct: error: [InvalidInlineTag] This tag is invalid. @code{PackIndexWriter} instance to write the index Change-Id: I34ed3d8b5a121fea9b8163627b46ae4a289c9462
* | | | Merge "PackWriter: make PackWriter.writeIndex() take a PackIndexWriter"Ivan Frade2024-10-294-24/+57
|\ \ \ \
| * | | | PackWriter: make PackWriter.writeIndex() take a PackIndexWriterSam Delmerico2024-10-284-24/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the PackWriter implementation required that indexes and their extensions be writable to an OutputStream with a fixed binary format. To support more general index storage formats, allow PackWriter to accept an PackIndexWriter interface which accepts only the objects to store. This allows implementors to choose their storage format. The implementation will be provided by the DfsObjectDatabase. The DfsObjectDatabase is already responsible for providing the OutputStream that was previously used to write indexes. Having it provide a writing interface would be a natural generalization. This idea was previously implemented for PackBitmapIndex writing in https://gerrithub.io/c/eclipse-jgit/jgit/+/1177722. Change-Id: I582d2f3d25d6adb2da243d6d0d7bc405a97d6183
* | | | | DfsInserter: Read minBytesForObjectSizeIndex only from repo configIvan Frade2024-10-291-21/+7
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In general, JGit reads the configuration it needs from the repository configuration. minBytesForObjectSizeIndex is a special case with a setter for subclasses but that is unnecessary. Remove the setter and read the conf from the repo. Make the property final and read it directly from the conf (it is clearer than parsing a whole PackConfig to read a single value). Change-Id: I8d77247452ff65e6c431fdcfebb90ed2ce40aed1
* | | | dfs: update getBlockCacheStats to return a List of BlockCacheStatsLaura Hamelin2024-10-285-26/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make available all underlying cache table stats for the used cache table implementation. The existing cache table stats implementation only allows a "global" view of the cache table statistics; it does not differentiate between all possible underlying cache tables used. This change allows callers to get the block cache stats broken down per underlying table. These cache stats are intended to be used for monitoring all cache tables independently. Existing usages of getBlockCacheStats now make use of AggregatedBlockCacheStats.fromStatsList to aggregate the list of BlockCacheStats into a single BlockCacheStats instance. Change-Id: I261b3f2849857172397657e5c674b11e09807f27
* | | | Merge changes from topic "ssh-signatures"Matthias Sohn2024-10-231-13/+30
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: SSH signing: implement a SignatureVerifier SSH signing: implement a Signer SSH signing: don't require a session in PasswordProviderWrapper SSH signing: make OpenSSH pattern matching public SSH signing: prepare config ssh: add a factory for KeyPasswordProvider