aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Prepare 6.5.0-SNAPSHOT buildsMatthias Sohn2023-03-0191-125/+125
| | | | Change-Id: Ie95ce8fcc2a570505d23d5a1642e33c041212260
* JGit v6.5.0.202302221508-m3v6.5.0.202302221508-m3Matthias Sohn2023-02-2291-125/+125
| | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: I00bf91823e2fe6503d52ae23bc1854f0b1d66dbd
* Merge branch 'master' into stable-6.5Matthias Sohn2023-02-222-10/+8
|\ | | | | | | | | | | | | | | | | | | * master: If tryLock fails to get the lock another gc has it Fix GcConcurrentTest#testInterruptGc Don't swallow IOException in GC.PidLock#lock Check if FileLock is valid before using or releasing it Change-Id: I0a599ec9241dd3b9b9a61122b2eda6bd647bcc22
| * Merge branch 'stable-6.4'Matthias Sohn2023-02-222-10/+8
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.4: If tryLock fails to get the lock another gc has it Fix GcConcurrentTest#testInterruptGc Don't swallow IOException in GC.PidLock#lock Check if FileLock is valid before using or releasing it Change-Id: Ia2797b44a60342eb9df53f0b3d674cba92a512fc
| | * Merge branch 'stable-6.3' into stable-6.4Matthias Sohn2023-02-222-10/+8
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: If tryLock fails to get the lock another gc has it Fix GcConcurrentTest#testInterruptGc Don't swallow IOException in GC.PidLock#lock Check if FileLock is valid before using or releasing it Change-Id: I5af34c92e423a651db53b4dc45ed844d5f39910d
| | | * Merge branch 'stable-6.2' into stable-6.3Matthias Sohn2023-02-222-10/+8
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: If tryLock fails to get the lock another gc has it Fix GcConcurrentTest#testInterruptGc Don't swallow IOException in GC.PidLock#lock Check if FileLock is valid before using or releasing it Change-Id: I5b6b10622b61fde3f0f10455a74ae159a0b69082
| | | | * Merge branch 'stable-6.1' into stable-6.2Matthias Sohn2023-02-222-10/+8
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: If tryLock fails to get the lock another gc has it Fix GcConcurrentTest#testInterruptGc Don't swallow IOException in GC.PidLock#lock Check if FileLock is valid before using or releasing it Change-Id: I3ffe92566cc145053bb762f612dd96bc6d542c62
| | | | | * Merge branch 'stable-6.0' into stable-6.1Matthias Sohn2023-02-222-10/+8
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: If tryLock fails to get the lock another gc has it Fix GcConcurrentTest#testInterruptGc Don't swallow IOException in GC.PidLock#lock Check if FileLock is valid before using or releasing it Change-Id: Idea23e555c024557d7e39a86efe25f609400b962
| | | | | | * Merge branch 'stable-5.13' into stable-6.0Matthias Sohn2023-02-222-10/+8
| | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: If tryLock fails to get the lock another gc has it Fix GcConcurrentTest#testInterruptGc Don't swallow IOException in GC.PidLock#lock Check if FileLock is valid before using or releasing it Change-Id: I708d0936fa86b028e4da4e7e21f332f8b48ad293
| | | | | | | * If tryLock fails to get the lock another gc has itMatthias Sohn2023-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ifd3bbcc5e0591883b774d23256949a83010ea134
| | | | | | | * Fix GcConcurrentTest#testInterruptGcMatthias Sohn2023-02-221-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the new GC.PidLock interrupting a running GC throws a ClosedByInterruptException. Change-Id: I7ccea1ae9a43d4edfdab2fcfd1324c64cc22b38f
| | | | | | | * Don't swallow IOException in GC.PidLock#lockMatthias Sohn2023-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This broke the test GcConcurrentTest#testInterruptGc which expects ClosedByInterruptException when the thread doing gc is interrupted. Change-Id: I89e02fc37aceeccb04c20cfc5b71cb8fa21793d6
| | | | | | | * Check if FileLock is valid before using or releasing itMatthias Sohn2023-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I23ba67b61b9b03772f33a929c080c0d02b8c8652
* | | | | | | | Merge branch 'master' into stable-6.5Matthias Sohn2023-02-226-1/+224
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Use Java 11 ProcessHandle to get pid of the current process UploadPack: use allow-any-sha1-in-want configuration Acquire file lock "gc.pid" before running gc Silence API errors introduced by 9424052f Change-Id: I71c8ee39e0f3438cbc1992c24f9f6c33ece88c07
| * | | | | | | Merge branch 'stable-6.4'Matthias Sohn2023-02-223-0/+162
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.4: Use Java 11 ProcessHandle to get pid of the current process Acquire file lock "gc.pid" before running gc Silence API errors introduced by 9424052f Change-Id: Ifa4e56b6ecca9305f3f1685e45450019bfc82e22
| | * | | | | | Merge branch 'stable-6.3' into stable-6.4Matthias Sohn2023-02-223-7/+170
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: Use Java 11 ProcessHandle to get pid of the current process Acquire file lock "gc.pid" before running gc Silence API errors introduced by 9424052f Change-Id: Ic40dbab18616d8d9fe3820b9890c86652b80eb47
| | | * | | | | Merge branch 'stable-6.2' into stable-6.3Matthias Sohn2023-02-223-7/+170
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: Use Java 11 ProcessHandle to get pid of the current process Acquire file lock "gc.pid" before running gc Silence API errors introduced by 9424052f Change-Id: I53cf9675deac0b588048d8224216d2a7e8bd16ec
| | | | * | | | Merge branch 'stable-6.1' into stable-6.2Matthias Sohn2023-02-223-7/+170
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: Use Java 11 ProcessHandle to get pid of the current process Acquire file lock "gc.pid" before running gc Silence API errors introduced by 9424052f Change-Id: I0562a4a224779ccf1e4cc1ff8f5a352e55ab220a
| | | | | * | | Merge branch 'stable-6.0' into stable-6.1Matthias Sohn2023-02-223-7/+170
| | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: Use Java 11 ProcessHandle to get pid of the current process Acquire file lock "gc.pid" before running gc Silence API errors introduced by 9424052f Change-Id: Ib9a2419253ffcbc90874adbfdb8129fee3178210
| | | | | | * | Use Java 11 ProcessHandle to get pid of the current processMatthias Sohn2023-02-221-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I790f218601c1d5e1b39c4101e3b2708e76b9d782
| | | | | | * | Merge branch 'stable-5.13' into stable-6.0Matthias Sohn2023-02-223-7/+180
| | | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: Acquire file lock "gc.pid" before running gc Silence API errors introduced by 9424052f Change-Id: Ibb5c46cb79377d2d2cd7d4586f31c86665d2851c
| | | | | | | * Acquire file lock "gc.pid" before running gcMatthias Sohn2023-02-213-8/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git guards gc by locking a lock file "gc.pid" before starting execution. The lock file contains the pid and hostname of the process holding the lock. Git tries to kill the process holding that lock if the lock file wasn't modified in the last 12 hours and was started from the same host. Teach JGit to acquire this lock before running gc but skip execution if another process already holds the lock. Killing the other process could be undesired if it's a long running application. If the lock file wasn't modified in the last 12 hours try to lock it and run gc if locking succeeds. Register a shutdown hook for the lock file to ensure it is cleaned up if the process is gracefully killed. Change-Id: I00b838dcbf4fb0d03863bf7a2cd86b743c6c6971
| | | | | | | * Silence API errors introduced by 9424052fMatthias Sohn2023-02-211-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ia9e619a8fa06648086b583c994e4b107ae06c44d
| * | | | | | | UploadPack: use allow-any-sha1-in-want configurationkylezhao2023-02-213-1/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C git 2.11 supports setting the equivalent of RequestPolicy.ANY with uploadpack.allowAnySHA1InWant[1]. Parse this into TransportConfig and use it from UploadPack. Add additional tests for [2] and this change. We can execute "git clone --filter=blob:none --no-checkout" successfully with config uploadPack.allowFilter is true. But when we checkout, the git will fetch other missing objects required by the checkout(this is why we need this config). When both uploadPack.allowFilter and uploadPack.allowAnySHA1InWant are true, jgit will support partial clone. If you are using an extremely large monorepo, this feature can help. It allows users to work on an incomplete repo which reduces disk usage. [1] https://github.com/git/git/commit/f8edeaa05d8623a9f6dad408237496c51101aad8 [2] change Id39771a6e42d8082099acde11249306828a053c0 Bug: 573390 Change-Id: I8fe75f03bf1fea7c11e0d67c8637bd05dd1f9b89 Signed-off-by: kylezhao <kylezhao@tencent.com>
* | | | | | | | Merge branch 'master' into stable-6.5Matthias Sohn2023-02-2042-56/+1858
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Externalize strings introduced in c9552aba Silence API error introduced by 596c445a PackConfig: add entry for minimum size to index Fix getPackedRefs to not throw NoSuchFileException PackObjectSizeIndex: interface and impl for the object-size index UInt24Array: Array of unsigned ints encoded in 3 bytes. PackIndex: expose the position of an object-id in the index Add pack options to preserve and prune old pack files DfsPackFile/DfsGC: Write commit graphs and expose in pack ObjectReader: Allow getCommitGraph to throw IOException Allow to perform PackedBatchRefUpdate without locking loose refs Document option "core.sha1Implementation" introduced in 59029aec UploadPack: consume delimiter in object-info command PatchApplier fix - init cache with provided tree Avoid error-prone warning Fix unused exception error-prone warning UploadPack: advertise object-info command if enabled Move MemRefDatabase creation in a separate method. DfsReaderIoStats: Add Commit Graph fields into DfsReaderIoStats Change-Id: Ic9f91f2139432999b99c444302457b3c08911009
| * | | | | | | Externalize strings introduced in c9552abaMatthias Sohn2023-02-204-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I81bb78344df61e6eb42622fcef6235d4da0ae052
| * | | | | | | Silence API error introduced by 596c445aMatthias Sohn2023-02-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I961ba2d89c11373ccb81e6450d7d951204ffca36
| * | | | | | | Merge branch 'stable-6.4'Matthias Sohn2023-02-206-9/+49
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.4: Fix getPackedRefs to not throw NoSuchFileException Add pack options to preserve and prune old pack files Allow to perform PackedBatchRefUpdate without locking loose refs Document option "core.sha1Implementation" introduced in 59029aec Change-Id: I36051c623fcd480aa80ed32b4e89f9bdd1b798e0
| | * | | | | | Merge branch 'stable-6.3' into stable-6.4Matthias Sohn2023-02-205-9/+37
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: Fix getPackedRefs to not throw NoSuchFileException Add pack options to preserve and prune old pack files Allow to perform PackedBatchRefUpdate without locking loose refs Document option "core.sha1Implementation" introduced in 59029aec Change-Id: I1073098fb06eabafdb3c5e7fcf44d55b86a1b152
| | | * | | | | Merge branch 'stable-6.2' into stable-6.3Matthias Sohn2023-02-206-9/+49
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.2: Fix getPackedRefs to not throw NoSuchFileException Add pack options to preserve and prune old pack files Allow to perform PackedBatchRefUpdate without locking loose refs Document option "core.sha1Implementation" introduced in 59029aec Change-Id: I765c7302ce84a6a9c28fdef29da2bfaa49477c6e
| | | | * | | | Merge branch 'stable-6.1' into stable-6.2Matthias Sohn2023-02-166-9/+49
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: Fix getPackedRefs to not throw NoSuchFileException Add pack options to preserve and prune old pack files Allow to perform PackedBatchRefUpdate without locking loose refs Document option "core.sha1Implementation" introduced in 59029aec Change-Id: Id32683d5f506e082d39af269803bccee0280cc27
| | | | | * | | Merge branch 'stable-6.0' into stable-6.1Matthias Sohn2023-02-165-8/+47
| | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: Add pack options to preserve and prune old pack files Allow to perform PackedBatchRefUpdate without locking loose refs Document option "core.sha1Implementation" introduced in 59029aec Change-Id: I876a38c2de8b7d5eaacd00e36b85599f88173221
| | | | | | * | Merge branch 'stable-5.13' into stable-6.0Matthias Sohn2023-02-167-11/+148
| | | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.13: Add pack options to preserve and prune old pack files Allow to perform PackedBatchRefUpdate without locking loose refs Document option "core.sha1Implementation" introduced in 59029aec Change-Id: I423f410578f5bbe178832b80fef8998a5372182c
| | | | | | | * Add pack options to preserve and prune old pack filesMatthias Sohn2023-02-114-8/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the options - pack.preserveOldPacks - pack.prunePreserved This allows to configure in git config if old packs should be preserved during gc and pruned during the next gc. The original implementation in 91132bb0 only allows to set these options using the API. Change-Id: I5b23ab4f317d12f5ccd234401419913e8263cc9a
| | | | | | | * Allow to perform PackedBatchRefUpdate without locking loose refsSaša Živkov2023-02-032-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add another newBatchUpdate method in the RefDirectory where we can control if the created PackedBatchRefUpdate will lock the loose refs or not. This can be useful in cases when we run programs which have exclusive access to a Git repository and we know that locking loose refs is unnecessary and just a performance loss. Change-Id: I7d0932eb1598a3871a2281b1a049021380234df9 (cherry picked from commit cb90ed08526bd51f04e5d72e3ba3cf5bd30c11e4)
| | | | | | | * Document option "core.sha1Implementation" introduced in 59029aecMatthias Sohn2023-02-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 580310 Change-Id: I10f3d6f6b5af7ab96683994c9cbd85e6c18a5084
| | | | | * | | Fix getPackedRefs to not throw NoSuchFileExceptionPrudhvi Akhil Alahari2023-02-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Files.newInputStream is from java.nio package, it throws java.nio.file.NoSuchFileException. This was missed in the change I00da88e. Without this change, getPackedRefs fails with NoSuchFileException when there is no packed-refs file in a project. Change-Id: I93c202ddb73a0a5979af8e4d09e45f5645664b45 Signed-off-by: Prudhvi Akhil Alahari <quic_prudhvi@quicinc.com>
| * | | | | | | PackConfig: add entry for minimum size to indexIvan Frade2023-02-163-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The object size index can have up to #(blobs-in-repo) entries, taking a relevant amount of memory. Let operators configure the threshold size to include objects in the size index. The index will include objects with size *at or above* this value (with -1 for none). This is more effective for the filter-by-size case. Lowering the threshold adds more objects to the index. This improves performance at the cost of memory/storage space. For the object-size case, more calls will use the index instead of reading IO. For the filter-by-size case, lower threshold means better granularity (if ObjectReader#isSmallerThan is implemented based only on the index). Change-Id: I6ccd9334adbbc2abf95fde51dbbfc85b8230ade0
| * | | | | | | PackObjectSizeIndex: interface and impl for the object-size indexIvan Frade2023-02-145-0/+989
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Operations like "clone --filter=blob:limit=N" or the "object-info" command need to read the size of the objects from the storage. An index would provide those sizes at once rather than having to seek in the packfile. Introduce an interface for the Object-size index. This index returns the inflated size of an object. Not all objects could be indexed (to limit memory usage). This implementation indexes only blobs (no trees, nor commits) *above* certain size threshold (configurable). Lower threshold adds more objects to the index, consumes more memory and provides better performance. 0 means "all blobs" and -1 "disabled". If we don't index everything, for the filter use case is more efficient to index the biggest objects first: the set is small and most objects are filtered by NOT being in the index. For the object-size, the more objects in the index the better, regardless their size. All together, it is more helpful to index above threshold. Change-Id: I9ed608ac240677e199b90ca40d420bcad9231489
| * | | | | | | UInt24Array: Array of unsigned ints encoded in 3 bytes.Ivan Frade2023-02-142-0/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The object size index stores positions of objects in the main index (when ordered by sha1). These positions are per-pack and usually a pack has <16 million objects (there are exceptions but rather rare). It could save some memory storing these positions in three bytes instead of four. Note that these positions are sorted and always positive. Implement a wrapper around a byte[] to access and search "ints" while they are stored as unsigned 3 bytes. Change-Id: Iaa26ce8e2272e706e35fe4cdb648fb6ca7591972
| * | | | | | | PackIndex: expose the position of an object-id in the indexIvan Frade2023-02-144-7/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary index returns the offset in the pack for an objectId. Internally it keeps the object-ids in lexicographical order, but doesn't expose an API to find the position of an object-id in that list. This is needed for the object-size index, that we want to store as "position-in-idx, size". Add a #findPosition(object-id) method to the PackIndex interface to know where an object-id sits in the ordered list of ids in the pack. Note that this index position is over the list of ordered object-ids, while reverse-index position is over the list of objects in packed order. Change-Id: I89fa146599e347a26d3012d3477d7f5bbbda7ba4
| * | | | | | | DfsPackFile/DfsGC: Write commit graphs and expose in packXing Huang2023-02-077-1/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JGit knows how to read/write commit graphs but the DFS stack is not using it yet. The DFS garbage collector generates a commit-graph with commits reachable from any ref. The pack is stored as extra stream in the GC pack. DfsPackFile mimicks how other indices are loaded storing the reference in DFS cache. Signed-off-by: Xing Huang <xingkhuang@google.com> Change-Id: I3f94997377986d21a56b300d8358dd27be37f5de
| * | | | | | | ObjectReader: Allow getCommitGraph to throw IOExceptionXing Huang2023-02-072-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ObjectReader#getCommitGraph doesn't report errors loading the commit graph. The caller should be aware of the situation and ultimately decide what to do. Add IOException to ObjectReader#getCommitGraph signature. RevWalk defaults to an empty commit-graph on IO errors. Signed-off-by: Xing Huang <xingkhuang@google.com> Change-Id: I38eeacff76c7f926b6dfb192d1e5916e40770024
| * | | | | | | Merge "Merge branch 'stable-6.5'"Matthias Sohn2023-02-020-0/+0
| |\ \ \ \ \ \ \
| | * \ \ \ \ \ \ Merge branch 'stable-6.5'Matthias Sohn2023-02-010-0/+0
| | |\ \ \ \ \ \ \ | |_|/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.5: Prepare 6.5.0-SNAPSHOT builds JGit v6.5.0.202302011120-m2 Change-Id: I2629d0e07d25690e6de179a42e2d7e3321791f8f
* | | | | | | | | Prepare 6.5.0-SNAPSHOT buildsMatthias Sohn2023-02-0191-125/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Id0c7e51293d53b1eeec081cbbdf6e27d77123200
* | | | | | | | | JGit v6.5.0.202302011120-m2v6.5.0.202302011120-m2Matthias Sohn2023-02-0191-125/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Change-Id: I231d3f9b8a59e374477d3a33964061acb2c25ce4
* | | | | | | | | Merge branch 'master' into stable-6.5Matthias Sohn2023-02-0139-89/+732
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Shortcut during git fetch for avoiding looping through all local refs FetchCommand: fix fetchSubmodules to work on a Ref to a blob Silence API warnings introduced by I466dcde6 Allow the exclusions of refs prefixes from bitmap PackWriterBitmapPreparer: do not include annotated tags in bitmap BatchingProgressMonitor: avoid int overflow when computing percentage [pgm] Fetch-CLI: add support for shallow Speedup GC listing objects referenced from reflogs Re-add servlet-api 4.0 to the target platform Upgrade maven plugins Cache trustFolderStat/trustPackedRefsStat value per-instance Refresh 'objects' dir and retry if a loose object is not found FileSnapshotTest: Add more MISSING_FILE coverage Change-Id: I370bc228481864912c3cd88d43e5a70517b1c186
| | * \ \ \ \ \ \ \ Merge "UploadPack: consume delimiter in object-info command"Han-Wen NIenhuys2023-02-022-1/+9
| | |\ \ \ \ \ \ \ \
| | | * | | | | | | | UploadPack: consume delimiter in object-info commandHan-Wen Nienhuys2023-02-022-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'size' packet line is an argument, so it must be preceeded by a 0001 delimiter. See also git's t5701-git-serve.sh test, https://github.com/git/git/blob/8b8d9a2/t/t5701-git-serve.sh#L329 Without this fix, the server will choke on the delimiter line, saying PackProtocolException: unexpected <empty string> To test, I ran Gerrit locally with this fix $ curl -X POST -H 'git-protocol: version=2' -H 'content-type: application/x-git-upload-pack-request' -H 'accept: application/x-git-upload-pack-result' --data $'0018command=object-info\n00010009size\n0031oid d38b1b92bdb2893eb4505667375563f2d6d4086b\n0000' http://localhost:8080/git.git/git-upload-pack => 0008size0032d38b1b92bdb2893eb4505667375563f2d6d4086b 268590000 The same command completes identically on Gitlab (which supports the object-info command) $ curl -X POST -H 'git-protocol: version=2' -H 'content-type: application/x-git-upload-pack-request' -H 'accept: application/x-git-upload-pack-result' --data $'0018command=object-info\n00010009size\n0031oid d38b1b92bdb2893eb4505667375563f2d6d4086b\n0000' https://gitlab.com/gitlab-org/git.git/git-upload-pack => 0008size0032d38b1b92bdb2893eb4505667375563f2d6d4086b 268590000 In this case, the blob is for the COPYING file in the Git source tree, which is 26859 bytes long. Change-Id: Ief4ce1eb9303a3b2479547d7950ef01c7c28f472