]> source.dussan.org Git - jgit.git/log
jgit.git
7 hours agoMerge branch 'stable-7.1' 85/1204685/1
Matthias Sohn [Tue, 26 Nov 2024 23:34:46 +0000 (00:34 +0100)]
Merge branch 'stable-7.1'

* stable-7.1:
  Prepare 7.1.1-SNAPSHOT builds
  JGit v7.1.0.202411261347-r
  Prepare 7.1.0-SNAPSHOT builds
  JGit v7.1.0.202411191359-rc1

Change-Id: Iccfe871e7346f818a17bfc0b3fa4e312d8f1ee04

15 hours agoPrepare 7.1.1-SNAPSHOT builds 83/1204683/1 stable-7.1
Matthias Sohn [Tue, 26 Nov 2024 15:13:38 +0000 (16:13 +0100)]
Prepare 7.1.1-SNAPSHOT builds

Change-Id: Ifc710a83cda50f1275cbbd5a828f92d95607f298

16 hours agoJGit v7.1.0.202411261347-r 82/1204682/1 v7.1.0.202411261347-r
Matthias Sohn [Tue, 26 Nov 2024 13:47:29 +0000 (14:47 +0100)]
JGit v7.1.0.202411261347-r

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

16 hours agoMerge branch 'master' into stable-7.1 81/1204681/1
Matthias Sohn [Tue, 26 Nov 2024 13:46:00 +0000 (14:46 +0100)]
Merge branch 'master' into stable-7.1

* master:
  PackDirectory: Filter out tmp GC pack files
  Add pack-refs command to the CLI
  Test advertised capabilities with protocol V0 and allow*Sha1InWant
  Align request policies with CGit
  GitTimeParser: Fix multiple errorprone and style comments
  PersonIdent: Preserve the timezone when copying with new time
  PersonIdent: Revert @since of #getZoneId
  tests/BasicTest: Use java.time constructors for PersonIdent
  RawParseUtils test: Use java.time to create PersonIdents
  Change default similarity score to 50(%) to match git's default
  Pack.java: Recover more often in Pack.copyAsIs2()

Change-Id: I1386addb355ffba09dcbf1a6e8634d605c0d3b5c

17 hours agoMerge branch 'stable-7.0' 80/1204680/1
Matthias Sohn [Tue, 26 Nov 2024 13:37:00 +0000 (14:37 +0100)]
Merge branch 'stable-7.0'

* stable-7.0:
  PackDirectory: Filter out tmp GC pack files
  Test advertised capabilities with protocol V0 and allow*Sha1InWant
  Align request policies with CGit
  Pack.java: Recover more often in Pack.copyAsIs2()

Change-Id: Iddb994a747bc860dd9286e74190ecdd285ce6832

17 hours agoMerge branch 'stable-6.10' into stable-7.0 79/1204679/1 stable-7.0
Matthias Sohn [Tue, 26 Nov 2024 13:17:25 +0000 (14:17 +0100)]
Merge branch 'stable-6.10' into stable-7.0

* stable-6.10:
  PackDirectory: Filter out tmp GC pack files
  Test advertised capabilities with protocol V0 and allow*Sha1InWant
  Align request policies with CGit
  Pack.java: Recover more often in Pack.copyAsIs2()

Change-Id: Ib301efa54aaf2196d764a0fc1f91f652b4d68396

17 hours agoMerge "Pack.java: Recover more often in Pack.copyAsIs2()" into stable-6.10 stable-6.10
Matthias Sohn [Tue, 26 Nov 2024 13:16:28 +0000 (13:16 +0000)]
Merge "Pack.java: Recover more often in Pack.copyAsIs2()" into stable-6.10

4 days agoPackDirectory: Filter out tmp GC pack files 87/1204287/2
Martin Fick [Sat, 23 Nov 2024 01:08:57 +0000 (17:08 -0800)]
PackDirectory: Filter out tmp GC pack files

git repack passes a ".tmp-XXXX-" prefix to git pack-objects when
repacking. git pack-objects then adds a "pack-XXXXX.pack" to this to
create the name of new packfiles it writes to. PackDirectory was
previously very lenient and would allow these files to be added to its
list of known packfiles. Fix PackDirectory to filter these out since
they are not meant to be consumed yet, and doing so can cause user
facing errors.

Change-Id: I072e57d9522e02049db17d3f4977df7eda14bba7
Signed-off-by: Martin Fick <mfick@nvidia.com>
5 days agoAdd pack-refs command to the CLI 44/1202844/12
Yash Chaturvedi [Thu, 14 Nov 2024 14:33:08 +0000 (20:03 +0530)]
Add pack-refs command to the CLI

This command can be used to optimize storage of references.

For a RefDirectory database, it packs non-symbolic, loose refs into
packed-refs. By default, only the references under '$GIT_DIR/refs/tags'
are packed. The '--all' option can be used to pack all the references
under '$GIT_DIR/refs'.

For Reftable, all refs are compacted into a single table.

Change-Id: I92e786403f8638d35ae3037844a7ad89e8959e02

5 days agoTest advertised capabilities with protocol V0 and allow*Sha1InWant 72/1204172/3
pszlazak [Sun, 17 Nov 2024 22:24:09 +0000 (23:24 +0100)]
Test advertised capabilities with protocol V0 and allow*Sha1InWant

The advertised capabilities with protocol V0 were untested
leading to potential regressions when advertising what
SHA1 should or should not be on the list of capabilities.

Verify that allow-tip-sha1-in-want and allow-reachable-sha1-in-want
are properly advertised with the allow*Sha1InWant is set in
jgit.config.

Change-Id: Id48af2bc19280f2dcb26aa8e8765cde8f2ce7a06
(cherry picked from commit 5583f6a10eafc8c2627e0fb4833cb8ffe422f69a)

5 days agoAlign request policies with CGit 71/1204171/2
pszlazak [Sun, 17 Nov 2024 22:11:02 +0000 (23:11 +0100)]
Align request policies with CGit

CGit defines the SHA request policies using a bitmask
that represents which policy is implied by another policy.

For example, in CGit the ALLOW_TIP_SHA1 is 0x01 and ALLOW_REACHABLE_SHA1
is 0x02, which are associated to two different bit in a 3-bit value.
The ALLOW_ANY_SHA1 value is 0x07 which denotes a different policy that
implies the previous two ones, because is represented with a 3-bit
bitmask having all ones.

Associate the JGit RequestPolicy enum to the same CGit bitmask values
and use the same logic for the purpose of advertising the server
capabilities.

