aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge "PackExtBlockCacheTable: spread extensions over multiple dfs tables"Ivan Frade2024-07-301-0/+588
|\ \
| * | PackExtBlockCacheTable: spread extensions over multiple dfs tablesLaura Hamelin2024-07-241-0/+588
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Add worktrees read supportJanne Valkealahti2024-07-149-22/+215
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "DfsBlockCacheConfig: support configurations for dfs cache tables per ↵Ivan Frade2024-07-121-0/+159
|\ \ | | | | | | | | | extensions"
| * | DfsBlockCacheConfig: support configurations for dfs cache tables per extensionsLaura Hamelin2024-07-121-0/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parse configurations for tables containing a set of extensions, defined in [core "dfs.*"] sections. Parse configurations for cache tables according to configurations defined in [core "dfs.*"] git config sections for sets of extensions. The current [core "dfs"] is the default to any extension not listed in any other table. Configuration falls back to the defaults defined in the DfsBlockCacheConfig.java file when not set on each cache table configuration. Sample format for individual cache tables: In this example: 1. PACK types would go to the "default" table 2. INDEX and BITMAP_INDEX types would go to the "multipleExtensionCache" table 3. REFTABLE types would go to the "reftableCache" table [core "dfs"] // Configuration for the "default" cache table. blockSize = 512 blockLimit = 100 concurrencyLevel = 5 (...) [core "dfs.multipleExtensionCache"] packExtensions = "INDEX BITMAP_INDEX" blockSize = 512 blockLimit = 100 concurrencyLevel = 5 (...) [core "dfs.reftableCache"] packExtensions = "REFTABLE" blockSize = 512 blockLimit = 100 concurrencyLevel = 5 (...) Change-Id: I0e534e6d78b684832e3d3d269cee2590aa0f1911
* | | DfsPackFile: Enable/disable object size index via DfsReaderOptionsIvan Frade2024-07-105-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DfsPackFile always uses the object size index if available. That is the desired final state, but for a safe rollout, we should be able to disable using the object size index. Add an option (dfs.useObjectSizeIndex) to enable/disable the usage of the object size index. False by default. This changes the default from true to false. It only makes a different for the DFS stack when writing of the index was explicitely enabled. This is an optimization, so it shouldn't cause any regression. Operators can restore previous behaviour setting "dfs.useObjectSizeIndex" to true. Change-Id: I44bf5a57e3942a4ecfe66d58bfa9175e99f96fcc
* | | RepoProject: read the 'dest-branch' attribute of a projectKaushik Lingarkar2024-07-021-0/+30
|/ / | | | | | | | | | | | | | | | | | | 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
* | CommitGraphWriter: use ANY_DIFF instead of idEquals inside next()Ivan Frade2024-05-311-0/+2
| | | | | | | | | | | | | | | | | | | | Calculating the paths modified in a commit respect its parents is taking undue amount of time in big trees. Use ANY_DIFF filter, instead of #idEquals() inside the #next(). This shorcuts the tree browsing earlier. Change-Id: I318eee3ae817b7b9004d60bdb8d0f1bf19b9962d
* | CommitGraphWriter: Move path diff calculation to its own classIvan Frade2024-05-311-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To verify that we have the right paths between commits we are writing the bloom filters, reading them and querying. The path diff calculation is tricky enough for correctness and performance that should be tested on its own. Move the path diff calculation to its own class, so we can test it on its own. This is a noop refactor so we can verify later the steps taken in the walk. Change-Id: Ifbdcb752891c4adb08553802f87287de1155bb7c
* | RepoCommand: Copy manifest upstream into .gitmodules ref fieldIvan Frade2024-05-302-0/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | RepoProject: read the "upstream" attribute of a projectIvan Frade2024-05-301-0/+39
|/ | | | | | | | | | | | | | | | | 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
* PatchApplier.Result.Error: mark fields finalMatthias Sohn2024-05-281-8/+6
| | | | | | | Fields of an Error instance shouldn't be modifiable after its creation. Adapt tests which were setting hh to null to skip asserting it. Change-Id: I0f55c1d5cd529aa510029054e6f05bd2637d1bca
* PatchApplier: Set a boolean on the result if conflict markers were addedPatrick Hiesel2024-05-271-2/+2
| | | | | | | This will let callers show a different error message or mark the state as conflicting. Change-Id: Id8eea614b6b8d54c62b49ffbac90599e6f4c5efa
* PatchApplier: Add test for conflict markers on a deleted filePatrick Hiesel2024-05-271-0/+10
| | | | | | | | For deleted files, we want to keep erroring out even if conflicts are allowed for the apply patch logic. The resulting file would otherwise only consist of the patch. Change-Id: I18defa627ad2223a3a917d2b0ee4189396732533
* Merge changes I12e4d0fd,I082ffb20Matthias Sohn2024-05-162-26/+6
|\ | | | | | | | | | | * changes: Remove unused API problem filters Fix warning "Redundant specification of type arguments <Object>"
| * Fix warning "Redundant specification of type arguments <Object>"Matthias Sohn2024-05-142-26/+6
| | | | | | | | | | | | Use a lambda to fix this and make the code easier to read. Change-Id: I082ffb2073f86d21deb4b51a24e53de9371b765e
* | PatchApplierTest: remove unused importMatthias Sohn2024-05-151-1/+0
| | | | | | | | Change-Id: Ie3ac82a8160c605e27ee3167e3640cd76b1b2a76
* | Allow applying a patch with conflictsPatrick Hiesel2024-05-141-2/+53
|/ | | | | | | | | | | | | | In some settings, we want to let users apply a patch that does not cleanly apply and add conflict markers. In Gerrit, this is useful when cherry picking (via Git patches) from one host to another. This commit takes a simple approach: If a hunk doesn't apply, go to the pre-image line, treat all lines in pre-image length as left side of the conflict and all context and newly added lines as right side of the conflict. Change-Id: I01411d7a32b3f3207097b26231909aae6b835650
* GitDateFormatterTest: Remove printlnsIvan Frade2024-05-021-2/+0
| | | | | | Left overs from https://review.gerrithub.io/c/eclipse-jgit/jgit/+/204984 Change-Id: I169ce2a008ca70267323fa4fb0f1e54981f1ec33
* Bazel: Add support for JDK 21David Ostrovsky2024-05-022-14/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two failing tests when switching to JDK 21. One failure is related to the changed behaviour related to the locale providers. Adapt `GitDateFormatterTest` to changes in unicode [1]. Second failure related to changed behaviour in URL.openConnection(), see: [2] for more details. Before JDK 20, some of the parsing/validation performed by the JDK built-in URLStreamHander implementations were delayed until URL::openConnection or URLConnection::connect was called. Starting JDK 20, some of these parsing/validations are now performed early, i.e. within URL constructors. IOW, the assumption made in HttpSupport.TesttestMalformedUri() isn't met any more: providing mailformed URI to the URL ctor now throws an exception starting with JDK 20. To rectify the problem, remove the offending test. Test plan: To build with JDK 21 and run the tests locally: $> bazel test --config=java21 //... To build with JDK 21 and run the tests on RBE: $> bazel test --config=remote21 --remote_instance_name=$PROJECT //... [1] https://bugs.openjdk.org/browse/JDK-8304925 [2] https://bugs.openjdk.org/browse/JDK-8293590 Change-Id: I796de67f7945d5f1fa5e8146f4ec8cbe9ac7bd3e
* Fix warning about using raw typeMatthias Sohn2024-04-291-1/+1
| | | | | | | | | | This fixes the warning in UploadPackHandleDeletedPackFileTest. line 116: "Type safety: The method register(Object, Repository) belongs to the raw type TestProtocol. References to generic type TestProtocol<C> should be parameterized." Change-Id: I5a74269f1af7369dd397dd0f1c3cd807c0351367
* [errorprone] Fix pattern ModifiedButNotUsedMatthias Sohn2024-04-292-0/+4
| | | | | | See https://errorprone.info/bugpattern/ModifiedButNotUsed Change-Id: I3bd3f865d50a26af6c594391de5adf35230c984f
* [errorprone] Fix pattern CatchAndPrintStackTraceMatthias Sohn2024-04-291-12/+13
| | | | | | See https://errorprone.info/bugpattern/CatchAndPrintStackTrace Change-Id: I7a6698293d1485f384c275bf7e4dcddc529af4a1
* [errorprone] Fix pattern FutureReturnValueIgnoredMatthias Sohn2024-04-293-8/+8
| | | | | | See https://errorprone.info/bugpattern/FutureReturnValueIgnored Change-Id: I7225fd6388ce70ed5eea9e61b29bd10e1a927acb
* [errorprone] Fix pattern BadImportMatthias Sohn2024-04-294-10/+7
| | | | | | See https://errorprone.info/bugpattern/BadImport Change-Id: I24e5a7a4a64d8b3cf2cc3d394090ce90e849f9f9
* [errorprone] Fix pattern UseCorrectAssertInTestsMatthias Sohn2024-04-291-3/+5
| | | | | | See https://errorprone.info/bugpattern/UseCorrectAssertInTests Change-Id: Iffde63ac795ad30c3e7774764cb8189cb089ed86
* [errorprone] Fix pattern ProtectedMembersInFinalClassMatthias Sohn2024-04-291-1/+1
| | | | | | See https://errorprone.info/bugpattern/ProtectedMembersInFinalClass Change-Id: I5993093ca012f091dfe8ee1f2099b9596c2ee697
* [errorprone] Fix pattern CatchFailMatthias Sohn2024-04-297-10/+17
| | | | | | See https://errorprone.info/bugpattern/CatchFail Change-Id: If1c637a420c4e669a5bdbe4abcefc5c3a2b3a43b
* [errorprone] Fix pattern see UnusedVariableMatthias Sohn2024-04-298-36/+30
| | | | | | See https://errorprone.info/bugpattern/UnusedVariable Change-Id: I75d7602af31ed7d3264d2beab2d159cfbf29e7cb
* [errorprone] Fix pattern LongLiteralLowerCaseSuffixMatthias Sohn2024-04-293-7/+7
| | | | | | See https://errorprone.info/bugpattern/LongLiteralLowerCaseSuffix Change-Id: I139eadef5d66dfed2952ba9e1c91b3fe83259e97
* [errorprone] Fix error pattern JdkObsoleteMatthias Sohn2024-04-294-11/+10
| | | | | | See https://errorprone.info/bugpattern/JdkObsolete Change-Id: Id105e2695eb64523bd217f507bf95f909bc6b348
* [errorprone] Fix UnnecessaryParentheses errorsMatthias Sohn2024-04-286-41/+44
| | | | | | See https://errorprone.info/bugpattern/UnnecessaryParentheses Change-Id: I783fd24286ec1bd55efbf21d05758465f4af87ee
* ResolveMerger: Fix the issue with binary modify-modify conflictsSruteesh2024-04-252-8/+187
| | | | | | | | | | | 1) If the file was marked as binary by git attributes, we should add the path to conflicts if content differs in OURS and THEIRS 2) If the path is a file in OURS, THEIRS and BASE and if it is a binary in any one of them, no content merge should be attempted and the file content is kept as is in the work tree Bug: jgit-14 Change-Id: I9201bdc53a55f8f40adade4b6a36ee8ae25f4db8
* Explain why RacyGitTests may be flaky in some environmentsMatthias Sohn2024-04-201-0/+16
| | | | Change-Id: I5bbd04754f5f29299a7b9a58a3717e3f615199d0
* Merge "Add more tests on rewriting parents in a RevWalk"Ivan Frade2024-04-111-9/+123
|\
| * Add more tests on rewriting parents in a RevWalkMax Haslbeck2024-03-261-9/+123
| | | | | | | | | | | | | | | | | | | | | | Change I4e4ff67fb279edbcc3461496b132cea774fb742f introduced new behaviour that also rewrote parents in a RevWalk if no TreeFilter was set. This led to unexpected behaviour when users were fetching from chromium.googlesource.com. I added a few more tests to better describe the behaviour of RevWalk in regards to rewriting parents. Change-Id: I1a5e5f8a1de9d8dd0e3664918ac010644b3ef87b Signed-off-by: Max Haslbeck <haslbeck@google.com>
* | Merge "MergeAlgorithm: Fix diff3 conflict hunk computation"Ivan Frade2024-04-091-0/+13
|\ \ | |/ |/|
| * MergeAlgorithm: Fix diff3 conflict hunk computationAntonin Delpeuch2024-04-091-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes https://github.com/eclipse-jgit/jgit/issues/38. The previous code computed the boundaries of the base part of conflict hunks using line numbers computed for the 'ours' and 'theirs' revisions, leading to incorrect boundaries. This only affects the presentation of merge conflicts in diff3 mode (which is probably not used a lot yet on Gerrit). Successful merges are unaffected. Change-Id: I173c79bf5797896dc854791d6d05cb3f035726f4 Signed-off-by: Antonin Delpeuch <antonin@delpeuch.eu>
* | Merge "DfsGarbageCollectorTest: add test for bitmap index creation"Ivan Frade2024-03-201-1/+67
|\ \
| * | DfsGarbageCollectorTest: add test for bitmap index creationSam Delmerico2024-03-181-1/+67
| |/ | | | | | | Change-Id: Ibb9b2f8fc0f5180728904f243bf372f8a233383d
* | TreeRevFilter: correct changedPathFilter usage for multi-paths inclusionXing Huang2024-03-181-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The expected behavior of TreeRevFilter when filtering multiple file paths is to include commits that changed at least one of the given paths; only skipping them if they did not change any of the given paths. The current changedPathFilter utilization logic is skipping a commit if there exists at least one given path that the commit did not change, disregarding the rest of the given paths. Enforcing all given paths to be checked by the changedPathFilter, only skipping a commit if changedPathFilter return negative on all given paths. Signed-off-by: Xing Huang <xingkhuang@google.com> Change-Id: Ib7a9e496b37ec737722fbf33c5d0f05d5d910a8d
* | PathFilterGroup: implement getPathsBestEffort()Xing Huang2024-03-181-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | getPathsBestEffort() is a method in the TreeFilter class to retrieve file paths specified by the caller. PathFilterGroup do not propagate the paths of their subfilters as it does not implement the getPathsBestEffort() method, resulting in the caller only getting an empty list of paths. Override getPathsBestEffort() in PathFilterGroup to propagate subfilter values. Signed-off-by: Xing Huang <xingkhuang@google.com> Change-Id: I76bf08795360abc0874a7c258636d4f37da35060
* | DfsPackFile: get commitGraph.readChangePaths from repo configXing Huang2024-03-142-0/+66
|/ | | | | | | | | | | By default, CommitGraphLoader reads the readChangedPaths flag from SystemReader ignoring the values set at repo-level. Read the value of the property from the repo configuration and pass it to CommitGraphLoader. Signed-off-by: Xing Huang <xingkhuang@google.com> Change-Id: I34c807714c5a7573769ba9d611457aa107006244
* DfsPackFile: Abstract the bitmap loading to support other backendsIvan Frade2024-02-261-0/+41
| | | | | | | | | | | | Current code reads the bitmap index from the pack extension and loads all bitmaps into memory, with its IO and memory cost. We could consider to store the bitmaps on e.g. a database and load them on demand. Abstract the loading of the PackBitmapIndex in an interface that can be implemented with other backends. Change-Id: Ib5f64d05954708ea5325feea7088a8df229b36a5
* Merge "DfsReader#getObjectSize: use size index if possible"Ivan Frade2024-02-231-29/+88
|\
| * DfsReader#getObjectSize: use size index if possibleIvan Frade2024-02-201-29/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | getObjectSize reads the size from the first bytes of the object in the pack, using IO. For blobs and depending on the configuration, the size could be available in the object size index. Try to get the size from the object size index if available. Read from the pack otherwise. Note that GC uses #getObjectSize from the existing pack to write the next object size index. Change-Id: Ia999290c06d061cb53aa8c0a2b28b1a9761567ef
* | Merge "Revert "StartGenerator: Fix parent rewrite with non-default RevFilter""Ivan Frade2024-02-222-113/+0
|\ \
| * | Revert "StartGenerator: Fix parent rewrite with non-default RevFilter"Ivan Frade2024-02-212-113/+0
| |/ | | | | | | | | | | | | | | | | This reverts commit db5ce6b5c24408ae27eb6fa0b6289d51b129baeb. Reason to revert: This change utilizes the RewriteGenerator even in absence of a path, making the walk lengthy. Change-Id: I5ffa6e8fead328191348c1e46828bf8c75ae1e42
* | Merge branch 'stable-6.8'Matthias Sohn2024-02-211-6/+5
|\ \ | |/ |/| | | | | | | | | | | * stable-6.8: Delete org.eclipse.jgit.ssh.apache.agent/bin/.project Allow to discover bitmap on disk created after the packfile Change-Id: I08095dfaefb963876d993383cb35acc6b75d7691
| * Merge branch 'stable-6.7' into stable-6.8Matthias Sohn2024-02-211-6/+5
| |\ | | | | | | | | | | | | | | | | | | | | | * stable-6.7: Delete org.eclipse.jgit.ssh.apache.agent/bin/.project Allow to discover bitmap on disk created after the packfile Change-Id: I01749bae6f46d1a8ebd25b890e667cc092f3a659