]> source.dussan.org Git - jgit.git/log
jgit.git
8 hours agoMerge branch 'stable-7.0' 85/1204285/1 master
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

8 hours agoMerge branch 'stable-6.10' into stable-7.0 84/1204284/2 stable-7.0
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

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

Change-Id: Ic430686dc41ecbd8d8d19068416bc18ba2d94f3f

8 hours 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

10 hours 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

12 hours 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

18 hours 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

19 hours 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

21 hours 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

21 hours 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

21 hours 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

21 hours 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

21 hours 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"

22 hours 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

36 hours 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

36 hours 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

41 hours 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"

43 hours 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

43 hours 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

43 hours 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

43 hours 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

43 hours 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

44 hours 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

44 hours 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

46 hours 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"

2 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

6 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

6 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

6 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

6 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

6 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"

7 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

7 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

7 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()"

7 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

7 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

7 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"

7 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

7 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

7 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

8 days 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

8 days 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

9 days 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

9 days 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

9 days 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

9 days 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

9 days 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"

9 days 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"

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

9 days 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

9 days 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

11 days 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)

11 days 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)

12 days 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

12 days 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

12 days 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

13 days 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"

13 days 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"

13 days 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

13 days 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

13 days 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>
2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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"

2 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

2 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

2 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

2 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

2 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."

2 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

2 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

3 weeks ago[errorprone] HttpConnection: Add missing summary in java 27/1203327/2
Ivan Frade [Wed, 30 Oct 2024 22:45:33 +0000 (15:45 -0700)]
[errorprone] HttpConnection: Add missing summary in java

The constants don't have summary and errorprone complains about it.

Change-Id: Id1470ed9fd54cf7fd684045c5631acc1a8d450c2

3 weeks ago[errorprone] PackWriter: Fix javadoc tag in new #writeIndex method 26/1203326/1
Ivan Frade [Wed, 30 Oct 2024 22:36:09 +0000 (15:36 -0700)]
[errorprone] PackWriter: Fix javadoc tag in new #writeIndex method

We introduced this method recently and the javadoc is not correct:

error: [InvalidInlineTag] This tag is invalid.
   @code{PackIndexWriter} instance to write the index

Change-Id: I34ed3d8b5a121fea9b8163627b46ae4a289c9462

3 weeks ago[errorprone] ByteArraySet: Add summary fragment to javadoc 80/1197480/3
Ivan Frade [Tue, 9 Jul 2024 20:29:15 +0000 (13:29 -0700)]
[errorprone] ByteArraySet: Add summary fragment to javadoc

Reported by error prone.

Change-Id: Icaa69c37d0cde19fc605cb3f3c5f9ed9abfb37d3

3 weeks ago[errorprone] util.Stats: Add summary fragment to javadoc 79/1197479/4
Ivan Frade [Tue, 9 Jul 2024 18:10:02 +0000 (11:10 -0700)]
[errorprone] util.Stats: Add summary fragment to javadoc

Errorprone complains about missing summary in these javadocs.

[MissingSummary] A summary fragment is required; consider using the
value of the @return b lock as a summary fragment instead.

         * @return variance of the added values
           ^
