aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'stable-6.4' into stable-6.5stable-6.5Matthias Sohn36 hours18-445/+91
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove jetty source bundles from p2 repo since they aren't available for jetty 10.0.13. * stable-6.4: MergeToolTest: update expected error from the tool Add dash license check for 3rd party dependencies Prepare 5.13.5-SNAPSHOT builds JGit v5.13.4.202507202350-r AmazonS3: Do not accept DOCTYPE and entities ManifestParser: Do not accept DOCTYPE and entities AdvertisedRequestValidator: fix WantNotValidException caused by race Prepare 5.13.4-SNAPSHOT builds Fix packaging build Change-Id: I4e9262d883d31bbc9392b2140f9071a3093d56af
| * Merge branch 'stable-6.3' into stable-6.4stable-6.4Matthias Sohn38 hours17-442/+91
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: MergeToolTest: update expected error from the tool Add dash license check for 3rd party dependencies Prepare 5.13.5-SNAPSHOT builds JGit v5.13.4.202507202350-r AmazonS3: Do not accept DOCTYPE and entities ManifestParser: Do not accept DOCTYPE and entities AdvertisedRequestValidator: fix WantNotValidException caused by race Prepare 5.13.4-SNAPSHOT builds Fix packaging build Change-Id: I448bad5c8333607ef5f39ceda70f004ee8a9ba31
| | * Merge branch 'stable-6.2' into stable-6.3stable-6.3Matthias Sohn38 hours17-443/+104
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: MergeToolTest: update expected error from the tool Add dash license check for 3rd party dependencies Prepare 5.13.5-SNAPSHOT builds JGit v5.13.4.202507202350-r AmazonS3: Do not accept DOCTYPE and entities ManifestParser: Do not accept DOCTYPE and entities AdvertisedRequestValidator: fix WantNotValidException caused by race Prepare 5.13.4-SNAPSHOT builds Fix packaging build Change-Id: I23df8552b799ed5bd4c8472d3775372d78a573ea
| | | * Merge branch 'stable-6.1' into stable-6.2stable-6.2Matthias Sohn43 hours16-442/+103
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: Add dash license check for 3rd party dependencies Prepare 5.13.5-SNAPSHOT builds JGit v5.13.4.202507202350-r AmazonS3: Do not accept DOCTYPE and entities ManifestParser: Do not accept DOCTYPE and entities AdvertisedRequestValidator: fix WantNotValidException caused by race Prepare 5.13.4-SNAPSHOT builds Fix packaging build Change-Id: I7a0c22f2288c2201af04d60f9ed59730341a31d5
| | | | * Merge branch 'stable-6.0' into stable-6.1stable-6.1Matthias Sohn44 hours16-442/+103
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: Add dash license check for 3rd party dependencies Prepare 5.13.5-SNAPSHOT builds JGit v5.13.4.202507202350-r AmazonS3: Do not accept DOCTYPE and entities ManifestParser: Do not accept DOCTYPE and entities AdvertisedRequestValidator: fix WantNotValidException caused by race Prepare 5.13.4-SNAPSHOT builds Fix packaging build Change-Id: Ie3343cb83babb30ffc802967f491182c8c84d61d
| | | | | * Add dash license check for 3rd party dependenciesstable-6.0Matthias Sohn46 hours1-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I552bd4e5a43871d4772d2d4fba7232f5dbb101ec
| | | | | * Merge branch 'stable-5.13' into stable-6.0Matthias Sohn46 hours16-433/+90
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: Prepare 5.13.5-SNAPSHOT builds JGit v5.13.4.202507202350-r AmazonS3: Do not accept DOCTYPE and entities ManifestParser: Do not accept DOCTYPE and entities AdvertisedRequestValidator: fix WantNotValidException caused by race Prepare 5.13.4-SNAPSHOT builds Fix packaging build Change-Id: Ib29309f853bcd3825058128d62c90f2739f30590
| | | | | | * Prepare 5.13.5-SNAPSHOT buildsstable-5.13Matthias Sohn2 days88-503/+503
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Iafe52ac049219f3da3888811135e5729d053aa1a
| | | | | | * JGit v5.13.4.202507202350-rv5.13.4.202507202350-rMatthias Sohn2 days88-121/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: Ib49e2cf19633d986d14ef059f92499fdb5c98086
| | | | | | * AmazonS3: Do not accept DOCTYPE and entitiesMatthias Sohn3 days1-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follows OWASP recommendations in https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html Change-Id: I3d47debf14d95c8189d51256b4eb2ba991279452
| | | | | | * ManifestParser: Do not accept DOCTYPE and entitiesIvan Frade3 days2-3/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These open the door for XXE attacks [1] and manifest do not need them. [1] https://en.wikipedia.org/wiki/XML_external_entity_attack Change-Id: Ia79971e1c34afaf287584ae4a7f71baebcb48b6a
| | | | | | * AdvertisedRequestValidator: fix WantNotValidException caused by raceMatthias Sohn3 days1-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fetch with protocol V2 failed under the following conditions - fetch uses bidirectional protocol (git, ssh) which uses a shortcut to determine invalid wants - not all wants are advertised - race condition: wanted ref is updated during fetch by another thread after the thread serving upload-pack determined wants and before it checks not advertised wants Fix this by calling `new ReachableCommitRequestValidator().checkWants(up, wants)` instead of throwing WantNotValidException in [1] if this race happened in the same way like it's done for unidirectional protocols (http) [2]. [1] https://github.com/eclipse-jgit/jgit/blob/stable-6.10/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java#L2002 [2] https://github.com/eclipse-jgit/jgit/blob/stable-6.10/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java#L2000 Bug: jgit-48 Change-Id: I32f28502923815dc49781aab5d810c9afbe7e7e6
| | | | | | * Prepare 5.13.4-SNAPSHOT buildsMatthias Sohn3 days88-503/+503
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I0fe9792b7ac883f355d2dbfa5cac97b7b26648ae
| | | | | | * Fix packaging buildMatthias Sohn3 days34-1678/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - use target platform 4.21 - remove all older target platforms - update tycho to 4.0.13, hence maven needs to be run using Java 17 - enforce build is run using Java 17 or higher - remove pack200 plugins Change-Id: I50a52c22f4665b6323ee6d29da18e39960d008af
| | | * | | | MergeToolTest: update expected error from the toolIvan Frade43 hours1-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test fails in jenkins becuase the error string is slightly different. It seems to come from an external tool (git mergetool?) that maybe changed that output (?). At the moment update the error string to match the output of the tool. Parsing error messages is bound to be flaky. Change-Id: I81e9bf65088b893af3a0d8e53d57052583fc2262
* | | | | | | Merge branch 'stable-6.4' into stable-6.5Matthias Sohn2024-08-182-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.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.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.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.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.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"Matthias 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-1188-121/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: Iacf106ce4013e9e12876e85ae341022a44bccb5c
| * | | | | | Update org.eclipse.dash:license-tool-plugin to 1.1.0Matthias Sohn2024-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Idb5c74f75110edc35e8a89de52aca8392acb297f
* | | | | | | Merge branch 'stable-6.4' into stable-6.5Matthias Sohn2024-01-100-0/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.4: Checkout: better directory handling Change-Id: I68e11fb06a354961f4146de51d326b69be5b69d3
| * | | | | | Merge branch 'stable-6.3' into stable-6.4Matthias Sohn2024-01-100-0/+0
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: Checkout: better directory handling Change-Id: Ie0fefa8afc07f638ee05a46d272db7b7b0f8d464
| | * | | | | Merge branch 'stable-6.2' into stable-6.3Matthias Sohn2024-01-100-0/+0
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: Checkout: better directory handling Change-Id: Id27612578f822cabc1a38ad1f8e859ae354045a9
| | | * | | | Merge branch 'stable-6.1' into stable-6.2Matthias Sohn2024-01-100-0/+0
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: Checkout: better directory handling Change-Id: I2f8e5410f4962d38bc6e822b5cda42df68aef32b
| | | | * | | Merge branch 'stable-6.0' into stable-6.1Matthias Sohn2024-01-100-0/+0
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: Checkout: better directory handling Change-Id: Ide9fb318b5fe413d73d73a19943c6dacdcf07f3d
| | | | | * | Merge branch 'stable-5.13' into stable-6.0Matthias Sohn2024-01-100-0/+0
| | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: Checkout: better directory handling Revert commit 170244d05977491271a1cc234583d2e5ba75145d "Checkout: better directory handling" which is the downport of the original fix Ie12864c54c9f901a2ccee7caddec73027f353111 which was done on stable-6.6. Merging this up to stable-6.6 would be a lot of work and these branches aren't maintained anymore hence revert this change here. This way the fix is available on stable-5.13 for those who still need Java 8 and everybody else should upgrade to 6.6.1 or higher. Change-Id: Iffe50a5e62c6655814265d9cc6c5c2996baa1a31
| | | | | | * Checkout: better directory handlingThomas Wolf2023-10-2218-142/+1061
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | | | Merge branch 'stable-6.4' into stable-6.5Matthias Sohn2023-10-1310-217/+296
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.4: PackConfig: fix @since tags Remove unused API problem filters Add support for git config repack.packKeptObjects Do not exclude objects in locked packs from bitmap processing Change-Id: I2951d01f5f4581bee20079508cd8ee6ca8554f1f
| * | | | | | Merge branch 'stable-6.3' into stable-6.4Matthias Sohn2023-10-139-4/+296
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: PackConfig: fix @since tags Remove unused API problem filters Add support for git config repack.packKeptObjects Do not exclude objects in locked packs from bitmap processing Change-Id: I4b94a2b79941c085fa2f62246e8e879aaa85cd3f
| | * | | | | Merge branch 'stable-6.2' into stable-6.3Matthias Sohn2023-10-1310-4/+340
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: PackConfig: fix @since tags Remove unused API problem filters Add support for git config repack.packKeptObjects Do not exclude objects in locked packs from bitmap processing Change-Id: I22b89bf00dcef26b2096d25397aa9a57a745a92b
| | | * | | | Merge branch 'stable-6.1' into stable-6.2Matthias Sohn2023-10-1310-4/+340
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: PackConfig: fix @since tags Remove unused API problem filters Add support for git config repack.packKeptObjects Do not exclude objects in locked packs from bitmap processing Change-Id: Ib4e4fe407dce334c7537bf278baa39db93aa2f09
| | | | * | | Merge branch 'stable-6.0' into stable-6.1Matthias Sohn2023-10-1310-4/+340
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: PackConfig: fix @since tags Remove unused API problem filters Add support for git config repack.packKeptObjects Do not exclude objects in locked packs from bitmap processing Change-Id: I0c9c0b3c206cac03a93b30eda348177a4de35c36
| | | | | * | Merge branch 'stable-5.13' into stable-6.0Matthias Sohn2023-10-1310-113/+296
| | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: PackConfig: fix @since tags Remove unused API problem filters Add support for git config repack.packKeptObjects Do not exclude objects in locked packs from bitmap processing Change-Id: Ifeaa4b4f0c5944d4ecd3042be429833ff72b43ed
| | | | | | * PackConfig: fix @since tagsMatthias Sohn2023-10-131-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ia513f7cdbf3c197e8661720fc804984ff165fc5c
| | | | | | * Remove unused API problem filtersMatthias Sohn2023-10-132-223/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I9d5b96cf841478af8613667ef8574423630f8028
| | | | | | * Add support for git config repack.packKeptObjectsAntonio Barone2023-10-127-17/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change Ide3445e652 introduced the `--pack-kept-objects` option to GC for including the objects contained in the locked packfiles during the repack phase. Whilst this allowed to explicitly pass a command line argument to the jgit gc program, it did not allow the option to be read from configuration. Allow the pack kept objects option to be configured exactly as C-Git documents [1], by introducing a new `repack.packKeptObjects` configuration. `repack.packKeptObjects` defaults to `true`, when the `pack.buildBitmaps` is `true` (which is the default case), `false` otherwise. [1] https://git-scm.com/docs/git-config#Documentation/git-config.txt-repackpackKeptObjects Bug: 582292 Change-Id: Ia931667277410d71bc079d27c097a57094299840
| | | | | | * Do not exclude objects in locked packs from bitmap processingLuca Milanesio2023-10-127-1/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packfiles having an equivalent .keep file are associated with in-flight pushes that haven't been completed, with potentially a set of git objects not yet referenced by a ref. If the Git client is not up-to-date, it may result in pushing a packfile, generating a <packfile>.keep on the server, which may also contain existing commits due to the lack of Git protocol negotiation in the git-receive-pack. The Git protocol negotiation is the phase where the client and the server exchange the list of refs they have for trying to find a common base and minimise the amount of objects to be transferred. The repack phase in GC was previously skipping all objects that were contained in all packfiles having a <packfile>.keep file associated (aka "locked packfiles"), which did not take into consideration the fact that excluding the existing commits would have resulted in the generation of an invalid bitmap file. The code for excluding the objects in the locked packfiles was written well before the bitmap was introduced, hence could not consider a use case that did not exist at that time. However, when the bitmap was introduced, the exclusion of locked packfiles was not changed, hence creating a potential problem. The issue went unnoticed for many years because the bitmap generation was disabled when JGit noticed any locked packfiles; however, the bitmaps are enabled again since Id722e68d9f , and the the issue is now visible and is impacting the GC repack phase. Introduce the '--pack-kept-objects' option in GC for including the objects contained in the locked packfiles during the repack phase, which is not an issue because of the following: - If there are any existing commits duplicated in the packfiles they will be just considered once anyway because the repack doesn't generate duplicates in the output packfile. - If there are any new commits that do not have any ref pointing to them, they will be automatically excluded from the output repacked packfile. The same identical solution is adopted in the C implementation of git in repack.c. Because the locked packfile is not pruned, any new commits not pointed by any refs will remain in the repository and there will not be any accidental pruning or object loss as it is today before this change. As a side-effect of this change, it is now potentially possible to still have duplicate BLOBs after GC when the keep packfile contained existing objects. However, it is way better to keep the duplication until the next GC phase rather than omitting existing objects from repacking and, therefore generating an invalid bitmap and incorrect packfile. Bug: 582292 Bug: 582455 Change-Id: Ide3445e652fcf256a7912f881cb898897c99b8f8
* | | | | | | Merge branch 'stable-6.4' into stable-6.5Matthias Sohn2023-08-033-6/+35
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.4: Add verification in GcKeepFilesTest that bitmaps are generated Express the explicit intention of creating bitmaps in GC GC: prune all packfiles after the loosen phase Prepare 5.13.3-SNAPSHOT builds JGit v5.13.2.202306221912-r Change-Id: Idb6dd6160e023673e3650653a15f6b1c540de96e
| * | | | | | Merge branch 'stable-6.3' into stable-6.4Matthias Sohn2023-08-033-6/+35
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: Add verification in GcKeepFilesTest that bitmaps are generated Express the explicit intention of creating bitmaps in GC GC: prune all packfiles after the loosen phase Prepare 5.13.3-SNAPSHOT builds JGit v5.13.2.202306221912-r Change-Id: I0bccc36d9cc9a36f1be9b1562df35ce3a0e95eee
| | * | | | | Merge branch 'stable-6.2' into stable-6.3Matthias Sohn2023-08-033-6/+35
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: Add verification in GcKeepFilesTest that bitmaps are generated Express the explicit intention of creating bitmaps in GC GC: prune all packfiles after the loosen phase Prepare 5.13.3-SNAPSHOT builds JGit v5.13.2.202306221912-r Change-Id: I589ed444b5cbfc5b073cac91323e2cc97ab98087
| | | * | | | Merge branch 'stable-6.1' into stable-6.2Matthias Sohn2023-08-033-6/+35
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: Add verification in GcKeepFilesTest that bitmaps are generated Express the explicit intention of creating bitmaps in GC GC: prune all packfiles after the loosen phase Prepare 5.13.3-SNAPSHOT builds JGit v5.13.2.202306221912-r Change-Id: I5b16c3b613a95b7f28c8f6ac0b20c4c593759cea
| | | | * | | Merge branch 'stable-6.0' into stable-6.1Matthias Sohn2023-08-033-6/+35
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: Add verification in GcKeepFilesTest that bitmaps are generated Express the explicit intention of creating bitmaps in GC GC: prune all packfiles after the loosen phase Prepare 5.13.3-SNAPSHOT builds JGit v5.13.2.202306221912-r Change-Id: Ib08037f6055dac1776e38cfb4ff8c88a50ad3e60
| | | | | * | Merge branch 'stable-5.13' into stable-6.0Matthias Sohn2023-08-033-6/+35
| | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: Add verification in GcKeepFilesTest that bitmaps are generated Express the explicit intention of creating bitmaps in GC GC: prune all packfiles after the loosen phase Prepare 5.13.3-SNAPSHOT builds JGit v5.13.2.202306221912-r Change-Id: I1f50995d9d9c592ec0e02a04e0e409440b49f9f3
| | | | | | * Add verification in GcKeepFilesTest that bitmaps are generatedLuca Milanesio2023-07-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The packfiles with the .keep extensions are meant to prevent a packfile from being processed or removed during GC. From the point of view of the GC process then, the associated packfile should be completely transparent: - it should not included in the repacked file - it should not pruned - its objects should be left untouched, even if unreachable - the GC process, including the bitmap generation should continue as usual, as the the packfiles with .keep file did not exist Add one explicit test for making sure that the management of .keep file is also transparent to the generation of bitmaps, which are still generated if a .keep file exists. Bug: 582039 Change-Id: I14f6adc3f961c606fbc617e51ea6ed6e2ef8604f
| | | | | | * Express the explicit intention of creating bitmaps in GCLuca Milanesio2023-07-052-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an explicit flag to PackWriter for allowing the GC.repack() phase to explicitly generate bitmaps only for the heads packfile and not for the others. Previously the bitmap generation was conditioned to the presence of object ids exclusion from the PackWriter. The introduction of the bitmap generation in the PackWriter done in Icdb0cdd66 has accidentally made the .keep files not completely transparent, because their presence have disabled the generation of the bitmap index, even if the generation of bitmaps is enabled. This bug has been an accidental consequence of the intention of the bitmap generator to avoid generating bitmaps for the non-heads packfile, however the implementation done by Colby decided to use the excludeInPacks variable (see [1]) which is unfortunately also used for excluding the packfiles having an associated .keep file (see [2]). [1] https://git.eclipse.org/r/c/jgit/jgit/+/7940/18/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java#1617 [2] https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/dafcb8f6db82b899c917832768f1c240d273190c/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/GC.java#506 Bug: 582039 Change-Id: Id722e68d9ff4ac24e73bf765ab11017586b6766e
| | | | | | * GC: prune all packfiles after the loosen phaseLuca Milanesio2023-07-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When loosening the objects inside the packfiles to be pruned, make sure that the packfile list is stable and prune all the files after the loosening is done. This prevents a series of exceptions previously thrown when loosening the packfiles, due to the too early pruning of the packfiles that were still in the pack list. Bug: 581532 Change-Id: I776776e2e083f1fa749d53f965bf50f919823b4f