The JGit code becomes easier to read and associate with its counterpart
in CGit, especially during the capabilities advertising phase.

Also add a new utility method RequestPolicy.implies() which is more
readable than a direct bitmask and operator.

Bug: jgit-68
Change-Id: I932150dca1211ba9c8c34a523f13e84d7390063b
(cherry picked from commit 1519c147948eb1108bdf45f2aeed84746dacff9c)

5 days agoMerge "GitTimeParser: Fix multiple errorprone and style comments"
Matthias Sohn [Thu, 21 Nov 2024 09:05:26 +0000 (09:05 +0000)]
Merge "GitTimeParser: Fix multiple errorprone and style comments"

5 days agoMerge branch 'stable-7.0' into stable-7.1 86/1204286/1
Matthias Sohn [Thu, 21 Nov 2024 08:30:30 +0000 (09:30 +0100)]
Merge branch 'stable-7.0' into stable-7.1

* stable-7.0:
  DiffDriver: fix doc for rust built-in
  DiffDriver: fix formatting of javadoc
  Add numberOfObjectsSinceBitmap to RepoStatistics
  Support built-in diff drivers for hunk header function names
  Don't fail when trying to prune pack which is already gone
  Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap

Change-Id: I3789de20ff5e1f52525c7d1b9ee22bc3b09f7f74

6 days agoMerge branch 'stable-7.0' 85/1204285/1
Matthias Sohn [Wed, 20 Nov 2024 23:31:00 +0000 (00:31 +0100)]
Merge branch 'stable-7.0'

* stable-7.0:
  DiffDriver: fix doc for rust built-in
  DiffDriver: fix formatting of javadoc
  Add numberOfObjectsSinceBitmap to RepoStatistics
  Support built-in diff drivers for hunk header function names
  Don't fail when trying to prune pack which is already gone
  Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap

Change-Id: I98beec1186132e749a749706f399237de7d7e45e

6 days agoMerge branch 'stable-6.10' into stable-7.0 84/1204284/2
Matthias Sohn [Wed, 20 Nov 2024 23:24:53 +0000 (00:24 +0100)]
Merge branch 'stable-6.10' into stable-7.0

* stable-6.10:
  DiffDriver: fix doc for rust built-in
  DiffDriver: fix formatting of javadoc
  Add numberOfObjectsSinceBitmap to RepoStatistics
  Support built-in diff drivers for hunk header function names
  Don't fail when trying to prune pack which is already gone
  Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap

Change-Id: I7f18e96cc98c56ee7c5e6256fe9e83957e733aa8

6 days agoDiffDriver: fix doc for rust built-in 12/1204412/1
Kaushik Lingarkar [Wed, 20 Nov 2024 23:22:11 +0000 (15:22 -0800)]
DiffDriver: fix doc for rust built-in

Change-Id: Ic430686dc41ecbd8d8d19068416bc18ba2d94f3f

6 days agoDiffDriver: fix formatting of javadoc 83/1204283/1
Matthias Sohn [Wed, 20 Nov 2024 22:42:39 +0000 (23:42 +0100)]
DiffDriver: fix formatting of javadoc

Change-Id: I01da1862719b6623727deae10a706f30ee6cabbf

6 days agoGitTimeParser: Fix multiple errorprone and style comments 10/1204410/1
Ivan Frade [Wed, 20 Nov 2024 22:06:46 +0000 (14:06 -0800)]
GitTimeParser: Fix multiple errorprone and style comments

This code came from GitDateParser and inherited these issues. It is a
good time to fix them:

* Use always {} in if and fors (eclipse guide)

* Use the more efficient EnumMap for the formatters

* variable.equals(CONSTANT) instead of CONSTANT.equals(var)
  https://errorprone.info/bugpattern/YodaCondition

* private constructor to prevent instantiations of a utility classes
  https://errorprone.info/bugpattern/PrivateConstructorForUtilityClass

* methods named in camelCase

* Use string.split(..., int)
  https://errorprone.info/bugpattern/StringSplitter

* Initialize variable in first use

Change-Id: I0ae70ad9befc66fa9c057af135f2b0b2dab3869a

6 days agoPersonIdent: Preserve the timezone when copying with new time 08/1204408/1
Ivan Frade [Wed, 20 Nov 2024 21:09:24 +0000 (13:09 -0800)]
PersonIdent: Preserve the timezone when copying with new time

The PersonIdent(PersonIdent,Date) constructor must create a copy with
the same author/email/timezone but different time.  When we changed
the implementation to the new Instant/ZoneId version, we forgot to
pass the timezone. This made fail some tests downstream.

Pass the timezone when constructing the copy.

Change-Id: Iaa979e6dbaa3c55d4c4d2040068ab8b03163cd4e

6 days agoPersonIdent: Revert @since of #getZoneId 06/1204406/1
Ivan Frade [Wed, 20 Nov 2024 19:18:46 +0000 (11:18 -0800)]
PersonIdent: Revert @since of #getZoneId

In [1], the @since tag of #getZoneId was updated to 7.1 by
mistake. The implementation of the method is different but the API
hasn't changed.

Revert the tag to 6.1, when the method was introduced.

[1] https://gerrithub.io/c/eclipse-jgit/jgit/+/1204142/9/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java

Change-Id: If71d763ac28d4ec02bfebb1e65f56227f44e027d

6 days agoMerge changes I3844bf1e,I05c759bd
Matthias Sohn [Wed, 20 Nov 2024 13:22:34 +0000 (13:22 +0000)]
Merge changes I3844bf1e,I05c759bd

* changes:
  tests/BasicTest: Use java.time constructors for PersonIdent
  RawParseUtils test: Use java.time to create PersonIdents

6 days agoMerge "Add numberOfObjectsSinceBitmap to RepoStatistics" into stable-6.10
Matthias Sohn [Wed, 20 Nov 2024 12:36:42 +0000 (12:36 +0000)]
Merge "Add numberOfObjectsSinceBitmap to RepoStatistics" into stable-6.10

6 days agoAdd numberOfObjectsSinceBitmap to RepoStatistics 98/1203398/8
Jacek Centkowski [Thu, 31 Oct 2024 17:30:02 +0000 (18:30 +0100)]
Add numberOfObjectsSinceBitmap to RepoStatistics

Introduce a numberOfObjectsSinceBitmap that contains the number of
objects stored in pack files and as loose objects created since the
latest bitmap generation.

Note that the existing
GcNumberOfPackFilesAfterBitmapStatisticsTest.java was renamed to
GcSinceBitmapStatisticsTest.java and extended to cover also this
statistic.