(see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns variance of the added values.'?

Change-Id: I29d633ec95c18b17cc92b069dd1a94fbb2a75c94

3 weeks agoMerge "PackWriter: make PackWriter.writeIndex() take a PackIndexWriter"
Ivan Frade [Tue, 29 Oct 2024 22:14:55 +0000 (22:14 +0000)]
Merge "PackWriter: make PackWriter.writeIndex() take a PackIndexWriter"

3 weeks agoDfsInserter: Read minBytesForObjectSizeIndex only from repo config 69/1203269/5
Ivan Frade [Tue, 29 Oct 2024 17:57:28 +0000 (10:57 -0700)]
DfsInserter: Read minBytesForObjectSizeIndex only from repo config

In general, JGit reads the configuration it needs from the repository
configuration. minBytesForObjectSizeIndex is a special case with a
setter for subclasses but that is unnecessary.

Remove the setter and read the conf from the repo. Make the property
final and read it directly from the conf (it is clearer than parsing a
whole PackConfig to read a single value).

Change-Id: I8d77247452ff65e6c431fdcfebb90ed2ce40aed1

3 weeks agoPackWriter: make PackWriter.writeIndex() take a PackIndexWriter 74/1202274/22
Sam Delmerico [Mon, 7 Oct 2024 21:34:03 +0000 (14:34 -0700)]
PackWriter: make PackWriter.writeIndex() take a PackIndexWriter

Previously, the PackWriter implementation required that indexes and
their extensions be writable to an OutputStream with a fixed binary
format.  To support more general index storage formats, allow
PackWriter to accept an PackIndexWriter interface which accepts only
the objects to store. This allows implementors to choose their storage
format.

The implementation will be provided by the DfsObjectDatabase. The
DfsObjectDatabase is already responsible for providing the OutputStream
that was previously used to write indexes. Having it provide a writing
interface would be a natural generalization.

This idea was previously implemented for PackBitmapIndex writing in
https://gerrithub.io/c/eclipse-jgit/jgit/+/1177722.

Change-Id: I582d2f3d25d6adb2da243d6d0d7bc405a97d6183

3 weeks agoMerge "dfs: update getBlockCacheStats to return a List of BlockCacheStats"
Ivan Frade [Mon, 28 Oct 2024 19:46:47 +0000 (19:46 +0000)]
Merge "dfs: update getBlockCacheStats to return a List of BlockCacheStats"

3 weeks agodfs: update getBlockCacheStats to return a List of BlockCacheStats 70/1198370/24
Laura Hamelin [Wed, 24 Jul 2024 21:01:38 +0000 (14:01 -0700)]
dfs: update getBlockCacheStats to return a List of BlockCacheStats

Make available all underlying cache table stats for the used cache table
implementation.

The existing cache table stats implementation only allows a "global"
view of the cache table statistics; it does not differentiate between
all possible underlying cache tables used.

This change allows callers to get the block cache stats broken down
per underlying table. These cache stats are intended to be used for
monitoring all cache tables independently.

Existing usages of getBlockCacheStats now make use of
AggregatedBlockCacheStats.fromStatsList to aggregate the list of
BlockCacheStats into a single BlockCacheStats instance.

Change-Id: I261b3f2849857172397657e5c674b11e09807f27

3 weeks agoMerge "Replace custom encoder Constants#encodeASCII by JDK implementation"
Matthias Sohn [Sat, 26 Oct 2024 19:06:49 +0000 (19:06 +0000)]
Merge "Replace custom encoder Constants#encodeASCII by JDK implementation"

3 weeks agoUpdate mockito to 5.14.2 42/1203042/1
Matthias Sohn [Thu, 24 Oct 2024 11:02:21 +0000 (13:02 +0200)]
Update mockito to 5.14.2

Change-Id: I0e6442a86ba1790680b832d62d4b04df0713da5f

3 weeks agoUpdate bytebuddy to 1.15.7 41/1203041/1
Matthias Sohn [Thu, 24 Oct 2024 11:00:42 +0000 (13:00 +0200)]
Update bytebuddy to 1.15.7

Change-Id: I8f718f0b06887c8ebfe70941dc2730604f0790e0

3 weeks agoMerge branch 'stable-7.1' 58/1202358/1
Matthias Sohn [Thu, 24 Oct 2024 10:49:26 +0000 (12:49 +0200)]
Merge branch 'stable-7.1'

* stable-7.1:
  Prepare 7.1.0-SNAPSHOT builds
  JGit v7.1.0.202410232130-m2
  Prepare 7.1.0-SNAPSHOT builds
  JGit v7.1.0.202410012040-m1

Change-Id: I6647fe6dede0d15828ebd3bccae1565a374fa17f

3 weeks agoPrepare 7.1.0-SNAPSHOT builds 57/1202357/1
Matthias Sohn [Thu, 24 Oct 2024 10:48:40 +0000 (12:48 +0200)]
Prepare 7.1.0-SNAPSHOT builds

Change-Id: Ibaddbad3677636452cad4e8b7ce0a58b1a78f833

4 weeks agoJGit v7.1.0.202410232130-m2 54/1202354/1 v7.1.0.202410232130-m2
Matthias Sohn [Wed, 23 Oct 2024 21:28:50 +0000 (23:28 +0200)]
JGit v7.1.0.202410232130-m2

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

4 weeks agoMerge branch 'master' into stable-7.1 53/1202353/1
Matthias Sohn [Wed, 23 Oct 2024 20:35:13 +0000 (22:35 +0200)]
Merge branch 'master' into stable-7.1

* master:
  SSH signing: implement a SignatureVerifier
  SSH signing: implement a Signer
  PackIndexWriter: create interface to write indexes
  Add `numberOfPackFilesAfterBitmap` to RepoStatistics
  SSH signing: don't require a session in PasswordProviderWrapper
  SSH signing: make OpenSSH pattern matching public
  SSH signing: prepare config
  ssh: add a factory for KeyPasswordProvider
  DfsBlockCacheConfig: update stream.toList to collect(toList)
  DfsBlockCache: refactor stats implementations.
  DfsBlockCacheConfigs: add debug configuration print
  Test advertised capabilities with protocol V0 and allow*Sha1InWant
  Align request policies with CGit
  DfsReaderOptions: read loadRevIndexInParallel from config
  UploadPack: suppress resource warning for DepthWalk.RevWalk
  Update Apache sshd to 2.14.0
  LfsConnectionFactoryTest: remove unnecessary cast
  JSchSshProtocol2Test: remove unnecessary cast
  ApacheSshProtocol2Test: remove unnecessary cast
  NoteMapMerger: remove unnecessary cast
  Update jetty to 12.0.14
  Update Apache sshd to 2.14.0
  orbit-4.34: update junit bundle to 4.13.2.v20240929-1000
  WindowCursor: Fix parameter name in javadoc
  RevolveMerger: honor ignoreConflicts also for binary files
  dfs: add configurable name to block cache table stats
  DfsBlockCache: use PackExtBlockCacheTable when configured

Change-Id: I1483aab03c6c01a0b11d4eaa2f7722cb53fe5837

4 weeks agoMerge branch 'stable-7.0' 52/1202352/1
Matthias Sohn [Wed, 23 Oct 2024 20:27:53 +0000 (22:27 +0200)]
Merge branch 'stable-7.0'

* stable-7.0:
  Update Apache sshd to 2.14.0
  LfsConnectionFactoryTest: remove unnecessary cast
  JSchSshProtocol2Test: remove unnecessary cast
  ApacheSshProtocol2Test: remove unnecessary cast
  NoteMapMerger: remove unnecessary cast

Change-Id: Iade9d1fd01452ca12b4f75731fd13d02a5ac5e55

4 weeks agoMerge changes from topic "ssh-signatures"
Matthias Sohn [Wed, 23 Oct 2024 20:17:29 +0000 (20:17 +0000)]
Merge changes from topic "ssh-signatures"

* changes:
  SSH signing: implement a SignatureVerifier
  SSH signing: implement a Signer
  SSH signing: don't require a session in PasswordProviderWrapper
  SSH signing: make OpenSSH pattern matching public
  SSH signing: prepare config
  ssh: add a factory for KeyPasswordProvider