aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
Commit message (Collapse)AuthorAgeFilesLines
...
| | | | | | | | | | | * 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)
* | | | | | | | | | | | Prepare 6.10.1-SNAPSHOT buildsMatthias Sohn2024-06-043-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I3384e7405cadf063e7b0dd25468a8651c45628ac
* | | | | | | | | | | | JGit v6.10.0.202406032230-rv6.10.0.202406032230-rMatthias Sohn2024-06-043-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: Id188a6cdc2db63c961f0b9338e6ae56d58853dff
* | | | | | | | | | | | JGit v6.10.0.202406032110-rv6.10.0.202406032110-rMatthias Sohn2024-06-033-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: I3128b2e4bbbed97adde90f7a47e15175e63e97f5
* | | | | | | | | | | | Prepare 6.10.0-SNAPSHOT buildsMatthias Sohn2024-06-023-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I64f6d6a0599cbab462dca236c00e6f3314b2a810
* | | | | | | | | | | | JGit v6.10.0.202405290101-rc1v6.10.0.202405290101-rc1Matthias Sohn2024-05-293-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: Ie3d08213e00fcfe1fc34a39021dd99f27e0abc1f
* | | | | | | | | | | | JGit v6.10.0.202405282244-rc1v6.10.0.202405282244-rc1Matthias Sohn2024-05-293-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: Ia525790e0b4c9011b29768d2b9727cb48b21ba84
* | | | | | | | | | | | PatchApplier.Result.Error: mark fields finalMatthias Sohn2024-05-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-6/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will let callers show a different error message or mark the state as conflicting. Change-Id: Id8eea614b6b8d54c62b49ffbac90599e6f4c5efa
* | | | | | | | | | | | Remove version override of commons-codecThomas Wolf2024-05-252-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 8164155b the commons-codec version is pinned in the parent POM's dependency management. Remove the version specification in org.eclipse.jgit/pom.xml. Also give the package-import in the MANIFEST.MF an upper bound. Change-Id: I2785a87cf77d6df110f57a0cb939dbc9772b8ee6 Signed-off-by: Thomas Wolf <twolf@apache.org>
* | | | | | | | | | | | WalkFetchConnection: Remove marked packs on all function exitsIvan Frade2024-05-161-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [1] replaces Iterator.remove() with a list of "toRemove" that gets processed when returning at the end. There are two others returns in the function where the list is not processed. Let the method report the broken packages and wrap it so the caller can clean them up in any case. [1] https://review.gerrithub.io/c/eclipse-jgit/jgit/+/1194812 Change-Id: I1ffb7829039f644df03b0b3ea1e5d10408ce19b7
* | | | | | | | | | | | Merge "Do not use ArrayList when there will be deletions"Ivan Frade2024-05-163-27/+30
|\ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | Do not use ArrayList when there will be deletionsjackdt@google.com2024-05-163-27/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In https://gerrithub.io/c/eclipse-jgit/jgit/+/1194015, LinkedList was replaced with ArrayList in DfsReader and WalkFetchConnection. In this case, the Iterator.remove() method of List is called, which is an O(n) operation for ArrayList. This results in an O(n^2) algorithm. Instead of reverting to LinkedList, use a HashSet and LinkedHashmap instead. This maintains O(1) removal, and is less likely to be treated as an antipattern than LinkedList. A likely innocuous usage of Iterator.remove() in UnionInputStream was also fixed. Change-Id: I57d884440c726b2fc80c1b8b2bec9bd7e2e6e3fe
* | | | | | | | | | | | | Merge changes I12e4d0fd,I082ffb20Matthias Sohn2024-05-161-19/+0
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: Remove unused API problem filters Fix warning "Redundant specification of type arguments <Object>"
| * | | | | | | | | | | | Remove unused API problem filtersMatthias Sohn2024-05-141-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I12e4d0fd48b5b7420d421874c8d63caed9628266
* | | | | | | | | | | | | Merge "Allow applying a patch with conflicts"Matthias Sohn2024-05-151-19/+115
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / |/| | | | | | | | | | | |
| * | | | | | | | | | | | Allow applying a patch with conflictsPatrick Hiesel2024-05-141-19/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | | | | | | | Check an execution bit by reading it from the file systemYury Molchan2024-05-131-2/+11
|/ / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Files.isExecutable() checks possibility to execute a file from the JVM, not POSIX attributes. So it fails when Java Security Manager does not allow to execute a file, but file has X-bit. Change-Id: I85b96fb6cedbaff1b3c063728c25b6ce4d04e9b9
* | | | | | | | | | | | PackIndex: Make it an interfaceIvan Frade2024-05-083-23/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we work on different backends for PackIndex, it is much easier to extend an interface than an abstract class. Note that PackIndex is alredy acting as an interface, offering barely any functionality. Change-Id: Icd0db0e96a097631c2b9c3b05e5700f601f606d5
* | | | | | | | | | | | PackIndex: Make iterator static (pass object count in ctor)Ivan Frade2024-05-083-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The iterator uses an implicit reference to the external class to call #getObjectCount(). This implicit reference prevents PackIndex to become an interface. The object count is immutable and known at index (and iterator) construction time. Pass the object count in the constructor of the iterator and make it static. Change-Id: I4949ff943de2a88380fb7f4c9b65b089734854b9
* | | | | | | | | | | | PackIndex: move checksum to the subclassesIvan Frade2024-05-084-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PackIndex is almost an interface, and making it so simplifies writing implementations over other storages. Checksum and its getter is the only functionality that is class specific. Make getChecksum abstract and implement it in the subclasses. Change-Id: I3746515d816abab075210505f1bb31b1936962e9
* | | | | | | | | | | | Merge "PackIndex: Make #getOffset protected to allow out-of-package subclasses"Ivan Frade2024-05-012-2/+2
|\ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | PackIndex: Make #getOffset protected to allow out-of-package subclassesIvan Frade2024-04-262-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PackIndex#getOffset is abstract and package-private, limiting subclasses to the same package. Given than the class and all other relevant methods are public, this looks like an oversight and it should be ok to write subclasses in other packages. Make the method protected, allowing to write PackIndex subclasses in other packages. Change-Id: I7d3762b0a6c0681c29bd827bbaf094f1ee4583d2
* | | | | | | | | | | | | [errorprone] Fix error pattern JdkObsoleteMatthias Sohn2024-04-2927-82/+77
|/ / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://errorprone.info/bugpattern/JdkObsolete Change-Id: Id105e2695eb64523bd217f507bf95f909bc6b348
* | | | | | | | | | | | ResolveMerger: Fix the issue with binary modify-modify conflictsSruteesh2024-04-251-30/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | | | | | | PackBitmapIndexBuilder.StoredEntry: add getter for objectIdSam Delmerico2024-04-121-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you only have access to the PackBitmapIndexBuilder there is no way to get the ObjectId from a StoredEntry instance without also having access to a reverse pack index. The StoredEntry can provide the idxPosition, but the PackBitmapIndexBuilder's getObject method requires a ridxPosition in order to find an ObjectId. Providing an ObjectId from the StoredEntry gives this information directly and also allows a caller to get the ridxPosition if desired by calling PackBitmapIndexBuilder.findPosition(objectId) without needing an index object. This closes the operations of the PackBitmapIndexBuilder such that any method can be called by using information provided by the other methods. Change-Id: I5a11479b9635cd6b5e7aaff2f862cd41069ac469
* | | | | | | | | | | | PackBitmapIndex: clarify naming of getObject inputsSam Delmerico2024-04-123-19/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation for the getObject function seems to be a little outdated. This commit clarifies that this function accepts an offset based on the ordering of objects in the pack. Change-Id: Icffaf4fb72155c415f5fd248e721cab87a1a083e
* | | | | | | | | | | | Merge "MergeAlgorithm: Fix diff3 conflict hunk computation"Ivan Frade2024-04-091-2/+11
|\ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | MergeAlgorithm: Fix diff3 conflict hunk computationAntonin Delpeuch2024-04-091-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | | | | | | | | | PackBitmapIndexBuilder: make StoredEntry constructor publicSam Delmerico2024-04-031-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This POD data structure can be used externally Change-Id: I464c45b93d0a56deaadbfe31df57a87e1054741c
* | | | | | | | | | | | | Merge "PackBitmapIndexBuilder: allow repeated call of getCompressedBitmaps()"Ivan Frade2024-04-021-2/+3
|\ \ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | | PackBitmapIndexBuilder: allow repeated call of getCompressedBitmaps()Sam Delmerico2024-04-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each call of the current implementation of PackBitmapIndexBuilder.getCompressedBitmaps reverses the class member that is returned. So two subsequent calls of this function will receive reversed structures. Instead we should just reverse a copy of the structure. This way the PackBitmapIndexBuilder can continue to efficiently accept new bitmaps via processBitmapForWrite (because we can continue to add to the back of the bitmapsToWrite ArrayList) while ensuring that the bitmaps are returned in the correct ordering from getCompressedBitmaps. Change-Id: If7364222b9e62920c0c2c06894716fe85dd13315
* | | | | | | | | | | | | | DfsPackFile: Make the loader classes used to construct bitmaps public.jackdt@google.com2024-04-021-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is necessary to swap out implementations of the PackBitmapIndex with custom implementations. Change-Id: Ia6f951bbc901446c255fa2902fab05d7ed974111
* | | | | | | | | | | | | | DfsPackFile: make public the constructor with bitmap loaderIvan Frade2024-04-011-1/+12
|/ / / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The constructor with the bitmap loader as a parameter is supposed to be used from subclasses in the ObjectDatabase, but those subclasses cannot see it with its current package-private visibility. Make it public, so it can be used as intended. Change-Id: I4afca3d2a13c4a41a766d08c5aa54bde352915a6
* | | | | | | | | | | | | PackWriter: writeBitmapIndex takes bitmap index writerSam Delmerico2024-03-296-22/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PackWriter.writeBitmapIndex now takes an interface which will perform the writing of the bitmap index to an arbitrary backing storage. Change-Id: Icba89321d56f7b652bbcbfcd5ed3ec74999cb8c4
* | | | | | | | | | | | | PackBitmapIndex: convert from class to interfaceSam Delmerico2024-03-253-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This abstract class can be an interface after https://review.gerrithub.io/c/eclipse-jgit/jgit/+/1184614 moved the packChecksum data behind a getter interface. This also allows easier overriding of this interface with custom types. Change-Id: I89851de678e7ff896cc086455907e2898d2eecf6
* | | | | | | | | | | | | Merge "PackBitmapIndex: hide packChecksum behind getter"Ivan Frade2024-03-203-3/+16
|\ \ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | | PackBitmapIndex: hide packChecksum behind getterSam Delmerico2024-03-183-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows more flexibility in overriding the PackBitmapIndex and also allows us to turn PackBitmapIndex into an interface in https://review.gerrithub.io/c/eclipse-jgit/jgit/+/1178201. Change-Id: I3be611fad67ff38b308c0052a04149f1497858ae
* | | | | | | | | | | | | | Merge "Cache refreshed loose ref dirs in SnapshottingRefDirectory"Matthias Sohn2024-03-201-2/+26
|\ \ \ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | | | Cache refreshed loose ref dirs in SnapshottingRefDirectoryNasser Grainawi2024-03-191-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update SnapshottingRefDirectory to have a cache of dirs refreshed for loose refs. This should help improve performance when 'after_open' setting is used for 'trustLooseRefStat' as duplicate refreshes are avoided when a snapshot of the ref database is used in a request scope. Change-Id: I8f66e7cee572e477d29abe2d9db69e97bca3ee4c Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com> Co-authored-by: Martin Fick <quic_mfick@quicinc.com> Co-authored-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
* | | | | | | | | | | | | | | Merge "TreeRevFilter: correct changedPathFilter usage for multi-paths inclusion"jonathantanmy2024-03-192-6/+3
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / |/| | | | | | | | | | | | | |
| * | | | | | | | | | | | | | TreeRevFilter: correct changedPathFilter usage for multi-paths inclusionXing Huang2024-03-182-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | | | | | | | | | Merge "CleanupService: preload JgitText if not running in OSGi"Thomas Wolf2024-03-182-18/+49
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / |/| | | | | | | | | | | | | |
| * | | | | | | | | | | | | | CleanupService: preload JgitText if not running in OSGiThomas Wolf2024-03-152-18/+49
| | |/ / / / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Load class JGitText eagerly when ShutdownHook is used. If not running in an OSGi framework, the hook executes as a JVM shutdown hook. Normally classloading in a shutdown hook should not be a problem, but there are some other frameworks besides OSGi that may close classloaders before such a JVM shutdown hook runs, for instance Plexus classworlds used in maven. This is not a full fix for classloading problems in JGit shutdown hooks. If a listener causes additional classes to be loaded, there may still be problems. But the current listeners registered with ShutdownHook all appear to use only classes that should already be loaded; except JGitText. Bug: jgit-36 Change-Id: Iab00134b4720adb19e1394c38ad79f1c43c3466b Signed-off-by: Thomas Wolf <twolf@apache.org>