Change-Id: I8ae1db142ddfcd42a5a1d6da01bc67f695562e0e

6 days agoMerge "Don't fail when trying to prune pack which is already gone" into stable-6.10
Luca Milanesio [Wed, 20 Nov 2024 10:27:20 +0000 (10:27 +0000)]
Merge "Don't fail when trying to prune pack which is already gone" into stable-6.10

6 days agoMerge "Support built-in diff drivers for hunk header function names" into stable...
Matthias Sohn [Wed, 20 Nov 2024 10:23:10 +0000 (10:23 +0000)]
Merge "Support built-in diff drivers for hunk header function names" into stable-6.10

6 days agoSupport built-in diff drivers for hunk header function names 34/1203734/10
Kaushik Lingarkar [Tue, 19 Nov 2024 17:37:33 +0000 (09:37 -0800)]
Support built-in diff drivers for hunk header function names

The regexes defined for each built-in driver will be used to determine
the function name for a hunk header. Each driver can specify a list of
regexes to negate and match. They can also define pattern compilation
flags if needed. These drivers only apply to text files with unified
patch type.

Following built-in drivers have been added:
- cpp
- dts
- java
- python
- rust

Support for more languages can be added as needed to match the cgit
implementation.

Change-Id: Ice5430bfed7e4aaf9f00e52e44402479984953c5

6 days agoMerge "Change default similarity score to 50(%) to match git's default"
Matthias Sohn [Wed, 20 Nov 2024 09:42:41 +0000 (09:42 +0000)]
Merge "Change default similarity score to 50(%) to match git's default"

6 days agoDon't fail when trying to prune pack which is already gone 25/1203925/3
Jacek Centkowski [Mon, 11 Nov 2024 11:48:20 +0000 (12:48 +0100)]
Don't fail when trying to prune pack which is already gone

Update the TestRepository.prunePacked so that it doesn't fail if a pack
to be pruned is already gone.
It is especially handy when the prunePacked function is called in
`TestRepository.packAndPrune` function after the repo moves on after
GC was performed.

Change-Id: I01b4ddbaddec1fdc24cfbb967e0edfe0de6c4b7c

7 days agotests/BasicTest: Use java.time constructors for PersonIdent 99/1204299/1
Ivan Frade [Fri, 15 Nov 2024 21:37:12 +0000 (13:37 -0800)]
tests/BasicTest: Use java.time constructors for PersonIdent

Stop using the deprecated constructor with long/int for time/tz and
use instead Instant/ZoneId.

The code is still using the old constructor, but this verifies that we
are creating identical instances. We will update the code later.

Change-Id: I3844bf1e790e53e69a894cd697bddb31b755c2e6

7 days agoRawParseUtils test: Use java.time to create PersonIdents 78/1204278/1
Ivan Frade [Fri, 15 Nov 2024 21:14:47 +0000 (13:14 -0800)]
RawParseUtils test: Use java.time to create PersonIdents

The constructor with long/int for time/tz is deprecated in favor of
Instant/ZoneId.

Update first the expectations in the tests to the new constructors, so
we know we are creating the same PersonIdents than before. We update
the code later, knowing there is no regression in e.g. format or
precision.

Change-Id: I05c759bdd4cf73b8afe79fae3c792f2f1300d1e6

7 days agoPrepare 7.1.0-SNAPSHOT builds 81/1204281/1
Matthias Sohn [Tue, 19 Nov 2024 14:46:50 +0000 (15:46 +0100)]
Prepare 7.1.0-SNAPSHOT builds

Change-Id: I69f57f933899b9926ab5124b24b90ae75f7a8d09

7 days agoJGit v7.1.0.202411191359-rc1 18/1203918/1 v7.1.0.202411191359-rc1
Matthias Sohn [Tue, 19 Nov 2024 13:59:25 +0000 (14:59 +0100)]
JGit v7.1.0.202411191359-rc1

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

7 days agoMerge branch 'master' into stable-7.1 17/1203917/1
Matthias Sohn [Tue, 19 Nov 2024 13:58:31 +0000 (14:58 +0100)]
Merge branch 'master' into stable-7.1

* master:
  RecursiveMerger: fix boxing warning
  UploadPackTest: fix unclosed resource warning
  Suppress non-externalized string warnings
  Remove unused API problem filters
  PersonIdent: Use java.time instead of older Date and milliseconds
  GitTimeParser: A date parser using the java.time API
  Configure JDT to not raise error on deprecated class linked in javadoc
  Update Jetty to 12.0.15
  PullCommandTest: assert git status in some simple tests
  SystemReader: add method to get LocalDateTime
  SystemReader#now: make it a concrete method
  [errorprone] RawText: Add parenthesis for explicit op precedence
  MockSystemReader: create the right time zone
  RawText: improve performance of isCrLfText and isBinary
  SystemReader: Give a default implementation to #getTimezoneAt()
  [errorprone] ssh: suppress warning for arrays in records
  Don't fail when trying to prune pack which is already gone

Change-Id: I9161ba5dfa7ce4d0ba8ef44833124ecd414cb39d

7 days agoMerge "PullCommandTest: assert git status in some simple tests"
Matthias Sohn [Tue, 19 Nov 2024 13:57:51 +0000 (13:57 +0000)]
Merge "PullCommandTest: assert git status in some simple tests"

7 days agoRecursiveMerger: fix boxing warning 16/1203916/1
Matthias Sohn [Tue, 19 Nov 2024 12:19:03 +0000 (13:19 +0100)]
RecursiveMerger: fix boxing warning

Change-Id: I6f6ae540b128ff6b965931e829da1368a8b88ddb

7 days agoUploadPackTest: fix unclosed resource warning 15/1203915/1
Matthias Sohn [Tue, 19 Nov 2024 12:17:08 +0000 (13:17 +0100)]
UploadPackTest: fix unclosed resource warning

Change-Id: I4efccd72bd567d42e739ee330e26c6b04d5c5c01

7 days agoSuppress non-externalized string warnings 14/1203914/1
Matthias Sohn [Tue, 19 Nov 2024 12:12:53 +0000 (13:12 +0100)]
Suppress non-externalized string warnings

Change-Id: Ib0737f7ec6b9872f6d4514d140e7d32a4a40809d

7 days agoRemove unused API problem filters 13/1203913/1
Matthias Sohn [Tue, 19 Nov 2024 12:05:25 +0000 (13:05 +0100)]
Remove unused API problem filters

Change-Id: I8f5d2f6f1c6244f1b49fee713f7a06c0e9ec549b

