]> source.dussan.org Git - jgit.git/log
jgit.git
18 months agoMerge branch 'stable-6.3' into stable-6.4 94/200794/1
Matthias Sohn [Thu, 23 Mar 2023 08:07:09 +0000 (09:07 +0100)]
Merge branch 'stable-6.3' into stable-6.4

* stable-6.3:
  GC: Close File.lines stream

Change-Id: I99455916d447f5dffed85e9a5c1d51b323f07a16

18 months agoMerge branch 'stable-6.2' into stable-6.3 93/200793/1
Matthias Sohn [Thu, 23 Mar 2023 08:06:43 +0000 (09:06 +0100)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  GC: Close File.lines stream

Change-Id: Id93b1933a5ce1ede9eb388c9fd54a4b3749694bf

18 months agoMerge branch 'stable-6.1' into stable-6.2 92/200792/1
Matthias Sohn [Thu, 23 Mar 2023 08:06:16 +0000 (09:06 +0100)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  GC: Close File.lines stream

Change-Id: Ia2be0b05ed860125a388b01d6c291832f08dd990

18 months agoMerge branch 'stable-6.0' into stable-6.1 91/200791/1
Matthias Sohn [Thu, 23 Mar 2023 08:05:42 +0000 (09:05 +0100)]
Merge branch 'stable-6.0' into stable-6.1

* stable-6.0:
  GC: Close File.lines stream

Change-Id: I2f9e6da5584a40bb4b4efed0b87ae456f119d757

18 months agoMerge branch 'stable-5.13' into stable-6.0 90/200790/1
Matthias Sohn [Thu, 23 Mar 2023 08:04:50 +0000 (09:04 +0100)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  GC: Close File.lines stream

Change-Id: Ib473750e5a3ad3d74b0cb41f25052890f50a975c

18 months agoGC: Close File.lines stream 89/200789/2
Xing Huang [Tue, 21 Mar 2023 22:27:49 +0000 (17:27 -0500)]
GC: Close File.lines stream

From File#lines javadoc: The returned stream from File Lines
encapsulates a Reader. If timely disposal of file system resources is
required, the try-with-resources construct should be used to ensure
that the stream's close method is
invoked after the stream operations are completed.

Wrap File.lines with try-with-resources.

Change-Id: I82c6faa3ef1083f6c7e964f96e9540b4db18eee8
Signed-off-by: Xing Huang <xingkhuang@google.com>
(cherry picked from commit 172a207945da376b6b4143305aef2af56f7c42e2)

19 months agoMerge branch 'stable-6.3' into stable-6.4 19/200319/1
Matthias Sohn [Fri, 3 Mar 2023 15:02:49 +0000 (16:02 +0100)]
Merge branch 'stable-6.3' into stable-6.4

* stable-6.3:
  Improve test coverage when core.trustPackedRefsStat set to after_open

Change-Id: I236c5cbb638493cc4b23475be50d0f724d62a688

19 months agoMerge branch 'stable-6.2' into stable-6.3 18/200318/1
Matthias Sohn [Fri, 3 Mar 2023 15:02:16 +0000 (16:02 +0100)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  Improve test coverage when core.trustPackedRefsStat set to after_open

Change-Id: I02d7444b28b662eb46f3d0ba1a62d342820bed1f

19 months agoMerge branch 'stable-6.1' into stable-6.2 17/200317/1
Matthias Sohn [Fri, 3 Mar 2023 15:01:26 +0000 (16:01 +0100)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  Improve test coverage when core.trustPackedRefsStat set to after_open

Change-Id: I63ba388ee2e174019733e63f8177792e1808a5c3

19 months agoImprove test coverage when core.trustPackedRefsStat set to after_open 04/200304/1
Prudhvi Akhil Alahari [Thu, 2 Mar 2023 11:21:48 +0000 (16:51 +0530)]
Improve test coverage when core.trustPackedRefsStat set to after_open

As of today, we don't have test coverage for RefDirectory when
core.trustPackedRefsStat config is set to after_open. Thus create new
test classes which set core.trustPackedRefsStat config to after_open in
setup and extend RefDirectoryTest and FileRepositoryBuilderTest
respectively.

Change-Id: I1db6fcf414bc488106ad4c85fb934480f299c995
Signed-off-by: Prudhvi Akhil Alahari <quic_prudhvi@quicinc.com>
19 months agoMerge branch 'stable-6.3' into stable-6.4 25/200125/2
Matthias Sohn [Wed, 22 Feb 2023 20:04:31 +0000 (21:04 +0100)]
Merge branch 'stable-6.3' into stable-6.4

* 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

19 months agoMerge branch 'stable-6.2' into stable-6.3 24/200124/1
Matthias Sohn [Wed, 22 Feb 2023 20:03:52 +0000 (21:03 +0100)]
Merge branch 'stable-6.2' into stable-6.3

* 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

19 months agoMerge branch 'stable-6.1' into stable-6.2 23/200123/1
Matthias Sohn [Wed, 22 Feb 2023 20:03:22 +0000 (21:03 +0100)]
Merge branch 'stable-6.1' into stable-6.2

* 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

19 months agoMerge branch 'stable-6.0' into stable-6.1 22/200122/1
Matthias Sohn [Wed, 22 Feb 2023 20:02:47 +0000 (21:02 +0100)]
Merge branch 'stable-6.0' into stable-6.1

* 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

19 months agoMerge branch 'stable-5.13' into stable-6.0 21/200121/1
Matthias Sohn [Wed, 22 Feb 2023 20:02:09 +0000 (21:02 +0100)]
Merge branch 'stable-5.13' into stable-6.0

* 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

19 months agoIf tryLock fails to get the lock another gc has it 19/200119/2
Matthias Sohn [Wed, 22 Feb 2023 19:36:39 +0000 (20:36 +0100)]
If tryLock fails to get the lock another gc has it

Change-Id: Ifd3bbcc5e0591883b774d23256949a83010ea134

19 months agoFix GcConcurrentTest#testInterruptGc 18/200118/2
Matthias Sohn [Wed, 22 Feb 2023 19:35:01 +0000 (20:35 +0100)]
Fix GcConcurrentTest#testInterruptGc

With the new GC.PidLock interrupting a running GC throws a
ClosedByInterruptException.

Change-Id: I7ccea1ae9a43d4edfdab2fcfd1324c64cc22b38f

19 months agoDon't swallow IOException in GC.PidLock#lock 06/200106/1
Matthias Sohn [Wed, 22 Feb 2023 18:27:30 +0000 (19:27 +0100)]
Don't swallow IOException in GC.PidLock#lock

This broke the test GcConcurrentTest#testInterruptGc which expects
ClosedByInterruptException when the thread doing gc is interrupted.

Change-Id: I89e02fc37aceeccb04c20cfc5b71cb8fa21793d6

19 months agoCheck if FileLock is valid before using or releasing it 71/200071/2
Matthias Sohn [Wed, 22 Feb 2023 01:42:32 +0000 (02:42 +0100)]
Check if FileLock is valid before using or releasing it

Change-Id: I23ba67b61b9b03772f33a929c080c0d02b8c8652

19 months agoMerge branch 'stable-6.3' into stable-6.4 67/200067/1
Matthias Sohn [Wed, 22 Feb 2023 00:28:27 +0000 (01:28 +0100)]
Merge branch 'stable-6.3' into stable-6.4

* 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

19 months agoMerge branch 'stable-6.2' into stable-6.3 66/200066/1
Matthias Sohn [Wed, 22 Feb 2023 00:27:50 +0000 (01:27 +0100)]
Merge branch 'stable-6.2' into stable-6.3

* 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

19 months agoMerge branch 'stable-6.1' into stable-6.2 65/200065/1
Matthias Sohn [Wed, 22 Feb 2023 00:27:16 +0000 (01:27 +0100)]
Merge branch 'stable-6.1' into stable-6.2

* 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

19 months agoMerge branch 'stable-6.0' into stable-6.1 64/200064/1
Matthias Sohn [Wed, 22 Feb 2023 00:26:36 +0000 (01:26 +0100)]
Merge branch 'stable-6.0' into stable-6.1

* 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

19 months agoUse Java 11 ProcessHandle to get pid of the current process 63/200063/1
Matthias Sohn [Wed, 22 Feb 2023 00:06:06 +0000 (01:06 +0100)]
Use Java 11 ProcessHandle to get pid of the current process

Change-Id: I790f218601c1d5e1b39c4101e3b2708e76b9d782

19 months agoMerge branch 'stable-5.13' into stable-6.0 62/200062/1
Matthias Sohn [Wed, 22 Feb 2023 00:00:26 +0000 (01:00 +0100)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  Acquire file lock "gc.pid" before running gc
  Silence API errors introduced by 9424052f

Change-Id: Ibb5c46cb79377d2d2cd7d4586f31c86665d2851c

19 months agoAcquire file lock "gc.pid" before running gc 48/199848/4
Matthias Sohn [Fri, 10 Feb 2023 22:39:20 +0000 (23:39 +0100)]
Acquire file lock "gc.pid" before running gc

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

19 months agoSilence API errors introduced by 9424052f 37/200037/1
Matthias Sohn [Mon, 20 Feb 2023 21:32:37 +0000 (22:32 +0100)]
Silence API errors introduced by 9424052f

Change-Id: Ia9e619a8fa06648086b583c994e4b107ae06c44d

19 months agoMerge branch 'stable-6.3' into stable-6.4 27/200027/1
Matthias Sohn [Mon, 20 Feb 2023 20:01:38 +0000 (21:01 +0100)]
Merge branch 'stable-6.3' into stable-6.4

* 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

19 months agoMerge branch 'stable-6.2' into stable-6.3 26/200026/1
Matthias Sohn [Mon, 20 Feb 2023 19:59:14 +0000 (20:59 +0100)]
Merge branch 'stable-6.2' into stable-6.3

* 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

19 months agoMerge branch 'stable-6.1' into stable-6.2 25/200025/1
Matthias Sohn [Thu, 16 Feb 2023 15:59:56 +0000 (16:59 +0100)]
Merge branch 'stable-6.1' into stable-6.2

* 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

19 months agoMerge branch 'stable-6.0' into stable-6.1 67/199967/1
Matthias Sohn [Thu, 16 Feb 2023 15:56:07 +0000 (16:56 +0100)]
Merge branch 'stable-6.0' into stable-6.1

* 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

19 months agoMerge branch 'stable-5.13' into stable-6.0 62/199962/2
Matthias Sohn [Thu, 16 Feb 2023 15:42:58 +0000 (16:42 +0100)]
Merge branch 'stable-5.13' into stable-6.0

* 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

19 months agoFix getPackedRefs to not throw NoSuchFileException 59/199959/1
Prudhvi Akhil Alahari [Thu, 16 Feb 2023 11:11:55 +0000 (16:41 +0530)]
Fix getPackedRefs to not throw NoSuchFileException

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>
20 months agoAdd pack options to preserve and prune old pack files 46/199846/2
Matthias Sohn [Fri, 10 Feb 2023 20:05:47 +0000 (21:05 +0100)]
Add pack options to preserve and prune old pack files

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

20 months agoAllow to perform PackedBatchRefUpdate without locking loose refs 58/199758/1
Saša Živkov [Fri, 21 Oct 2022 14:32:03 +0000 (16:32 +0200)]
Allow to perform PackedBatchRefUpdate without locking loose refs

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)

20 months agoDocument option "core.sha1Implementation" introduced in 59029aec 11/199711/2
Matthias Sohn [Wed, 1 Feb 2023 13:33:31 +0000 (14:33 +0100)]
Document option "core.sha1Implementation" introduced in 59029aec

Bug: 580310
Change-Id: I10f3d6f6b5af7ab96683994c9cbd85e6c18a5084

20 months agoMerge branch 'stable-6.3' into stable-6.4 87/199687/1
Matthias Sohn [Wed, 1 Feb 2023 00:12:06 +0000 (01:12 +0100)]
Merge branch 'stable-6.3' into stable-6.4

* stable-6.3:
  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
  Speedup GC listing objects referenced from reflogs
  FileSnapshotTest: Add more MISSING_FILE coverage

Change-Id: Iefcf5d832bd0087c1027876f2200689e1150abce

20 months agoMerge branch 'stable-6.2' into stable-6.3 86/199686/1
Matthias Sohn [Tue, 31 Jan 2023 23:59:32 +0000 (00:59 +0100)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  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
  Speedup GC listing objects referenced from reflogs
  FileSnapshotTest: Add more MISSING_FILE coverage

Change-Id: I2ff386d9a096277360e6c7bd5535b49984620fb3

20 months agoMerge branch 'stable-6.1' into stable-6.2 85/199685/1
Matthias Sohn [Tue, 31 Jan 2023 23:44:41 +0000 (00:44 +0100)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  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
  Speedup GC listing objects referenced from reflogs
  FileSnapshotTest: Add more MISSING_FILE coverage

Change-Id: Iff2fba026b49463016015b2fae1a42cf76ee2dbb

20 months agoMerge branch 'stable-6.0' into stable-6.1 84/199684/1
Matthias Sohn [Tue, 31 Jan 2023 23:38:52 +0000 (00:38 +0100)]
Merge branch 'stable-6.0' into stable-6.1

* stable-6.0:
  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
  Speedup GC listing objects referenced from reflogs
  FileSnapshotTest: Add more MISSING_FILE coverage

Change-Id: Ib5055f2f3b8a313c178d6f6c7c5630285ad5a726

20 months agoMerge branch 'stable-5.13' into stable-6.0 83/199683/1
Matthias Sohn [Tue, 31 Jan 2023 23:30:52 +0000 (00:30 +0100)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  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
  Speedup GC listing objects referenced from reflogs
  FileSnapshotTest: Add more MISSING_FILE coverage

Change-Id: I58ad4c210a5e7e5a1ba6b22315b04211c8909950

20 months agoShortcut during git fetch for avoiding looping through all local refs 64/193464/12
Luca Milanesio [Wed, 18 May 2022 12:31:30 +0000 (13:31 +0100)]
Shortcut during git fetch for avoiding looping through all local refs

The FetchProcess needs to verify that all the refs received point
to objects that are reachable from the local refs, which could be
very expensive but is needed to avoid missing objects exceptions
because of broken chains.

When the local repository has a lot of refs (e.g. millions) and the
client is fetching a non-commit object (e.g. refs/sequences/changes in
Gerrit) the reachability check on all local refs can be very expensive
compared to the time to fetch the remote ref.

Example for a 2M refs repository:
- fetching a single non-commit object: 50ms
- checking the reachability of local refs: 30s

A ref pointing to a non-commit object doesn't have any parent or
successor objects, hence would never need to have a reachability check
done. Skipping the askForIsComplete() altogether would save the 30s
time spent in an unnecessary phase.

Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Change-Id: I09ac66ded45cede199ba30f9e71cc1055f00941b

20 months agoFetchCommand: fix fetchSubmodules to work on a Ref to a blob 23/196223/2
Matthias Sohn [Tue, 4 Oct 2022 13:42:25 +0000 (15:42 +0200)]
FetchCommand: fix fetchSubmodules to work on a Ref to a blob

FetchCommand#fetchSubmodules assumed that FETCH_HEAD can always be
parsed as a tree. This isn't true if it refers to a Ref referring to a
BLOB. This is e.g. used in Gerrit for Refs like refs/sequences/changes
which are used to implement sequences stored in git.

Change-Id: I414f5b7d9f2184b2d7d53af1dfcd68cccb725ca4

20 months agoSilence API warnings introduced by I466dcde6 80/199680/1
Matthias Sohn [Tue, 31 Jan 2023 22:45:07 +0000 (23:45 +0100)]
Silence API warnings introduced by I466dcde6

Change-Id: I510510da34d33757c2f83af8cd1e26f6206a486a

20 months agoAllow the exclusions of refs prefixes from bitmap 76/197776/28
Luca Milanesio [Tue, 20 Dec 2022 21:50:19 +0000 (21:50 +0000)]
Allow the exclusions of refs prefixes from bitmap

When running a GC.repack() against a repository with over one
thousands of refs/heads and tens of millions of ObjectIds,
the calculation of all bitmaps associated with all the refs
would result in an unreasonable big file that would take up to
several hours to compute.

Test scenario: repo with 2500 heads / 10M obj Intel Xeon E5-2680 2.5GHz
Before this change: 20 mins
After this change and 2300 heads excluded: 10 mins (90s for bitmap)

Having such a large bitmap file is also slow in the runtime
processing and have negligible or even negative benefits, because
the time lost in reading and decompressing the bitmap in memory
would not be compensated by the time saved by using it.

It is key to preserve the bitmaps for those refs that are mostly
used in clone/fetch and give the ability to exlude some refs
prefixes that are known to be less frequently accessed, even
though they may actually be actively written.

Example: Gerrit sandbox branches may even be actively
used and selected automatically because its commits are very
recent, however, they may bloat the bitmap, making it ineffective.

A mono-repo with tens of thousands of developers may have
a relatively small number of active branches where the
CI/CD jobs are continuously fetching/cloning the code. However,
because Gerrit allows the use of sandbox branches, the
total number of refs/heads may be even tens to hundred
thousands.

Change-Id: I466dcde69fa008e7f7785735c977f6e150e3b644
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
20 months agoPackWriterBitmapPreparer: do not include annotated tags in bitmap 51/197851/16
Luca Milanesio [Wed, 28 Dec 2022 01:09:52 +0000 (01:09 +0000)]
PackWriterBitmapPreparer: do not include annotated tags in bitmap

The annotated tags should be excluded from the bitmap associated
with the heads-only packfile. However, this was not happening
because of the check of exclusion of the peeled object instead
of the objectId to be excluded from the bitmap.

Sample use-case:

refs/heads/main
  ^
  |
 commit1 <-- commit2 <- annotated-tag1 <- tag1
  ^
  |
 commit0

When creating a bitmap for the above commit graph, before this
change all the commits are included (3 bitmaps), which is
incorrect, because all commits reachable from annotated tags
should not be included.

The heads-only bitmap should include only commit0 and commit1
but because PackWriterBitPreparer was checking for the peeled
pointer of tag1 to be excluded (commit2) which was not found in
the list of tags to exclude (annotated-tag1), the commit2 was
included, even if it wasn't reachable only from the head.

Add an additional check for exclusion of the original objectId
for allowing the exclusion of annotated tags and their pointed
commits. Add one specific test associated with an annotated tag
for making sure that this use-case is covered also.

Example repository benchmark for measuring the improvement:
# refs: 400k (2k heads, 88k tags, 310k changes)
# objects: 11M (88k of them are annotate tags)
# packfiles: 2.7G

Before this change:
GC time: 5h
clone --bare time: 7 mins

After this change:
GC time: 20 mins
clone --bare time: 3 mins

Bug: 581267
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Change-Id: Iff2bfc6587153001837220189a120ead9ac649dc

20 months agoBatchingProgressMonitor: avoid int overflow when computing percentage 35/199435/4
Matthias Sohn [Mon, 16 Jan 2023 20:58:56 +0000 (21:58 +0100)]
BatchingProgressMonitor: avoid int overflow when computing percentage

When cloning huge repositories I observed percentage of object counts
turning negative. This happened if lastWork * 100 exceeded
Integer.MAX_VALUE.

Change-Id: Ic5f5cf5a911a91338267aace4daba4b873ab3900

20 months agoSpeedup GC listing objects referenced from reflogs 68/199468/3
Matthias Sohn [Wed, 18 Jan 2023 16:39:19 +0000 (17:39 +0100)]
Speedup GC listing objects referenced from reflogs

GC needs to get a ReflogReader for all existing refs to list all objects
referenced from reflogs. The existing Repository#getReflogReader method
accepts the ref name and then resolves the Ref to create a ReflogReader.
GC calling that for a huge number of Refs one by one is very slow. GC
first gets all Refs in bulk and then calls getReflogReader for each of
them.

Fix this by adding another getReflogReader method to Repository which
accepts a Ref directly.

This speeds up running JGit gc on a mirror clone of the Gerrit
repository from 15:36 min to 1:08 min. The repository used in this test
had 45k refs, 275k commits and 1.2m git objects.

Change-Id: I474897fdc6652923e35d461c065a29f54d9949f4

21 months agoMerge branch 'stable-6.3' into stable-6.4 04/199404/1
Matthias Sohn [Fri, 13 Jan 2023 18:32:56 +0000 (19:32 +0100)]
Merge branch 'stable-6.3' into stable-6.4

* stable-6.3:
  Cache trustFolderStat/trustPackedRefsStat value per-instance
  Refresh 'objects' dir and retry if a loose object is not found

Change-Id: I1db2b51ae8101f345d08235d4f3dc416bfcb42d5

21 months agoMerge branch 'stable-6.2' into stable-6.3 03/199403/1
Matthias Sohn [Fri, 13 Jan 2023 18:32:06 +0000 (19:32 +0100)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  Cache trustFolderStat/trustPackedRefsStat value per-instance
  Refresh 'objects' dir and retry if a loose object is not found

Change-Id: Ibc9bffab8c9ef9c39384b53c142d99878f7f3f98

21 months agoMerge branch 'stable-6.1' into stable-6.2 02/199402/1
Matthias Sohn [Fri, 13 Jan 2023 18:31:18 +0000 (19:31 +0100)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  Cache trustFolderStat/trustPackedRefsStat value per-instance
  Refresh 'objects' dir and retry if a loose object is not found

Change-Id: I9e876f72f735f58bf02c7862a3d8e657fc46a7b9

21 months agoCache trustFolderStat/trustPackedRefsStat value per-instance 25/199325/3
Nasser Grainawi [Tue, 10 Jan 2023 23:15:42 +0000 (16:15 -0700)]
Cache trustFolderStat/trustPackedRefsStat value per-instance

Instead of re-reading the config every time the methods using these
values were called, cache the config value at the time of instance
construction. Caching the values improves performance for each of the
method calls. These configs are set based on the filesystem storing the
repository and unlikely to change while an application is running.

Change-Id: I1cae26dad672dd28b766ac532a871671475652df
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
21 months agoRefresh 'objects' dir and retry if a loose object is not found 14/197714/6
Kaushik Lingarkar [Thu, 12 Jan 2023 05:25:30 +0000 (21:25 -0800)]
Refresh 'objects' dir and retry if a loose object is not found

A new loose object may not be immediately visible on a NFS
client if it was created on another client. Refreshing the
'objects' dir and trying again can help work around the NFS
behavior.

Here's an E2E problem that this change can help fix. Consider
a Gerrit multi-primary setup with repositories based on NFS.
Add a new patch-set to an existing change and then immediately
fetch the new patch-set of that change. If the fetch is handled
by a Gerrit primary different that the one which created the
patch-set, then we sometimes run into a MissingObjectException
that causes the fetch to fail.

Bug: 581317
Change-Id: Iccc6676c68ef13a1e8b2ff52b3eeca790a89a13d
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
21 months agoFileSnapshotTest: Add more MISSING_FILE coverage 72/199272/1
Nasser Grainawi [Fri, 6 Jan 2023 21:14:48 +0000 (14:14 -0700)]
FileSnapshotTest: Add more MISSING_FILE coverage

Add a couple tests that confirm what the docs say about isModified() and
equals(MISSING_FILE) behavior.

Change-Id: I6093040ba3594934c3270331405a44b2634b97c5
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
21 months agoMerge branch 'stable-6.3' into stable-6.4 51/199251/1
Matthias Sohn [Thu, 5 Jan 2023 15:06:17 +0000 (16:06 +0100)]
Merge branch 'stable-6.3' into stable-6.4

* stable-6.3:
  Introduce core.trustPackedRefsStat config
  Fix documentation for core.trustFolderStat

Change-Id: I18d9fc89c9ac1ef069dcefa7d7f992a28539ccf3

21 months agoMerge branch 'stable-6.2' into stable-6.3 50/199250/1
Matthias Sohn [Thu, 5 Jan 2023 14:56:42 +0000 (15:56 +0100)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  Introduce core.trustPackedRefsStat config
  Fix documentation for core.trustFolderStat

Change-Id: I48b6c095ac62dc859829d6fef45325accbb0a144

21 months agoMerge branch 'stable-6.1' into stable-6.2 49/199249/1
Matthias Sohn [Thu, 5 Jan 2023 14:53:34 +0000 (15:53 +0100)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  Introduce core.trustPackedRefsStat config
  Fix documentation for core.trustFolderStat

Change-Id: Ic78630f74c72624932a384eed52ef79ae1eff3e5

21 months agoIntroduce core.trustPackedRefsStat config 26/197526/7
Kaushik Lingarkar [Fri, 2 Dec 2022 21:21:02 +0000 (13:21 -0800)]
Introduce core.trustPackedRefsStat config

Currently, we always read packed-refs file when 'trustFolderStat'
is false. Introduce a new config 'trustPackedRefsStat' which takes
precedence over 'trustFolderStat' when reading packed refs. Possible
values for this new config are:

* always: Trust packed-refs file attributes
* after_open: Same as 'always', but refresh the file attributes of
              packed-refs before trusting it
* never: Always read the packed-refs file
* unset: Fallback to 'trustFolderStat' to determine if the file
  attributes of packed-refs can be trusted

Folks whose repositories are on NFS and have traditionally been
setting 'trustFolderStat=false' can now get some performance improvement
with 'trustPackedRefsStat=after_open' as it refreshes the file
attributes of packed-refs (at least on some NFS clients) before
considering it.

For example, consider a repository on NFS with ~500k packed-refs. Here
are some stats which illustrate the improvement with this new config
when reading packed refs on NFS:

trustFolderStat=true trustPackedRefsStat=unset: 0.2ms
trustFolderStat=false trustPackedRefsStat=unset: 155ms
trustFolderStat=false trustPackedRefsStat=after_open: 1.5ms

Change-Id: I00da88e4cceebbcf3475be0fc0011ff65767c111
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
22 months agoFix documentation for core.trustFolderStat 92/197492/5
Kaushik Lingarkar [Mon, 5 Dec 2022 22:58:00 +0000 (14:58 -0800)]
Fix documentation for core.trustFolderStat

Update documentation for core.trustFolderStat to highlight that it is
also used when reading the packed-refs file.

Change-Id: I3eac377c3a7f48493abc8ae6d0889ee70a05d24d
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
22 months agoPrepare 6.4.1-SNAPSHOT builds 03/197403/1
Matthias Sohn [Wed, 30 Nov 2022 14:41:41 +0000 (15:41 +0100)]
Prepare 6.4.1-SNAPSHOT builds

Change-Id: I860bfde113c05015c41304c4a77c44c224bd0923

22 months agoJGit v6.4.0.202211300538-r 93/197393/1 v6.4.0.202211300538-r
Matthias Sohn [Wed, 30 Nov 2022 10:38:12 +0000 (11:38 +0100)]
JGit v6.4.0.202211300538-r

Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: If4001b255a209849b4acabd2083164d0794f00c4

22 months agoFix crashes on rare combination of file names 60/197360/1
Dmitrii Filippov [Mon, 27 Jun 2022 18:03:53 +0000 (20:03 +0200)]
Fix crashes on rare combination of file names

The NameConflictTreeWalk class is used in merge for iterating over
entries in commits. The class uses a separate iterator for each
commit's tree. In rare cases it can incorrectly report the same entry
twice. As a result, duplicated entries are added to the merge result
and later jgit throws an exception when it tries to process merge
result.

The problem appears only when there is a directory-file conflict for
the last item in trees. Example from the bug:
Commit 1:
* subtree - file
* subtree-0 - file
Commit 2:
* subtree - directory
* subtree-0 - file
Here the names are ordered like this:
"subtree" file <"subtree-0" file < "subtree" directory.

The NameConflictTreeWalk handles similar cases correctly if there are
other files after subtree... in commits - this is processed in the
AbstractTreeIterator.min function. Existing code has a special
optimization for the case, when all trees are pointed to the same
entry name - it skips additional checks. However, this optimization
incorrectly skips checks if one of trees reached the end.

The fix processes a situation when some trees reached the end, while
others are still point to an entry.

bug: 535919
Change-Id: I62fde3dd89779fac282479c093400448b4ac5c86

22 months agoPrepare 6.4.0-SNAPSHOT build 55/197255/1
Matthias Sohn [Wed, 23 Nov 2022 16:10:33 +0000 (17:10 +0100)]
Prepare 6.4.0-SNAPSHOT build

Change-Id: I41c4f73472bb47d8f9d2d117d17e11bba4802928

22 months agoJGit v6.4.0.202211231055-rc1 53/197253/1 v6.4.0.202211231055-rc1
Matthias Sohn [Wed, 23 Nov 2022 15:56:09 +0000 (16:56 +0100)]
JGit v6.4.0.202211231055-rc1

Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: Ia34696d07568b298544ee2cdc6f4b6746774bb82

22 months agoMerge branch 'master' into stable-6.4 52/197252/1
Matthias Sohn [Wed, 23 Nov 2022 15:54:34 +0000 (16:54 +0100)]
Merge branch 'master' into stable-6.4

* master:
  [pgm] Add options --name-only, --name-status to diff, log, show
  Update Orbit to R20221123021534 for 2022-12
  RBE: Update toolchain with bazel-toolchains 5.1.2 release
  SshTestGitServer: : ensure UploadPack is closed to fix resource leak
  UploadPackTest: ensure UploadPack is closed to fix resource leak
  [pgm] Ensure UploadPack is closed to fix resource leak
  UploadPackServlet#doPost use try-with-resource to ensure up is closed
  Fix warnings in PatchApplierTest
  Fix boxing warnings in TransportTest
  Silence warnings about unclosed BasePackPushConnection
  Fix warning about non-externalized String
  Remove unused imports
  Suppress non-externalized String warnings
  Remove unused API problem filters
  Silence API errors
  Silence API errors
  Silence API warnings
  Add 4.26 target platform
  Use "releases" repository for 4.25 target platform
  Update Apache Mina SSHD to 2.9.2
  Update Orbit to S20221118032057
  DfsBlockCache: Report IndexEventConsumer metrics for reverse indexes.
  DfsStreamKey: Replace ForReverseIndex to separate metrics.
  RawText.isBinary(): handle complete buffer correctly
  PackExt: Add a reverse index extension.

Change-Id: Ia41a2b0662bdb174e05a1adba6502191ef5ce4c5

22 months ago[pgm] Add options --name-only, --name-status to diff, log, show 16/197116/6
alerthak [Sat, 19 Nov 2022 02:56:02 +0000 (05:56 +0300)]
[pgm] Add options --name-only, --name-status to diff, log, show

Change-Id: Ib218bd2ccbd7990feca4c35d8c8dc34d4a8291e6

22 months agoUpdate Orbit to R20221123021534 for 2022-12 37/197237/1
Matthias Sohn [Wed, 23 Nov 2022 09:32:51 +0000 (10:32 +0100)]
Update Orbit to R20221123021534 for 2022-12

Change-Id: I9de11cc198ce3926d5233c4e30dc74f36674d3b5

22 months agoRBE: Update toolchain with bazel-toolchains 5.1.2 release 77/196877/2
David Ostrovsky [Fri, 11 Nov 2022 10:18:38 +0000 (11:18 +0100)]
RBE: Update toolchain with bazel-toolchains 5.1.2 release

Due to this platform style migration: [1] the RBE toolchain needs to be
updated to use the latest rbe_config_gen from bazel-toolchains (at least
version 5.1.2 so that it contains: [2]).

This change makes RBE build forwards compatible so that Bazel could be
updated to the upcoming major 6.0 release.

[1] https://github.com/bazelbuild/bazel/issues/8622
[2] https://github.com/bazelbuild/bazel-toolchains/commit/8c717f8258cd5f6c7a45b97d974292755852b658

Change-Id: Ia3a108fa05b1d52cd2018ba901ffd4c9e55ae8ab

22 months agoSshTestGitServer: : ensure UploadPack is closed to fix resource leak 54/197154/2
Matthias Sohn [Sun, 20 Nov 2022 20:33:17 +0000 (21:33 +0100)]
SshTestGitServer: : ensure UploadPack is closed to fix resource leak

Change-Id: Ib766f1d56b3ca7940c593ebfe0ac68fc5028a11c

22 months agoUploadPackTest: ensure UploadPack is closed to fix resource leak 53/197153/2
Matthias Sohn [Sun, 20 Nov 2022 20:24:00 +0000 (21:24 +0100)]
UploadPackTest: ensure UploadPack is closed to fix resource leak

Change-Id: I4c8cf6041b4011934d338138d4531d190fdd6abb

22 months ago[pgm] Ensure UploadPack is closed to fix resource leak 52/197152/2
Matthias Sohn [Sun, 20 Nov 2022 20:21:26 +0000 (21:21 +0100)]
[pgm] Ensure UploadPack is closed to fix resource leak

Change-Id: I40da4b331012dd1c6f4b497e46c973fd776b737f

22 months agoUploadPackServlet#doPost use try-with-resource to ensure up is closed 51/197151/2
Matthias Sohn [Sun, 20 Nov 2022 20:13:50 +0000 (21:13 +0100)]
UploadPackServlet#doPost use try-with-resource to ensure up is closed

Change-Id: Iadbf81f183bb94f3b00b9940f065586b13e85c95

22 months agoFix warnings in PatchApplierTest 50/197150/1
Matthias Sohn [Sun, 20 Nov 2022 19:41:20 +0000 (20:41 +0100)]
Fix warnings in PatchApplierTest

- don't use final for method parameters
- fix hiding member warnigns

Change-Id: I73c386f669918d3291ee3380024c018483aa3c97

22 months agoFix boxing warnings in TransportTest 49/197149/1
Matthias Sohn [Sun, 20 Nov 2022 19:34:57 +0000 (20:34 +0100)]
Fix boxing warnings in TransportTest

Change-Id: I7e6dc845b89899cff262fab77c3977dbef5eea02

22 months agoSilence warnings about unclosed BasePackPushConnection 48/197148/1
Matthias Sohn [Sun, 20 Nov 2022 19:32:37 +0000 (20:32 +0100)]
Silence warnings about unclosed BasePackPushConnection

Change-Id: If52e8462e6222dd58d1004dd5ac174a27d96d098

22 months agoFix warning about non-externalized String 47/197147/1
Matthias Sohn [Sun, 20 Nov 2022 19:30:45 +0000 (20:30 +0100)]
Fix warning about non-externalized String

Change-Id: I00b2132eac6d6ad2701d3f8151eb8c80ad6d679d

22 months agoMerge branch 'stable-6.3' 46/197146/1
Matthias Sohn [Sun, 20 Nov 2022 19:24:14 +0000 (20:24 +0100)]
Merge branch 'stable-6.3'

* stable-6.3:
  Remove unused imports
  Suppress non-externalized String warnings
  Remove unused API problem filters
  Silence API errors
  Silence API errors
  Silence API warnings

Change-Id: I6778c8266bc7e918c943dcabf23aa230f4e998d5

22 months agoMerge branch 'stable-6.2' into stable-6.3 43/197143/1
Matthias Sohn [Sun, 20 Nov 2022 19:22:24 +0000 (20:22 +0100)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  Remove unused imports
  Suppress non-externalized String warnings
  Remove unused API problem filters
  Silence API errors
  Silence API errors
  Silence API warnings

Change-Id: I71aa9f890c5eb05849ad16a00b9974da5e51171e

22 months agoRemove unused imports 42/197142/1
Matthias Sohn [Sun, 20 Nov 2022 19:18:01 +0000 (20:18 +0100)]
Remove unused imports

Change-Id: I57a3ae0a8608a517d9cc5cc27cee136f9faeb810

22 months agoSuppress non-externalized String warnings 41/197141/1
Matthias Sohn [Sun, 20 Nov 2022 19:16:28 +0000 (20:16 +0100)]
Suppress non-externalized String warnings

Change-Id: I95c61bd906bd3f7cdea9581e0ffa92ec607c6140

22 months agoRemove unused API problem filters 40/197140/1
Matthias Sohn [Sun, 20 Nov 2022 19:14:20 +0000 (20:14 +0100)]
Remove unused API problem filters

Change-Id: I890716bc052dcce2ce136040035b442247c08332

22 months agoMerge branch 'stable-6.1' into stable-6.2 39/197139/1
Matthias Sohn [Sun, 20 Nov 2022 19:10:37 +0000 (20:10 +0100)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  Silence API errors
  Silence API errors
  Silence API warnings

Change-Id: Id3efa1b32710661cde63e93c5b8832785a805415

22 months agoSilence API errors 38/197138/1
Matthias Sohn [Sun, 20 Nov 2022 19:09:02 +0000 (20:09 +0100)]
Silence API errors

Change-Id: I07c42fe9417edb0570dd475a7e935112a878a93b

22 months agoMerge branch 'stable-6.0' into stable-6.1 37/197137/1
Matthias Sohn [Sun, 20 Nov 2022 19:08:42 +0000 (20:08 +0100)]
Merge branch 'stable-6.0' into stable-6.1

* stable-6.0:
  Silence API errors
  Silence API warnings

Change-Id: I2b8336652e60dec97666582cf9331c8505729473

22 months agoSilence API errors 36/197136/1
Matthias Sohn [Sun, 20 Nov 2022 18:55:22 +0000 (19:55 +0100)]
Silence API errors

Change-Id: Ie112b2099ea2125bc85863524e56f09ba4907373

22 months agoMerge branch 'stable-5.13' into stable-6.0 35/197135/1
Matthias Sohn [Sun, 20 Nov 2022 18:54:44 +0000 (19:54 +0100)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  Silence API warnings

Change-Id: If5ab988a0e177c37b125e0b10625e506eeb2a74f

22 months agoSilence API warnings 34/197134/1
Matthias Sohn [Sun, 20 Nov 2022 18:45:54 +0000 (19:45 +0100)]
Silence API warnings

introduced by
- addition of configurable SHA1 implementation in 5.13.2
- 3-digit @since 5.9.1 annotations on GitServlet methods

Change-Id: If19853fcc5e3677e5b18e8e3fbbcd2773378dffc

22 months agoAdd 4.26 target platform 45/197145/1
Matthias Sohn [Sun, 20 Nov 2022 17:15:21 +0000 (18:15 +0100)]
Add 4.26 target platform

Change-Id: I569d0b432b5da175da091e37feecadc321d686a9

22 months agoUse "releases" repository for 4.25 target platform 44/197144/1
Matthias Sohn [Sun, 20 Nov 2022 17:15:09 +0000 (18:15 +0100)]
Use "releases" repository for 4.25 target platform

Change-Id: Ib8d33714c67de949b9574b4ec29c1ae99f75d419

22 months agoUpdate Apache Mina SSHD to 2.9.2 85/192885/4
Thomas Wolf [Mon, 25 Apr 2022 05:52:25 +0000 (07:52 +0200)]
Update Apache Mina SSHD to 2.9.2

Release notes for 2.9.2:
https://github.com/apache/mina-sshd/blob/master/docs/changes/2.9.2.md

Change-Id: I7809bcba1d45b76ab9dcc031f86beb2f69da3788
Signed-off-by: Thomas Wolf <twolf@apache.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
22 months agoMerge branch 'stable-6.4' 15/197115/1
Matthias Sohn [Fri, 18 Nov 2022 21:25:56 +0000 (22:25 +0100)]
Merge branch 'stable-6.4'

* stable-6.4:
  Prepare 6.4.0-SNAPSHOT builds
  JGit v6.4.0.202211160543-m3

Change-Id: I6a98ffb40d93422dc128328b8427ea740731b960

22 months agoUpdate Orbit to S20221118032057 14/197114/1
Matthias Sohn [Fri, 18 Nov 2022 21:09:04 +0000 (22:09 +0100)]
Update Orbit to S20221118032057

update
- com.jcraft.jsch to 0.1.55.v20221112-0806
- net.bytebuddy.byte-buddy to 1.12.18.v20221114-2102
- net.bytebuddy.byte-buddy-agent to 1.12.18.v20221114-2102
- org.apache.commons.codec to 1.14.0.v20221112-0806
- org.apache.httpcomponents.httpclient to 4.5.13.v20221112-0806
- org.slf4j.api to 1.7.30.v20221112-0806
- org.slf4j.binding.simple to 1.7.30.v20221112-0806

Change-Id: I4f29994c8a4374f6ace5c640397245c3c2ff4f53

22 months agoDfsBlockCache: Report IndexEventConsumer metrics for reverse indexes. 90/196890/3
Anna Papitto [Thu, 10 Nov 2022 22:49:27 +0000 (14:49 -0800)]
DfsBlockCache: Report IndexEventConsumer metrics for reverse indexes.

IndexEventConsumer metrics are reported per index PackExt and reverse
indexes did not have one, so they were not included.

Now that there is a REVERSE_INDEX PackExt, enable reporting
IndexEventConsumer metrics for reverse indexes.

Change-Id: Ia6a752f6eb8932a5b4ba45cc15cbc7e0786fd247
Signed-off-by: Anna Papitto <annapapitto@google.com>
22 months agoDfsStreamKey: Replace ForReverseIndex to separate metrics. 89/196889/3
Anna Papitto [Fri, 11 Nov 2022 18:44:37 +0000 (10:44 -0800)]
DfsStreamKey: Replace ForReverseIndex to separate metrics.

Keys used for identifying reverse indexes in the DfsBlockCache use a
custom subclass ForReverseIndex because there was no PackExt for them.
This conflates BlockCacheMetrics for reverse indexes with those for
packs, since the key falls back onto 0 when there is no extension.

Replace the custom ForReverseIndex with a DfsStreamKey usage to bring
keys for the new REVERSE_INDEX extension in line with INDEX and BITMAP
and separate reverse index and pack BlockCacheMetrics.

Change-Id: I305e2c16d2a8cb2a824855ea92e0c9a9b188fce5
Signed-off-by: Anna Papitto <annapapitto@google.com>
22 months agoMerge "PackExt: Add a reverse index extension."
Ivan Frade [Thu, 17 Nov 2022 17:38:10 +0000 (12:38 -0500)]
Merge "PackExt: Add a reverse index extension."

23 months agoPrepare 6.4.0-SNAPSHOT builds 66/197066/1
Matthias Sohn [Wed, 16 Nov 2022 23:06:09 +0000 (00:06 +0100)]
Prepare 6.4.0-SNAPSHOT builds

Change-Id: I0e915a1d32ff948e355f17181f4e5ed78ead42db

23 months agoRawText.isBinary(): handle complete buffer correctly 57/196557/2
Thomas Wolf [Mon, 31 Oct 2022 21:44:50 +0000 (22:44 +0100)]
RawText.isBinary(): handle complete buffer correctly

Make sure we always get consistent results, whether or not we have the
full data in the buffer.

Change-Id: Ieb379a0c375ad3dd352e63ac2f23bda6ef16c215
Signed-off-by: Thomas Wolf <twolf@apache.org>
23 months agoJGit v6.4.0.202211160543-m3 12/197012/1 v6.4.0.202211160543-m3
Matthias Sohn [Wed, 16 Nov 2022 10:43:19 +0000 (11:43 +0100)]
JGit v6.4.0.202211160543-m3

Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I8c2a0ede168224e6572bb2b41cd106c3492ac4fc

23 months agoMerge branch 'master' into stable-6.4 11/197011/1
Matthias Sohn [Wed, 16 Nov 2022 10:29:24 +0000 (11:29 +0100)]
Merge branch 'master' into stable-6.4

* master:
  [benchmarks] Remove profiler configuration
  Add SHA1 benchmark
  [benchmarks] Set version of maven-compiler-plugin to 3.8.1
  Fix running JMH benchmarks
  Add option to allow using JDK's SHA1 implementation
  Fix API breakage caused by extracting WorkTreeUpdater
  Update Orbit to S20221109014815
  Use replace instead of replaceAll in toCleanString
  Extract Exception -> HTTP status code mapping for reuse
  Don't handle internal git errors as an HTTP error
  Fix the path for JSchText.properties
  Fix Maven SHA1 for Bazel build
  UploadPack: Receive and parse client session-id
  TransferConfig: Move reading advertisesid setting into TransferConfig
  FirstWant: Parse client session-id if received.
  ReceivePack: Receive and parse client session-id.
  Ignore IllegalStateException if JVM is already shutting down
  Allow to perform PackedBatchRefUpdate without locking loose refs

Change-Id: Ib38376bb8fa4a64af93bf1ffb5883711eaa432d7

23 months agoMerge branch 'stable-6.3' 10/197010/1
Matthias Sohn [Wed, 16 Nov 2022 09:15:30 +0000 (10:15 +0100)]
Merge branch 'stable-6.3'

* stable-6.3:
  [benchmarks] Remove profiler configuration
  Add SHA1 benchmark
  [benchmarks] Set version of maven-compiler-plugin to 3.8.1
  Fix running JMH benchmarks
  Add option to allow using JDK's SHA1 implementation
  Fix API breakage caused by extracting WorkTreeUpdater
  Extract Exception -> HTTP status code mapping for reuse
  Don't handle internal git errors as an HTTP error
  Ignore IllegalStateException if JVM is already shutting down
  Allow to perform PackedBatchRefUpdate without locking loose refs

Change-Id: Ib58879be292c54a2a7f4936ac0986997985c822b