7 days agoPersonIdent: Use java.time instead of older Date and milliseconds 42/1204142/9
Ivan Frade [Fri, 15 Nov 2024 18:26:21 +0000 (10:26 -0800)]
PersonIdent: Use java.time instead of older Date and milliseconds

From errorprone: Date has a bad API that leads to bugs; prefer
java.time.Instant or LocalDate.

Replace the long with milliseconds and int with minutes offset with an
Instant and a ZoneOffset. Create new constructors and deprecate
variants with Date, milliseconds and minute offsets.

When comparing instances of PersonIdent truncate the timestamp precision
to 1 second since git commit timestamps are persisted with 1 second
precision [1].

[1] https://git-scm.com/docs/git-commit#Documentation/git-commit.txt-Gitinternalformat

Change-Id: Id4ba1f108e1ba0bfcdd87ba37c67e2d3cc7d254f

7 days agoGitTimeParser: A date parser using the java.time API 41/1204141/7
Ivan Frade [Mon, 11 Nov 2024 21:13:59 +0000 (13:13 -0800)]
GitTimeParser: A date parser using the java.time API

Replacement of GitDateParser that uses java.time classes instead of
the obsolete Date. Updating GitDateParser would have been a mess of
deprecation and methods with confusing names, so I opted for writing a
parallel class with the new types.

Some differences:

* The new DateTimeFormatter is thread-safe, so we don't need the
LocalThread cache

* No code seems to use other locale than the default, we don't need to
cache per locale either

Change-Id: If24610a055a47702fb5b7be2fc35a7c722480ee3

7 days agoConfigure JDT to not raise error on deprecated class linked in javadoc 12/1203912/2
Matthias Sohn [Tue, 19 Nov 2024 10:11:40 +0000 (11:11 +0100)]
Configure JDT to not raise error on deprecated class linked in javadoc

Change-Id: I4f8cdaa3147c03b455ed0656622c6b69b474577a

7 days agoMerge "Update Jetty to 12.0.15"
Matthias Sohn [Tue, 19 Nov 2024 09:28:20 +0000 (09:28 +0000)]
Merge "Update Jetty to 12.0.15"

8 days agoUpdate Jetty to 12.0.15 10/1203910/1
Matthias Sohn [Mon, 18 Nov 2024 21:26:13 +0000 (22:26 +0100)]
Update Jetty to 12.0.15

Change-Id: I8414114bb6c38b62d912e55810b4bf68faf3083f

12 days agoPullCommandTest: assert git status in some simple tests 09/1203909/2
Matthias Sohn [Thu, 14 Nov 2024 22:28:17 +0000 (23:28 +0100)]
PullCommandTest: assert git status in some simple tests

Bug: jgit-107
Change-Id: I54856849df7c6959ccc2b6f10de510950d3da401

12 days agoChange default similarity score to 50(%) to match git's default 08/1203908/2
Matthias Sohn [Thu, 14 Nov 2024 21:12:02 +0000 (22:12 +0100)]
Change default similarity score to 50(%) to match git's default

Git uses a default similarity score of 50(%) for rename detection.
Fix RenameDetector to use the same default score.

See https://git-scm.com/docs/git-diff#Documentation/git-diff.txt--Mltngt

Bug: jgit-110
Change-Id: I4b75910a02bca1afc108ad9e5609fda1e49a29da

12 days agoSystemReader: add method to get LocalDateTime 40/1204140/1
Ivan Frade [Tue, 12 Nov 2024 20:29:13 +0000 (12:29 -0800)]
SystemReader: add method to get LocalDateTime

Using #civilNow() because in the documentation, this calendar-based
representation is called "civil time".

Change-Id: Iaa363e66683cb548419666068a4ffef44a776e12

12 days agoSystemReader#now: make it a concrete method 49/1204049/2
Ivan Frade [Thu, 14 Nov 2024 00:25:42 +0000 (16:25 -0800)]
SystemReader#now: make it a concrete method

Abstract methods break subclasses (e.g. DelegateSystemReader in
gerrit). Updating jgit and gerrit is simpler if we do not add them. I
am not sure why some methods are abstract and others dont, but now()
can be a concrete method.

Make now() concrete. Implement it by default based on
getCurrentTime(), so subclasses overriding that method get the same
value.

Change-Id: I697749f8cba698c5388ed13ebdc2b238d6259358

12 days agoMerge "MockSystemReader: create the right time zone"
Ivan Frade [Thu, 14 Nov 2024 16:51:58 +0000 (16:51 +0000)]
Merge "MockSystemReader: create the right time zone"

13 days ago[errorprone] RawText: Add parenthesis for explicit op precedence 48/1204048/1
Ivan Frade [Thu, 14 Nov 2024 00:11:17 +0000 (16:11 -0800)]
[errorprone] RawText: Add parenthesis for explicit op precedence

errorprone reports:

[OperatorPrecedence] Use grouping parenthesis to make the
operator precedence explicit

Take the chance to fix also
https://errorprone.info/bugpattern/YodaCondition in the same lines.

Change-Id: I6d8f00842ef2bb24cd00fc413121b8a4e20c186b

13 days agoMockSystemReader: create the right time zone 47/1204047/2
Ivan Frade [Tue, 12 Nov 2024 20:26:02 +0000 (12:26 -0800)]
MockSystemReader: create the right time zone

Using this timezone in a later commit, it complains:

Exception java.time.DateTimeException: Zone offset minutes and seconds
must be negative because hours is negative

Change-Id: I5787b51f98109942ac33e0496c5e3761914b2a78

13 days agoMerge "SystemReader: Give a default implementation to #getTimezoneAt()"
Ivan Frade [Wed, 13 Nov 2024 22:19:48 +0000 (22:19 +0000)]
Merge "SystemReader: Give a default implementation to #getTimezoneAt()"

13 days agoRawText: improve performance of isCrLfText and isBinary 58/1200658/5
XenoAmess [Mon, 23 Sep 2024 20:18:06 +0000 (04:18 +0800)]
RawText: improve performance of isCrLfText and isBinary

Inline the function isBinary(byte, byte), and reduce several duplicated
checks in it, for better performance.

Change-Id: Ida855ed4fd7456d8fb7ed68f3af2dbfa0e25897c

13 days agoSystemReader: Give a default implementation to #getTimezoneAt() 41/1204041/2
Ivan Frade [Wed, 13 Nov 2024 19:58:06 +0000 (11:58 -0800)]
SystemReader: Give a default implementation to #getTimezoneAt()

This abstract method forces subclasses (e.g. DelegateSystemReader in
gerrit) to update their code, but there is no strong reason to make it
abstract (subclasses can override it if needed).

Make the method concrete using the current default implementation
(which is the same in the mock).

Change-Id: Id1df0d71cab1d86879adf48e782f0050d3abcfa9

13 days agoMerge "[errorprone] ssh: suppress warning for arrays in records"
Ivan Frade [Wed, 13 Nov 2024 17:12:08 +0000 (17:12 +0000)]
Merge "[errorprone] ssh: suppress warning for arrays in records"

13 days ago[errorprone] ssh: suppress warning for arrays in records 80/1203980/2
Ivan Frade [Tue, 12 Nov 2024 23:40:43 +0000 (15:40 -0800)]
[errorprone] ssh: suppress warning for arrays in records

Errorpone considers an error to have arrays (mutable) inside records
(immutable) [1].

Suppress the warnings in these records, as they are overriding equals
and hash to do the right thing.

[1] https://errorprone.info/bugpattern/ArrayRecordComponent

Change-Id: I01c724516b1b14d512d366a35708436463fccffc

13 days agoMerge branch 'stable-7.1' 04/1203904/1
Matthias Sohn [Wed, 13 Nov 2024 12:23:15 +0000 (13:23 +0100)]
Merge branch 'stable-7.1'

* stable-7.1:
  Prepare 7.1.0-SNAPSHOT builds
  JGit v7.1.0.202411121450-m3

Change-Id: Ib507d052f37695f9e8235ef1711f4e8eaa113cd0

13 days agoPrepare 7.1.0-SNAPSHOT builds 03/1203903/1
Matthias Sohn [Wed, 13 Nov 2024 12:22:35 +0000 (13:22 +0100)]
Prepare 7.1.0-SNAPSHOT builds

Change-Id: Id5379361dd8673e91c998b56f2ee61e041da6113

2 weeks agoJGit v7.1.0.202411121450-m3 00/1203900/1 v7.1.0.202411121450-m3
Matthias Sohn [Tue, 12 Nov 2024 14:49:41 +0000 (15:49 +0100)]
JGit v7.1.0.202411121450-m3

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

2 weeks agoRename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap 24/1203924/1
Jacek Centkowski [Mon, 11 Nov 2024 11:36:03 +0000 (12:36 +0100)]
Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap

As sugested in I608011462f1.

Change-Id: If66226dd7b08ae768413fa614df5dcb6b44dc118

2 weeks agoDon't fail when trying to prune pack which is already gone 56/1203856/2
Jacek Centkowski [Mon, 11 Nov 2024 11:48:20 +0000 (12:48 +0100)]
Don't fail when trying to prune pack which is already gone

Update the TestRepository.prunePacked so that it doesn't fail if a pack
to be pruned is already gone. It is especially handy when prunePacked
function is called in `TestRepository.packAndPrune` function after repo
moves on after the GC was performed.

Change-Id: I01b4ddbaddec1fdc24cfbb967e0edfe0de6c4b7c

2 weeks agoMerge branch 'master' into stable-7.1 57/1203557/1
Matthias Sohn [Mon, 11 Nov 2024 23:06:18 +0000 (00:06 +0100)]
Merge branch 'master' into stable-7.1

* master:
  errorprone: Disable javadoc checks in tests
  Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap
  Replace custom encoder Constants#encodeASCII by JDK implementation
  Replace custom encoder `Constants#encode` by JDK implementation
  DfsGarbageCollector: #setReflogExpire with Instant instead of Date
  ssh: Minor simplification in SerialRangeSet
  DfsBlockCacheConfig: propagate hotmap configs to pack ext cache configs
  SystemReader: Offer methods with java.time API
  Add `numberOfPackFilesAfterBitmap` to RepoStatistics
  Enhance CommitBuilder#parent to tolerate null parent
  GPG: use BC PGP secret key parsing out of the box
  [errorprone] bc: Remove unused SExprParser#parseSecretKey
  Update bouncycastle to 1.79
  Update bytebuddy to 1.15.10
  DfsPackCompactor: write object size index
  [errorprone] BaseRepositoryBuilder: Use #split(sep, limit)
  [errorprone] Remove deprecated security manager
  [errorprone] RefDatabase: #getConflictingNames immutable return
  DfsGarbageCollector: Add setter for reflog expiration time.
  [errorprone] SeparateClassloadertTestRunner: use #split(String,int)
  [errorprone] HttpConnection: Add missing summary in java
  [errorprone] PackWriter: Fix javadoc tag in new #writeIndex method
  [errorprone] ByteArraySet: Add summary fragment to javadoc
  [errorprone] util.Stats: Add summary fragment to javadoc
  DfsInserter: Read minBytesForObjectSizeIndex only from repo config
  PackWriter: make PackWriter.writeIndex() take a PackIndexWriter
  dfs: update getBlockCacheStats to return a List of BlockCacheStats
  Update mockito to 5.14.2
  Update bytebuddy to 1.15.7
  Remove unnecessary argument handler in MergeBase.java
  Replace custom encoder Constants#encodeASCII by JDK implementation

Change-Id: I0f84a69af152936f66bbcd2c8d9190ad159e7878

2 weeks agoMerge branch 'stable-7.0' 56/1203556/1
Matthias Sohn [Mon, 11 Nov 2024 22:55:18 +0000 (23:55 +0100)]
Merge branch 'stable-7.0'

* stable-7.0:
  Replace custom encoder Constants#encodeASCII by JDK implementation
  Replace custom encoder `Constants#encode` by JDK implementation
  Add `numberOfPackFilesAfterBitmap` to RepoStatistics
  Enhance CommitBuilder#parent to tolerate null parent

Change-Id: I46f961144f2e3c4c57ef0f63a9c8954fee8133e9

2 weeks agoMerge branch 'stable-6.10' into stable-7.0 55/1203555/1
Matthias Sohn [Mon, 11 Nov 2024 22:39:12 +0000 (23:39 +0100)]
Merge branch 'stable-6.10' into stable-7.0

* stable-6.10:
  Replace custom encoder Constants#encodeASCII by JDK implementation
  Replace custom encoder `Constants#encode` by JDK implementation
  Add `numberOfPackFilesAfterBitmap` to RepoStatistics
  Enhance CommitBuilder#parent to tolerate null parent

Change-Id: If05b0d474c728b54cab9af2b7416be30b2754d1b

2 weeks agoMerge "DfsBlockCacheConfig: propagate hotmap configs to pack ext cache configs"
Ivan Frade [Mon, 11 Nov 2024 21:18:30 +0000 (21:18 +0000)]
Merge "DfsBlockCacheConfig: propagate hotmap configs to pack ext cache configs"

2 weeks agoMerge "ssh: Minor simplification in SerialRangeSet"
Matthias Sohn [Mon, 11 Nov 2024 21:10:19 +0000 (21:10 +0000)]
Merge "ssh: Minor simplification in SerialRangeSet"

2 weeks agoMerge "Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap"
Matthias Sohn [Mon, 11 Nov 2024 21:08:24 +0000 (21:08 +0000)]
Merge "Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap"

2 weeks agoerrorprone: Disable javadoc checks in tests 86/1203886/2
Ivan Frade [Mon, 11 Nov 2024 19:07:21 +0000 (11:07 -0800)]
errorprone: Disable javadoc checks in tests

Errorprone finds many problems in the tests javadocs. This is noisy in
the logs, but fixing them also disturbs the project history and can
complicate merges.

Disable the javadoc checks in the tests packages. We can fix those
javadocs if some other modification happen in the file (as we fix
older coding style).

Change-Id: Ic221b60afe77ed9c207adbefd9117d2e26107792

2 weeks agoPack.java: Recover more often in Pack.copyAsIs2() 50/1203550/2
Martin Fick [Mon, 23 Sep 2024 19:10:17 +0000 (12:10 -0700)]
Pack.java: Recover more often in Pack.copyAsIs2()

The PACK class is designed to throw
StoredObjectRepresentationNotAvailableException at times when it cannot
find an object which previously was believed to be in its packfile and
it is still possible for the caller, PackWriter.writeObjectImpl(), to
retry copying the object from another file and potentially avoid
causing a user facing error for this fairly common expected situation.
This retry helps handle when repacking causes a packfile to be replaced
by new files with the same objects. Improve copyAsIs2() to drastically
make recovery possible in more situations.

Once any data for a specific object, has been sent it is very difficult
to recover from that object being relocated to another pack. But if a
read error is detected in copyAsIs2() before sending the object header
(and thus any data), then it should still be recoverable. Fix three
places where we could have recovered because we hadn't sent the header
yet, and adjust another place to send the header a bit later, after
having read some data from the object successfully. Basically, if the
header has not been written yet, throw
StoredObjectRepresentationNotAvailableException to signal that this is
still recoverable.

These fixes should drastically improve the chances of recovery since due
to unix file semantics, if the partial read succeeds, then the full read
will very likely succeed. This is because while the file may no longer
be open when the first read is done (the WindowCache may have evicted
it), once the first read completes it will likely still be open and even
if the file is deleted the WindowCache will continue to be able to read
from it until it closes it.

Change-Id: Ib87e294e0dbacf71b10db55be511e91963b4a84a
Signed-off-by: Martin Fick <mfick@nvidia.com>
2 weeks agoRename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap 54/1203854/1
Jacek Centkowski [Mon, 11 Nov 2024 11:36:03 +0000 (12:36 +0100)]
Rename numberOfPackFilesAfterBitmap to numberOfPackFilesSinceBitmap

As sugested in I608011462f1.

Change-Id: If66226dd7b08ae768413fa614df5dcb6b44dc118

2 weeks agoReplace custom encoder Constants#encodeASCII by JDK implementation 48/1203548/3
Matthias Sohn [Fri, 6 Sep 2024 11:42:27 +0000 (13:42 +0200)]
Replace custom encoder Constants#encodeASCII by JDK implementation

Ensure that the method still throws an IllegalArgumentException for
malformed input or if the String contains unmappable characters.

Change-Id: I6a340aa1af60c315272ff13b6bf2041ba30c94ca
(cherry picked from commit 0fd76114e3436ac635641d06371fd8833179312d)

2 weeks agoReplace custom encoder `Constants#encode` by JDK implementation 47/1203547/3
Matthias Sohn [Fri, 6 Sep 2024 10:26:44 +0000 (12:26 +0200)]
Replace custom encoder `Constants#encode` by JDK implementation

Using the implementation provided in the JDK since Java 1.6 by
`String#getBytes(Charset)` reduces JGit maintenance effort and improves
performance.

The method Constants#encode was implemented when JGit still used Java
1.5. See [1].

Kudos to Marcin for proposing to use this improvement in RefWriter [2].
I think it should be used generally.

[1] https://repo.or.cz/jgit.git?a=commit;h=bfa3da225f198b19061158499b1135aff07d85b3
[2] https://eclipse.gerrithub.io/c/eclipse-jgit/jgit/+/1195180

Also-By: Marcin Czech <maczech@gmail.com>
Change-Id: I361ed6286b98351a315b8a8ffc3cb845831d35b2
(cherry picked from commit e5d2898997462e0f2409c09497ab62c6cda2dbaf)

2 weeks agoDfsGarbageCollector: #setReflogExpire with Instant instead of Date 99/1203799/3
Ivan Frade [Fri, 8 Nov 2024 16:49:09 +0000 (08:49 -0800)]
DfsGarbageCollector: #setReflogExpire with Instant instead of Date

The Date API is full of major design flaws and pitfalls and should be
avoided at all costs. Prefer the java.time APIs, specifically,
java.time.Instant (for physical time) and java.time.LocalDate[Time]
(for civil time). [1]

Replace the Date with Instant in the
DfsGarbageCollector#setReflogExpire method.

[1] https://errorprone.info/bugpattern/JavaUtilDate

Change-Id: Ie98e426e63621e8bef96c31bca56aec0c8eef5a6

2 weeks agossh: Minor simplification in SerialRangeSet 00/1203800/1
Thomas Wolf [Fri, 8 Nov 2024 17:18:21 +0000 (18:18 +0100)]
ssh: Minor simplification in SerialRangeSet

Instead of set.headMap(x).lastKey() use set.floorKey(x) and
instead of set.tailMap(x).firstKey() use set.ceilingKey(x).

Change-Id: I22f44cbe82b9ead06d6ff517d609dfdbc89a758c

2 weeks agoDfsBlockCacheConfig: propagate hotmap configs to pack ext cache configs 73/1203673/3
Laura Hamelin [Wed, 6 Nov 2024 21:41:30 +0000 (13:41 -0800)]
DfsBlockCacheConfig: propagate hotmap configs to pack ext cache configs

CacheHotMap is currently only set on the base DfsBlockCacheConfig and is
not propagated down to PackExt specific caches.

Because CacheHotMap is set from a method call rather than from Configs,
this change sets per-PackExt CacheHotMap configs on PackExt cache
configs both when DfsBlockCacheConfig#setCacheHotMap(...) is called, and
when DfsBlockCacheConfig#configure(...) is called after setCacheHotMap.

The outer DfsBlockCacheConfig keeps the full CacheHotMap for the same
reason that the CacheHotMap config is propagated in both setCacheHotMap
and configure: the order of operations setting the configuration from
Configs and calling setCacheHotMap is not guaranteed.

Change-Id: Id9dc32fedca99ecc83c9dc90c24d9616873a202e

2 weeks agoMerge "SystemReader: Offer methods with java.time API"
Ivan Frade [Fri, 8 Nov 2024 00:34:37 +0000 (00:34 +0000)]
Merge "SystemReader: Offer methods with java.time API"

2 weeks agoMerge "Remove unnecessary argument handler in MergeBase.java"
Matthias Sohn [Fri, 8 Nov 2024 00:10:04 +0000 (00:10 +0000)]
Merge "Remove unnecessary argument handler in MergeBase.java"

2 weeks agoSystemReader: Offer methods with java.time API 75/1203675/2
Ivan Frade [Mon, 4 Nov 2024 22:21:24 +0000 (14:21 -0800)]
SystemReader: Offer methods with java.time API

Error prone explains: The Date API is full of major design flaws and
pitfalls and should be avoided at all costs. Prefer the java.time
APIs, specifically, java.time.Instant (for physical time) and
java.time.LocalDate[Time] (for civil time).

Add to SystemReader methods to get the time and timezone in the new
java.time classes (Instant/ZoneId) and mark as deprecated their old
counterparts.

The mapping of methods is:
* #getCurrentTime -> #now (returns Instant instead of int)
* #getTimezone -> #getTimeZoneAt (returns ZoneOffset intead of int)
* #getTimeZone -> #getTimeZoneId (return ZoneId instead of TimeZone)

Change-Id: Ic55b2f442a40046ff0ed24f61f566fc7416471be

2 weeks agoAdd `numberOfPackFilesAfterBitmap` to RepoStatistics 35/1203735/3
Jacek Centkowski [Fri, 20 Sep 2024 06:47:13 +0000 (08:47 +0200)]
Add `numberOfPackFilesAfterBitmap` to RepoStatistics

Introduce a `numberOfPackFilesAfterBitmap` that contains the number of
packfiles created since the latest bitmap generation.

Notes:
* the `repo.getObjectDatabase().getPacks()` that obtains the list of
  packs (in the existing `getStatistics` function) uses
  `PackDirectory.scanPacks` that boils down to call
  `PackDirectory.scanPacksImpl` which is sorting packs prior returning
  them therefore the `numberOfPackFilesAfterBitmap` is just all packs
  before the one that has bitmap attached
* the improved version of `packAndPrune` function (one that skips
  non-existent packfiles) was introduced for testing

Change-Id: I608011462f104fc002ac527aa405f492a8a4b0c2

2 weeks agoEnhance CommitBuilder#parent to tolerate null parent 46/1203546/1
Matthias Sohn [Thu, 7 Nov 2024 22:35:13 +0000 (23:35 +0100)]
Enhance CommitBuilder#parent to tolerate null parent

Change-Id: Ifdeafd040bca8331804c3e7568da0bee5cbd01df

2 weeks agoGPG: use BC PGP secret key parsing out of the box 69/1203669/2
Thomas Wolf [Wed, 6 Nov 2024 18:14:47 +0000 (19:14 +0100)]
GPG: use BC PGP secret key parsing out of the box

Remove the custom S-expression parsing; BC has gotten many
improvements in 1.79 regarding PGP ed25519 keys, AES/OCB
encryption, and generally parsing key files. It now can do
all we need.

Change-Id: I392443e040cce150a9575d18795a7cb8195a3515
Signed-off-by: Thomas Wolf <twolf@apache.org>
3 weeks ago[errorprone] bc: Remove unused SExprParser#parseSecretKey 40/1203640/1
Ivan Frade [Tue, 5 Nov 2024 23:03:26 +0000 (15:03 -0800)]
[errorprone] bc: Remove unused SExprParser#parseSecretKey

errorprone complains about using Date in the SExprParser class. All
the usages are in a variant of the parseSecretKey method that doesn't
have any callers.

Remove the unused method.

Change-Id: I80f5aa58877b9da31729cb90b0219e45d96144a8

3 weeks agoUpdate bouncycastle to 1.79 45/1203545/2
Matthias Sohn [Tue, 5 Nov 2024 01:00:24 +0000 (02:00 +0100)]
Update bouncycastle to 1.79

Change-Id: Ib81d73075ebc9dcdc73aacf30fa02ad56a502d51

3 weeks agoUpdate bytebuddy to 1.15.10 44/1203544/1
Matthias Sohn [Tue, 5 Nov 2024 00:42:16 +0000 (01:42 +0100)]
Update bytebuddy to 1.15.10

Change-Id: I49cd5bedd86601380a26f7a7213fc78ebd091393

3 weeks agoMerge branch 'stable-7.1' 43/1203543/1
Matthias Sohn [Tue, 5 Nov 2024 00:29:08 +0000 (01:29 +0100)]
Merge branch 'stable-7.1'

* stable-7.1:
  Add missing @since 7.1 to UploadPack#implies
  ResolveMerger: Allow setting the TreeWalk AttributesNodeProvider
  Add Union merge strategy support

Change-Id: Ib1c1725578e522c88f80f050d221a517bf012017

3 weeks agoAdd missing @since 7.1 to UploadPack#implies 42/1203542/1
Matthias Sohn [Tue, 5 Nov 2024 00:28:14 +0000 (01:28 +0100)]
Add missing @since 7.1 to UploadPack#implies

Change-Id: Iabbe1f18a5022b4669a3352493c6fd35920ef25f

3 weeks agoMerge branch 'stable-7.0' into stable-7.1 41/1203541/1
Matthias Sohn [Tue, 5 Nov 2024 00:21:05 +0000 (01:21 +0100)]
Merge branch 'stable-7.0' into stable-7.1

* stable-7.0:
  ResolveMerger: Allow setting the TreeWalk AttributesNodeProvider
  Add Union merge strategy support

Change-Id: I15674134f4c73ac2de514d4fac4a36fca7ed7b07

3 weeks agoMerge branch 'stable-6.10' into stable-7.0 40/1203540/1
Matthias Sohn [Tue, 5 Nov 2024 00:13:36 +0000 (01:13 +0100)]
Merge branch 'stable-6.10' into stable-7.0

* stable-6.10:
  ResolveMerger: Allow setting the TreeWalk AttributesNodeProvider
  Add Union merge strategy support

Change-Id: I0d768d793effd1deabb4807446a4f8c10a82ad74

3 weeks agoResolveMerger: Allow setting the TreeWalk AttributesNodeProvider 78/1203278/4
Nasser Grainawi [Tue, 29 Oct 2024 23:22:15 +0000 (17:22 -0600)]
ResolveMerger: Allow setting the TreeWalk AttributesNodeProvider

When a merger is created without a Repository, no
AttributesNodeProvider is created in the TreeWalk. Since mergers are
often created with a custom ObjectInserter and no repo, they skip any
lookups of attributes from any of the gitattributes files (within a
tree, in the repo info/ dir, or user/global). Since there are
potentially merge-affecting attributes in those files, callers might
want to use both a custom ObjectInserter and an AttributesNodeProvider.

Change-Id: I7997309003bbb598e1002261b3be7f2cc52066c8

3 weeks agoAdd Union merge strategy support 79/1203079/4
Nasser Grainawi [Tue, 22 Oct 2024 02:26:35 +0000 (20:26 -0600)]
Add Union merge strategy support

Allow users to specify the `union` strategy in their .gitattributes file
in order to keep lines from both versions of a conflict [1].

[1] https://git-scm.com/docs/gitattributes.html#Documentation/gitattributes.txt-union

Change-Id: I74cecceb2db819a8551b95fb10dfe7c2b160b709

3 weeks agoMerge "DfsPackCompactor: write object size index"
Ivan Frade [Mon, 4 Nov 2024 20:05:10 +0000 (20:05 +0000)]
Merge "DfsPackCompactor: write object size index"

3 weeks agoDfsPackCompactor: write object size index 68/1203468/4
Ivan Frade [Fri, 1 Nov 2024 15:58:27 +0000 (08:58 -0700)]
DfsPackCompactor: write object size index

Currently the compactor is not writing the object size index for
packs. As it is using PackWriter to generate the packs, it needs to
explicitely call the writes of each extension.

Invoke writeObjectSizeIndex in the compactor. The pack writer will
write one if the configuration says so.

Change-Id: I8d6bbbb5bd67bfc7dd511aa76463512b1e86a45d

3 weeks ago[errorprone] BaseRepositoryBuilder: Use #split(sep, limit) 75/1203475/1
Ivan Frade [Thu, 31 Oct 2024 19:50:00 +0000 (12:50 -0700)]
[errorprone] BaseRepositoryBuilder: Use #split(sep, limit)

String.split(String) and Pattern.split(CharSequence) have surprising
behaviour [1].

We use one of the recommended replacements: #split(sep, limit).

[1] https://errorprone.info/bugpattern/StringSplitter

Change-Id: Ie1cf7590bd8660d21c79c5c3c1bc2765e5d9462b

3 weeks ago[errorprone] Remove deprecated security manager 02/1203402/2
Ivan Frade [Thu, 31 Oct 2024 19:17:09 +0000 (12:17 -0700)]
[errorprone] Remove deprecated security manager

Errorprone warns about this deprecated classes. The recommendation is
stop using SecurityManager all together.

The Security Manager is deprecated and subject to removal in a future
release. There is no replacement for the Security Manager. See JEP 411
[1] for discussion and alternatives.

[1] https://openjdk.org/jeps/411

Change-Id: I3c67136e97d13cf24b85e41d94408631c26e8be8

3 weeks ago[errorprone] RefDatabase: #getConflictingNames immutable return 03/1203403/1
Ivan Frade [Thu, 31 Oct 2024 19:55:31 +0000 (12:55 -0700)]
[errorprone] RefDatabase: #getConflictingNames immutable return

Errorprone reports that: This method returns both mutable and
immutable collections or maps from different paths. This may be
confusing for users of the method.

Return always an immutable collection.

Change-Id: Id48f3645fd06c8bc72212af180d7d02c7e0b7632

3 weeks agoMerge "DfsGarbageCollector: Add setter for reflog expiration time."
Ivan Frade [Thu, 31 Oct 2024 19:17:53 +0000 (19:17 +0000)]
Merge "DfsGarbageCollector: Add setter for reflog expiration time."

3 weeks agoDfsGarbageCollector: Add setter for reflog expiration time. 18/1203218/10
Saril Sudhakaran [Tue, 29 Oct 2024 05:17:01 +0000 (00:17 -0500)]
DfsGarbageCollector: Add setter for reflog expiration time.

JGit reftable writer/compator knows how to prune the history, but the
DfsGarbageCollector doesn't expose the time limit.

Add a method to DfsGarbageCollector to set the reflog time limit.
This value is then passed to the reftable compactor. Callers usually
pass here the value from gc.reflogExpire.

The reflog block length is stored in 24 bits [1], limiting the size to
16MB. I have observed that in repositories with frequent commits,
reflogs hit that size in 6-12 months.

[1] https://git-scm.com/docs/reftable

Bug: jgit-96

Change-Id: I8b32d6d2b2e1d8af8fb7d9f86225d75f1877eb2f

3 weeks agoMerge "[errorprone] HttpConnection: Add missing summary in java"
Ivan Frade [Thu, 31 Oct 2024 16:50:18 +0000 (16:50 +0000)]
Merge "[errorprone] HttpConnection: Add missing summary in java"

3 weeks agoMerge "[errorprone] PackWriter: Fix javadoc tag in new #writeIndex method"
Ivan Frade [Wed, 30 Oct 2024 23:07:48 +0000 (23:07 +0000)]
Merge "[errorprone] PackWriter: Fix javadoc tag in new #writeIndex method"

3 weeks agoMerge "[errorprone] SeparateClassloadertTestRunner: use #split(String,int)"
Ivan Frade [Wed, 30 Oct 2024 23:00:52 +0000 (23:00 +0000)]
Merge "[errorprone] SeparateClassloadertTestRunner: use #split(String,int)"

3 weeks ago[errorprone] SeparateClassloadertTestRunner: use #split(String,int) 15/1197415/6
Ivan Frade [Mon, 8 Jul 2024 21:21:45 +0000 (14:21 -0700)]
[errorprone] SeparateClassloadertTestRunner: use #split(String,int)

Errorprone recommends to use String.split(String, int) as it has a
less surprising behaviour with empty entries.

https://errorprone.info/bugpattern/StringSplitter
Change-Id: I48a01ee18d66bbb4a177aee576629dc5132d4a38