]> source.dussan.org Git - jgit.git/log
jgit.git
13 months agoMerge branch 'stable-6.7' 35/204935/2
Matthias Sohn [Fri, 13 Oct 2023 19:31:00 +0000 (21:31 +0200)]
Merge branch 'stable-6.7'

* stable-6.7:
  PackConfig: fix @since tags
  Remove unused API problem filters
  Add support for git config repack.packKeptObjects
  Do not exclude objects in locked packs from bitmap processing

Change-Id: I7e0856a5d70d5d155cf6874383ea1f5622d5238a

13 months agoUse net.i2p.crypto.eddsa 0.3.0 from new Orbit build 34/204934/2
Matthias Sohn [Fri, 13 Oct 2023 08:15:08 +0000 (10:15 +0200)]
Use net.i2p.crypto.eddsa 0.3.0 from new Orbit build

consuming it directly from Maven Central.

The bundle net.i2p.crypto.eddsa 0.3.0 contains bad OSGi metadata,
earlier it was repackaged in Orbit tweaking its mandatory dependency to
sun.security.x509 to an optional dependency.

This project seems to be orphaned, probably because Java 15 added
support for eddsa with JEP339 [1].

This repackaged bundle is no longer available after Orbit was renovated
[2] to consume the vast majority of bundles directly from Maven Central
without repacking them. Hence we have to workaround this (probably
false) mandatory dependency. For that export an empty dummy package
"sun.security.x509" to satisfy OSGi.

[1] https://openjdk.org/jeps/339
[2] https://github.com/eclipse-orbit/orbit-simrel/issues/15

Change-Id: I2267e15823ebce6cf1d448e1e16a129f703e0f80

13 months agoMerge branch 'stable-6.6' into stable-6.7 30/204930/1
Matthias Sohn [Fri, 13 Oct 2023 07:06:21 +0000 (09:06 +0200)]
Merge branch 'stable-6.6' into stable-6.7

* stable-6.6:
  PackConfig: fix @since tags
  Remove unused API problem filters
  Add support for git config repack.packKeptObjects
  Do not exclude objects in locked packs from bitmap processing

Change-Id: I29241619e6c09933bb856e486f379be10dd609c2

13 months agoMerge branch 'stable-6.5' into stable-6.6 29/204929/1
Matthias Sohn [Fri, 13 Oct 2023 06:46:11 +0000 (08:46 +0200)]
Merge branch 'stable-6.5' into stable-6.6

* stable-6.5:
  PackConfig: fix @since tags
  Remove unused API problem filters
  Add support for git config repack.packKeptObjects
  Do not exclude objects in locked packs from bitmap processing

Change-Id: I7272a22451c0de6b4770767e7bb4e24c81518c20

13 months agoMerge branch 'stable-6.4' into stable-6.5 27/204927/2
Matthias Sohn [Thu, 12 Oct 2023 23:52:43 +0000 (01:52 +0200)]
Merge branch 'stable-6.4' into stable-6.5

* stable-6.4:
  PackConfig: fix @since tags
  Remove unused API problem filters
  Add support for git config repack.packKeptObjects
  Do not exclude objects in locked packs from bitmap processing

Change-Id: I2951d01f5f4581bee20079508cd8ee6ca8554f1f

13 months agoMerge branch 'stable-6.3' into stable-6.4 26/204926/2
Matthias Sohn [Thu, 12 Oct 2023 23:33:56 +0000 (01:33 +0200)]
Merge branch 'stable-6.3' into stable-6.4

* stable-6.3:
  PackConfig: fix @since tags
  Remove unused API problem filters
  Add support for git config repack.packKeptObjects
  Do not exclude objects in locked packs from bitmap processing

Change-Id: I4b94a2b79941c085fa2f62246e8e879aaa85cd3f

13 months agoMerge branch 'stable-6.2' into stable-6.3 28/204928/1
Matthias Sohn [Thu, 12 Oct 2023 22:51:46 +0000 (00:51 +0200)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  PackConfig: fix @since tags
  Remove unused API problem filters
  Add support for git config repack.packKeptObjects
  Do not exclude objects in locked packs from bitmap processing

Change-Id: I22b89bf00dcef26b2096d25397aa9a57a745a92b

13 months agoMerge branch 'stable-6.1' into stable-6.2 04/204904/1
Matthias Sohn [Thu, 12 Oct 2023 22:44:33 +0000 (00:44 +0200)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  PackConfig: fix @since tags
  Remove unused API problem filters
  Add support for git config repack.packKeptObjects
  Do not exclude objects in locked packs from bitmap processing

Change-Id: Ib4e4fe407dce334c7537bf278baa39db93aa2f09

13 months agoMerge branch 'stable-6.0' into stable-6.1 03/204903/2
Matthias Sohn [Thu, 12 Oct 2023 22:33:19 +0000 (00:33 +0200)]
Merge branch 'stable-6.0' into stable-6.1

* stable-6.0:
  PackConfig: fix @since tags
  Remove unused API problem filters
  Add support for git config repack.packKeptObjects
  Do not exclude objects in locked packs from bitmap processing

Change-Id: I0c9c0b3c206cac03a93b30eda348177a4de35c36

13 months agoMerge branch 'stable-5.13' into stable-6.0 02/204902/1
Matthias Sohn [Thu, 12 Oct 2023 22:22:11 +0000 (00:22 +0200)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  PackConfig: fix @since tags
  Remove unused API problem filters
  Add support for git config repack.packKeptObjects
  Do not exclude objects in locked packs from bitmap processing

Change-Id: Ifeaa4b4f0c5944d4ecd3042be429833ff72b43ed

13 months agoPackConfig: fix @since tags 01/204901/1
Matthias Sohn [Thu, 12 Oct 2023 22:19:12 +0000 (00:19 +0200)]
PackConfig: fix @since tags

Change-Id: Ia513f7cdbf3c197e8661720fc804984ff165fc5c

13 months agoRemove unused API problem filters 00/204900/1
Matthias Sohn [Thu, 12 Oct 2023 22:18:59 +0000 (00:18 +0200)]
Remove unused API problem filters

Change-Id: I9d5b96cf841478af8613667ef8574423630f8028

13 months agoAdd support for git config repack.packKeptObjects 20/204820/8
Antonio Barone [Thu, 5 Oct 2023 19:58:13 +0000 (21:58 +0200)]
Add support for git config repack.packKeptObjects

Change Ide3445e652 introduced the `--pack-kept-objects` option to GC for
including the objects contained in the locked packfiles during the
repack phase.

Whilst this allowed to explicitly pass a command line argument to the
jgit gc program, it did not allow the option to be read from
configuration.

Allow the pack kept objects option to be configured exactly as C-Git
documents [1], by introducing a new `repack.packKeptObjects`
configuration.

`repack.packKeptObjects` defaults to `true`, when the
`pack.buildBitmaps` is `true` (which is the default case), `false`
otherwise.

[1] https://git-scm.com/docs/git-config#Documentation/git-config.txt-repackpackKeptObjects

Bug: 582292
Change-Id: Ia931667277410d71bc079d27c097a57094299840

13 months agoDo not exclude objects in locked packs from bitmap processing 25/203625/21
Luca Milanesio [Fri, 11 Aug 2023 19:15:17 +0000 (20:15 +0100)]
Do not exclude objects in locked packs from bitmap processing

Packfiles having an equivalent .keep file are associated with in-flight
pushes that haven't been completed, with potentially a set of git
objects not yet referenced by a ref.

If the Git client is not up-to-date, it may result in pushing a
packfile, generating a <packfile>.keep on the server, which
may also contain existing commits due to the lack of Git protocol
negotiation in the git-receive-pack.

The Git protocol negotiation is the phase where the client and the
server exchange the list of refs they have for trying to find a common
base and minimise the amount of objects to be transferred.

The repack phase in GC was previously skipping all objects that were
contained in all packfiles having a <packfile>.keep file associated
(aka "locked packfiles"), which did not take into consideration the
fact that excluding the existing commits would have resulted in the
generation of an invalid bitmap file.

The code for excluding the objects in the locked packfiles was written
well before the bitmap was introduced, hence could not consider a use
case that did not exist at that time.

However, when the bitmap was introduced, the exclusion of locked
packfiles was not changed, hence creating a potential problem.
The issue went unnoticed for many years because the bitmap generation
was disabled when JGit noticed any locked packfiles; however, the
bitmaps are enabled again since  Id722e68d9f , and the the issue is now
visible and is impacting the GC repack phase.

Introduce the '--pack-kept-objects' option in GC for including the
objects contained in the locked packfiles during the repack phase,
which is not an issue because of the following:

- If there are any existing commits duplicated in the packfiles
  they will be just considered once anyway because the repack doesn't
  generate duplicates in the output packfile.

- If there are any new commits that do not have any ref pointing to
  them, they will be automatically excluded from the output repacked
  packfile.

The same identical solution is adopted in the C implementation of git
in repack.c.

Because the locked packfile is not pruned, any new commits not pointed
by any refs will remain in the repository and there will not be any
accidental pruning or object loss as it is today before this change.

As a side-effect of this change, it is now potentially possible to still
have duplicate BLOBs after GC when the keep packfile contained existing
objects. However, it is way better to keep the duplication until the
next GC phase rather than omitting existing objects from repacking and,
therefore generating an invalid bitmap and incorrect packfile.

Bug: 582292
Bug: 582455
Change-Id: Ide3445e652fcf256a7912f881cb898897c99b8f8

13 months agoMerge changes Ibd71a992,Ib7fa7cb7
Matthias Sohn [Mon, 9 Oct 2023 22:43:10 +0000 (18:43 -0400)]
Merge changes Ibd71a992,Ib7fa7cb7

* changes:
  [errorprone] Fix InconsistentCapitalization
  Update orbit to orbit-aggregation/2023-12

13 months ago[errorprone] Fix InconsistentCapitalization 83/204783/1
Matthias Sohn [Thu, 5 Oct 2023 14:46:21 +0000 (16:46 +0200)]
[errorprone] Fix InconsistentCapitalization

See https://errorprone.info/bugpattern/InconsistentCapitalization

Change-Id: Ibd71a992128ca2e5f916a08dd11da67c5a2f8aad

13 months agoTestRepository: Add getInstant method 21/204821/1
David Ostrovsky [Thu, 5 Oct 2023 21:04:00 +0000 (23:04 +0200)]
TestRepository: Add getInstant method

Error Prone is flagging Date-API as obsolete and recommends to migrate
to Instant and LocalDate. Given that more JGit users starting to migrate
to new Time API, offer getInstant method.

Change-Id: Ie010b76d1c213cd0a645f716783ed2d57fc78071

13 months agoUpdate orbit to orbit-aggregation/2023-12 82/204782/1
Matthias Sohn [Wed, 4 Oct 2023 08:35:30 +0000 (10:35 +0200)]
Update orbit to orbit-aggregation/2023-12

- add target platform for Eclipse 4.30 (2023-12)
- update org.apache.ant to 1.10.14

Change-Id: Ib7fa7cb79e93ecd6009784bc0ad4269bfa71cb29

13 months agoMerge branch 'stable-6.8' 72/204772/1
Matthias Sohn [Tue, 3 Oct 2023 18:12:28 +0000 (20:12 +0200)]
Merge branch 'stable-6.8'

* stable-6.8:
  Prepare 6.8.0-SNAPSHOT builds
  JGit v6.8.0.202310031045-m1

Change-Id: I6a6526fee84e15bb463a6ce0a0548a8b82ea7e4e

13 months agoPrepare 6.8.0-SNAPSHOT builds 70/204770/1
Matthias Sohn [Tue, 3 Oct 2023 18:10:22 +0000 (20:10 +0200)]
Prepare 6.8.0-SNAPSHOT builds

Change-Id: Idb86bac4bd152e57f1810c789bdbd26648f0b6ae

13 months agoJGit v6.8.0.202310031045-m1 68/204768/1 v6.8.0.202310031045-m1
Matthias Sohn [Tue, 3 Oct 2023 14:41:57 +0000 (16:41 +0200)]
JGit v6.8.0.202310031045-m1

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

13 months agoUploadPack: Delay freeing refs in sendPack() 10/204710/1
Ivan Frade [Thu, 28 Sep 2023 22:06:40 +0000 (15:06 -0700)]
UploadPack: Delay freeing refs in sendPack()

Change [1] set refs to null at the beggining of sendPack claiming they
are not needed anymore, but they are still used few lines below to
hoist referenced objects to the front of the pack. With refs nullified,
the hoist doesn't happened. This hasn't caused any problem so far,
probably because it is just an optimization and the objects are in the
pack anyway.

Move the nullification after the hoisting to keep the optimization and
save the memory.

[1] https://git.eclipse.org/r/c/jgit/jgit/+/161341

Change-Id: I8455249d8482f616af362d3912b718064d473b49

13 months agoMerge "Fix log level for successful execution of ShutdownHook#notify to debug"
Thomas Wolf [Tue, 26 Sep 2023 21:40:52 +0000 (17:40 -0400)]
Merge "Fix log level for successful execution of ShutdownHook#notify to debug"

13 months agoByteBufferInputStream: add missing @since 6.8 49/204649/1
Thomas Wolf [Tue, 26 Sep 2023 21:11:07 +0000 (23:11 +0200)]
ByteBufferInputStream: add missing @since 6.8

Change-Id: I80574a514ade608b87bed2dae79851e53a850c31
Signed-off-by: Thomas Wolf <twolf@apache.org>
13 months agoFix log level for successful execution of ShutdownHook#notify to debug 30/204630/1
Matthias Sohn [Tue, 26 Sep 2023 20:38:49 +0000 (22:38 +0200)]
Fix log level for successful execution of ShutdownHook#notify to debug

This is debug trace and shouldn't be logged as a warning.

Change-Id: Ibb24e91e857a05aa6b74b0e2c5b11ab057f6206a

13 months agoEclipse features: update copyright year 21/204621/1
Thomas Wolf [Tue, 12 Sep 2023 18:59:12 +0000 (20:59 +0200)]
Eclipse features: update copyright year

Set upper bound to 2023.

Change-Id: I67acc12b3fe80ab7ca4a9303b0e96325a1e707e9
Signed-off-by: Thomas Wolf <twolf@apache.org>
13 months agoSSH agent: correct plug-in title 20/204620/1
Thomas Wolf [Tue, 12 Sep 2023 18:58:38 +0000 (20:58 +0200)]
SSH agent: correct plug-in title

It's not only "Unix SSH agent" support, but also for Windows. Drop
"Unix".

Change-Id: I22deb3e5750825a70c78eec46b1f2968544857b9
Signed-off-by: Thomas Wolf <twolf@apache.org>
13 months agoFix DefaultCharset bug pattern flagged by error prone 27/194527/2
David Ostrovsky [Sat, 2 Jul 2022 07:36:56 +0000 (09:36 +0200)]
Fix DefaultCharset bug pattern flagged by error prone

See more details in: [1].

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

Change-Id: Ib6aa279f9dcf63dff0672df5b5be3ea72597b1d8

13 months agoActivate additional error prone checks 55/161955/12
David Ostrovsky [Sun, 3 May 2020 21:37:03 +0000 (23:37 +0200)]
Activate additional error prone checks

Change-Id: I1b351e04da9f08681f08aae9ce984c3d3285e88e
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
13 months agoWorkingTreeIterator: directly filter input stream 87/204587/6
Matthias Sohn [Sat, 23 Sep 2023 23:41:13 +0000 (01:41 +0200)]
WorkingTreeIterator: directly filter input stream

This way we can avoid to access the byte buffers backing array.
Implement a ByteBufferInputStream to wrap a byte buffer which we can use
to expose the filter result as an input stream.

Change-Id: I461c82090de2562ea9b649b3f953aad4571e3d25

13 months ago[errorprone] Add missing javadoc summary 85/204585/10
Matthias Sohn [Sat, 16 Sep 2023 20:14:49 +0000 (22:14 +0200)]
[errorprone] Add missing javadoc summary

see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment

Change-Id: Iaf4a6b55d4e4c59b7a2da3451164abb1bb47d4a1

13 months ago[errorprone] Fix BadImport 84/204584/9
Matthias Sohn [Thu, 21 Sep 2023 23:30:04 +0000 (01:30 +0200)]
[errorprone] Fix BadImport

See https://errorprone.info/bugpattern/BadImport

Change-Id: Iea98b15862ed0bc4bcad759a7240133769680808

13 months ago[errorprone] Prevent int expression may overflow 82/204582/9
Matthias Sohn [Wed, 20 Sep 2023 12:14:53 +0000 (14:14 +0200)]
[errorprone] Prevent int expression may overflow

see https://errorprone.info/bugpattern/IntLongMath

Change-Id: Id201b7fc49b953d500e88b95e183127fe40ef6cc

13 months ago[errorprone] Suppress ByteBufferBackingArray 81/204581/9
Matthias Sohn [Wed, 20 Sep 2023 13:03:53 +0000 (15:03 +0200)]
[errorprone] Suppress ByteBufferBackingArray

The byte buffers used here are created by wrapping a byte[].

See https://errorprone.info/bugpattern/ByteBufferBackingArray

Change-Id: Idbc16d5ae4ff9f64b97be07a3cdf190716da191f

13 months ago[errorprone] Suppress JavaLangClash to avoid breaking change 80/204580/9
Matthias Sohn [Wed, 20 Sep 2023 12:53:04 +0000 (14:53 +0200)]
[errorprone] Suppress JavaLangClash to avoid breaking change

Renaming this class is a breaking change. Add a todo to rename it in
next major release.

See https://errorprone.info/bugpattern/JavaLangClash

Change-Id: I3528fd654e30d98f4ea43e71107d83324942141c

13 months ago[errorprone] Fix EqualsGetClass 79/204579/8
Matthias Sohn [Fri, 22 Sep 2023 13:00:47 +0000 (15:00 +0200)]
[errorprone] Fix EqualsGetClass

See https://errorprone.info/bugpattern/EqualsGetClass

Change-Id: Ida19a7e60656f87518e5ae2ef5eae511edb5b837

13 months ago[errorprone] MockSystemReader: fix CatchAndPrintStackTrace 78/204578/8
Matthias Sohn [Fri, 22 Sep 2023 12:57:14 +0000 (14:57 +0200)]
[errorprone] MockSystemReader: fix CatchAndPrintStackTrace

See https://errorprone.info/bugpattern/CatchAndPrintStackTrace
Change-Id: If1ec66ea65eaef9311a650d8a5741a03ac76cb88

Change-Id: Ic52205bab141a4e3c6a9fefecf749f1ccfc0e491

13 months ago[errorprone] MetaFilter: fix IdentityHashMapUsage 77/204577/8
Matthias Sohn [Fri, 22 Sep 2023 12:51:27 +0000 (14:51 +0200)]
[errorprone] MetaFilter: fix IdentityHashMapUsage

See https://errorprone.info/bugpattern/IdentityHashMapUsage

Change-Id: Ib49c2ca5506ea7468d2680faba254fa9cd430c2c

13 months ago[errorprone] InternalFetchConnection: Suppress CatchAndPrintStackTrace 76/204576/8
Matthias Sohn [Fri, 22 Sep 2023 12:17:42 +0000 (14:17 +0200)]
[errorprone] InternalFetchConnection: Suppress CatchAndPrintStackTrace

Handled by the client side pipe handling.

See https://errorprone.info/bugpattern/CatchAndPrintStackTrace

Change-Id: I4ae19dbd0d20d1a75b6587ce7ad36f58cb58dbc2

13 months ago[errorprone] Don't swallow exception 75/204575/8
Matthias Sohn [Fri, 22 Sep 2023 11:25:21 +0000 (13:25 +0200)]
[errorprone] Don't swallow exception

See https://errorprone.info/bugpattern/UnusedException

Change-Id: I01568dfa22adbbaa50191aa2d0a445a3c252b803

13 months ago[errorprone] Fix inconsistent capitalization 74/204574/8
Matthias Sohn [Fri, 22 Sep 2023 10:37:11 +0000 (12:37 +0200)]
[errorprone] Fix inconsistent capitalization

See https://errorprone.info/bugpattern/InconsistentCapitalization

Change-Id: I5eaa35a053aca738e180fe22a05fad97877b7e0f

13 months ago[errorprone] PageRef#isStringRef: suppress UnusedMethod 73/204573/8
Matthias Sohn [Fri, 22 Sep 2023 11:44:11 +0000 (13:44 +0200)]
[errorprone] PageRef#isStringRef: suppress UnusedMethod

See https://errorprone.info/bugpattern/UnusedMethod

Change-Id: I8c2ca60ac786e20edb7112c268d638aa2488bcb8

13 months ago[errorprone] FileReftableStack: fix EqualsUnsafeCast 72/204572/8
Matthias Sohn [Fri, 22 Sep 2023 10:34:07 +0000 (12:34 +0200)]
[errorprone] FileReftableStack: fix EqualsUnsafeCast

See https://errorprone.info/bugpattern/EqualsUnsafeCast

Change-Id: I23274c1850061f0574133f52692e125cfa6b92ff

13 months ago[errorprone] Suppress MissingSummary for translation bundles 71/204571/8
Matthias Sohn [Thu, 21 Sep 2023 23:03:28 +0000 (01:03 +0200)]
[errorprone] Suppress MissingSummary for translation bundles

Change-Id: I4da51c7e089366b016a0cc64f768a151c24bc956

13 months ago[errorprone] CommandLineMergeTool: Remove unused constuctor 70/204570/8
Matthias Sohn [Thu, 21 Sep 2023 23:17:37 +0000 (01:17 +0200)]
[errorprone] CommandLineMergeTool: Remove unused constuctor

See https://errorprone.info/bugpattern/UnusedMethod

Change-Id: I711279d7b81c61111c7c129b3d119affc515fe70

13 months ago[errorprone] SimilarityRenameDetector: suppress IntLongMath 68/204568/8
Matthias Sohn [Thu, 21 Sep 2023 22:43:54 +0000 (00:43 +0200)]
[errorprone] SimilarityRenameDetector: suppress IntLongMath

Indexes are positiv.

See https://errorprone.info/bugpattern/IntLongMath

Change-Id: I9ef90b3667f833e2d708ff608929990e0a09036c

13 months agoAdd comment why protocol list uses WeakReference 67/204567/8
Matthias Sohn [Sat, 23 Sep 2023 15:54:39 +0000 (17:54 +0200)]
Add comment why protocol list uses WeakReference

Change-Id: I997933cbf1bcae94a6edd9db58c25ec1bb96445f

13 months ago[errorprone] Transport: Suppress ModifyCollectionInEnhancedForLoop 66/204566/8
Matthias Sohn [Thu, 21 Sep 2023 10:06:02 +0000 (12:06 +0200)]
[errorprone] Transport: Suppress ModifyCollectionInEnhancedForLoop

CopyOnWriteArrayList is thread-safe.

See
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/CopyOnWriteArrayList.html
https://errorprone.info/bugpattern/ModifyCollectionInEnhancedForLoop

Change-Id: I97c411e7d171cb39a9c0676b076d48103db6ff88

13 months ago[errorprone] Rename method parameter to silence InvalidParam 65/204565/6
Matthias Sohn [Wed, 20 Sep 2023 20:23:16 +0000 (22:23 +0200)]
[errorprone] Rename method parameter to silence InvalidParam

See https://errorprone.info/bugpattern/InvalidParam

Change-Id: I53279bc5e0fc59788d42994be9931857b918414b

13 months ago[errorprone] MyersDiff#main: fix CatchAndPrintStackTrace 64/204564/6
Matthias Sohn [Thu, 21 Sep 2023 10:22:24 +0000 (12:22 +0200)]
[errorprone] MyersDiff#main: fix CatchAndPrintStackTrace

Use a PrintWriter similarly like Main#run of org.eclipse.jgit.pgm does.

See https://errorprone.info/bugpattern/CatchAndPrintStackTrace

Change-Id: I8ee34da53d94ddb72b73ae86bfebc3b7f0a3dc04

13 months ago[errorprone] TagCommand: Remove unused parameter of private method 63/204563/6
Matthias Sohn [Wed, 20 Sep 2023 20:18:01 +0000 (22:18 +0200)]
[errorprone] TagCommand: Remove unused parameter of private method

See https://errorprone.info/bugpattern/UnusedVariable

Change-Id: I7e8aae3494ce60dbeb474f6bead0817c36276e69

13 months ago[errorprone] PathFilter#getPathsBestEffort: fix ArrayAsKeyOfSetOrMap 62/204562/6
Matthias Sohn [Wed, 20 Sep 2023 14:17:00 +0000 (16:17 +0200)]
[errorprone] PathFilter#getPathsBestEffort: fix ArrayAsKeyOfSetOrMap

See https://errorprone.info/bugpattern/ArrayAsKeyOfSetOrMap

Change-Id: Ia94899bfa68db39f4eb8bfca455c92f5c888647c

13 months ago[errorprone] DirCacheEntry: suppress JavaInstantGetSecondsGetNano 61/204561/6
Matthias Sohn [Wed, 20 Sep 2023 12:41:54 +0000 (14:41 +0200)]
[errorprone] DirCacheEntry: suppress JavaInstantGetSecondsGetNano

We get the seconds in the line before we access nanos.

See https://errorprone.info/bugpattern/JavaInstantGetSecondsGetNano

Change-Id: If79690378d5b31d76b06d26e07434d3dff8c92fb

13 months ago[errorprone] Directly implement functional interface 60/204560/6
Matthias Sohn [Wed, 20 Sep 2023 07:59:30 +0000 (09:59 +0200)]
[errorprone] Directly implement functional interface

instead of saving it in a lambda. Prefer to implement the functional
interface method directly and use a method reference instead.

See https://errorprone.info/bugpattern/UnnecessaryLambda

Change-Id: I7f7ebd27cd6354545c157960718d9845882e1732

13 months ago[errorprone] InterruptTimer#terminate: ensure Thread#join succeeds 59/204559/6
Matthias Sohn [Tue, 19 Sep 2023 23:44:23 +0000 (01:44 +0200)]
[errorprone] InterruptTimer#terminate: ensure Thread#join succeeds

See https://errorprone.info/bugpattern/ThreadJoinLoop

Change-Id: Ia67a284311a156c22c18575470ee5fbf734e10cc

13 months ago[errorprone] RawParseUtils@parseHexInt64: suppress IntLongMath 58/204558/6
Matthias Sohn [Tue, 19 Sep 2023 15:04:14 +0000 (17:04 +0200)]
[errorprone] RawParseUtils@parseHexInt64: suppress IntLongMath

see https://errorprone.info/bugpattern/IntLongMath

Change-Id: I71acd5eec252b8c43d7c411f513e502694830727

13 months ago[errorprone] Exceptions should not override #toString 57/204557/6
Matthias Sohn [Tue, 19 Sep 2023 14:24:48 +0000 (16:24 +0200)]
[errorprone] Exceptions should not override #toString

Instead of overriding #toString provide getter for additional
information so that code handling the exception can access it.

See https://errorprone.info/bugpattern/OverrideThrowableToString

Change-Id: Ie577ae9327e0234d55481253f2604b1644ea3f01

13 months ago[errorprone] Fix invalid param in javadoc 56/204556/6
Matthias Sohn [Tue, 19 Sep 2023 13:58:28 +0000 (15:58 +0200)]
[errorprone] Fix invalid param in javadoc

See https://errorprone.info/bugpattern/InvalidParam

Change-Id: Ife74575bb4080c3386affbfbaf9373931d72c3f3

13 months ago[errorprone] FS#searchPath: handle surprising behavior of String#split 55/204555/6
Matthias Sohn [Tue, 19 Sep 2023 12:35:38 +0000 (14:35 +0200)]
[errorprone] FS#searchPath: handle surprising behavior of String#split

See https://errorprone.info/bugpattern/StringSplitter

Change-Id: Ic80f6c53ea96537ed4d046621e774288fced7ce1

13 months ago[errorprone] FileStoreAttributes#FUTURE_RUNNER: Fix corePoolSize 53/204553/2
Matthias Sohn [Sat, 16 Sep 2023 20:40:16 +0000 (22:40 +0200)]
[errorprone] FileStoreAttributes#FUTURE_RUNNER: Fix corePoolSize

[ErroneousThreadPoolConstructorChecker] Thread pool size will never go
beyond corePoolSize if an unbounded queue is used.

see https://errorprone.info/bugpattern/ErroneousThreadPoolConstructorChecker

Change-Id: Icdeaffa05301567611682da86130440f863f2ecc

13 months ago[errorprone] Express duration using seconds which is clearer 52/204552/2
Matthias Sohn [Sat, 16 Sep 2023 20:35:37 +0000 (22:35 +0200)]
[errorprone] Express duration using seconds which is clearer

[CanonicalDuration] Duration can be expressed more clearly with
different units.

see https://errorprone.info/bugpattern/CanonicalDuration

Change-Id: I7f358b5adabee1523e56b109a2c81c74ec523b74

13 months ago[errorprone] Use ArrayList instead of LinkedList 51/204551/2
Matthias Sohn [Sat, 16 Sep 2023 20:33:17 +0000 (22:33 +0200)]
[errorprone] Use ArrayList instead of LinkedList

[JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or
ArrayDeque.

see https://errorprone.info/bugpattern/JdkObsolete

Change-Id: I13fb953f55fc7b6e007d6fd6a6a1bfd377773588

13 months ago[errorprone] AddCommand#filepattern: use a more specific type 50/204550/2
Matthias Sohn [Sat, 16 Sep 2023 20:19:41 +0000 (22:19 +0200)]
[errorprone] AddCommand#filepattern: use a more specific type

Variable type can use a more specific type to convey more information to
callers.
private Collection<String> filepatterns;
                  ^
    (see https://errorprone.info/bugpattern/PreferredInterfaceType)

Change-Id: I68b74de65aba3bb849ef508d7dcdd8b85b0ab100

13 months ago[errorprone] Suppress UnnecessaryParentheses 69/204569/2
Matthias Sohn [Fri, 22 Sep 2023 12:30:11 +0000 (14:30 +0200)]
[errorprone] Suppress UnnecessaryParentheses

for the sake of readability.

See https://errorprone.info/bugpattern/UnnecessaryParentheses

Change-Id: I8444db78c408d4e8bd71bf7e575b9af637900629

13 months ago[errorprone] Remove unnecessary parentheses 49/204549/2
Matthias Sohn [Sat, 16 Sep 2023 20:09:11 +0000 (22:09 +0200)]
[errorprone] Remove unnecessary parentheses

see https://errorprone.info/bugpattern/UnnecessaryParentheses

Change-Id: Id08cf0e05b3d35f139fc34e0aa83882555a8a81a

14 months agotools/BUILD: Sort errorprone rules alphabetically 28/204528/1
Matthias Sohn [Sat, 16 Sep 2023 09:28:01 +0000 (11:28 +0200)]
tools/BUILD: Sort errorprone rules alphabetically

Change-Id: I006940eb8a7710d5b8ea66c6f805f0dd08e62a31

14 months agoUpdate jetty to 10.0.16 69/204369/3
Matthias Sohn [Thu, 14 Sep 2023 23:54:58 +0000 (01:54 +0200)]
Update jetty to 10.0.16

Change-Id: I918e308e71fa978c9f25e3fad63c5f2e94ec3be7

14 months agoUpdate bazel to 6.3.2 48/204348/3
Matthias Sohn [Fri, 15 Sep 2023 09:53:56 +0000 (11:53 +0200)]
Update bazel to 6.3.2

With bazel 6.2.0 building the change
I918e308e71fa978c9f25e3fad63c5f2e94ec3be7 fails with this error:

$ bazelisk build all
INFO: Invocation ID: ba94402e-d1db-4920-ad46-58139ef7ca55
INFO: Analyzed target //:all (96 packages loaded, 1961 targets
configured).
INFO: Found 1 target...
ERROR: /Users/xxxxxxx/.cache/bazel/b645215973ac043930fa5900e337e822/external/jetty-util-ajax/jar/BUILD:3:12:
Extracting interface @jetty-util-ajax//jar:jar failed: (Segmentation
fault): ijar failed: error executing command (from target
@jetty-util-ajax//jar:jar)
external/remote_java_tools_darwin_arm64/java_tools/ijar/ijar
external/jetty-util-ajax/jar/jetty-util-ajax-10.0.16.jar ... (remaining
3 arguments skipped)
...

Updating bazel to 6.3.2 fixes this problem.

Release notes for bazel 6.3.2:
https://github.com/bazelbuild/bazel/releases/tag/6.3.2

Change-Id: I4f697b2f9a560732c89e2a0410ae6133e8c382ef

14 months agoDfsPackFile: remove unnecessary @SuppressWarnings("boxing") 27/204527/1
Matthias Sohn [Fri, 22 Sep 2023 15:03:31 +0000 (17:03 +0200)]
DfsPackFile: remove unnecessary @SuppressWarnings("boxing")

Change-Id: I7af999dc4434b7b57bb7e0b84b9b64d24efce220

14 months agoCommitGraphWriter: Remove unnecessary semicolon 26/204526/1
Matthias Sohn [Fri, 22 Sep 2023 14:51:37 +0000 (16:51 +0200)]
CommitGraphWriter: Remove unnecessary semicolon

Change-Id: I8ea87d0ff3be8a541e72210f0da7fec1f43008e8

14 months agoCommitGraphWriter: fix boxing warnings 25/204525/1
Matthias Sohn [Fri, 22 Sep 2023 14:50:24 +0000 (16:50 +0200)]
CommitGraphWriter: fix boxing warnings

Change-Id: I35c3a3baadb8d7d73c01252fe4333fa2159722ee

14 months agoCommitGraphWriter#createCoreChunks: Remove not-thrown exceptions 24/204524/1
Matthias Sohn [Fri, 22 Sep 2023 14:46:47 +0000 (16:46 +0200)]
CommitGraphWriter#createCoreChunks: Remove not-thrown exceptions

Change-Id: I0e6f32ed415dc3a0ccadbeae46c979c378ebb0fc

14 months agoCommitGraphWriter: Decouple Stats from computing bloom filters 44/204244/3
Ivan Frade [Fri, 8 Sep 2023 20:23:09 +0000 (13:23 -0700)]
CommitGraphWriter: Decouple Stats from computing bloom filters

The public stats object is created only to be populated by the computation of
bloom filters.

Make the computation return its numbers with the results and copy them
to the stats when needed. This eliminates the side effects from the
computation and makes it easier to add more data to the stats later.

Change-Id: I7a5e55fc3a17f5a294edf3a3b725b2d9c0280a5a

14 months agoCommitGraphWriter: Move bloom filter calculation out of createChunks 43/204243/2
Ivan Frade [Fri, 8 Sep 2023 15:25:06 +0000 (08:25 -0700)]
CommitGraphWriter: Move bloom filter calculation out of createChunks

It looks confusing that the createChunks method calculates bloom
filters.

Make the calculations before and pass the result to the method.

Change-Id: If6e3c0e644f7f940f268ca7266f577f012278ff3

14 months agoDocumentation: Move writeChangedPaths flag from commitGraph to gc section. 11/204411/10
Ronald Bhuleskar [Mon, 18 Sep 2023 18:45:11 +0000 (11:45 -0700)]
Documentation: Move writeChangedPaths flag from commitGraph to gc section.

The flag commitGraph.writeChangedPaths is not correct. The option was introduced in commit 3b77e33 (Jul 19th) under gc section so updating the documentation to reflect it under correct section.

Change-Id: Ie8f82931594ed3fd1ee3e4532d2e7475878a33a1

14 months ago[errorprone] Fix wrong comparison which always evaluated to false 47/204347/1
Matthias Sohn [Fri, 15 Sep 2023 09:48:05 +0000 (11:48 +0200)]
[errorprone] Fix wrong comparison which always evaluated to false

org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/GraphObjectIndex.java:59:
error: [ComparisonOutOfRange] ints may have a value in the range
-2147483648 to 2147483647; therefore, this comparison to
Integer.MAX_VALUE will always evaluate to false
if (table[k] > Integer.MAX_VALUE) {
             ^

See https://errorprone.info/bugpattern/ComparisonOutOfRange

We need to check if variable `uint` of type `long` exceeds the maximum
possible int value before casting it to `int` below.

This was introduced in Ib5c0d6678cb242870a0f5841bd413ad3885e95f6

Change-Id: I675d594f523084be4c1678328cc343065e32d998

14 months ago[errorprone] Remove unnecessary comparison 46/204346/1
Matthias Sohn [Fri, 15 Sep 2023 09:44:09 +0000 (11:44 +0200)]
[errorprone] Remove unnecessary comparison

Raised by errorprone:

org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitConfig.java:406: error:
[ComparisonOutOfRange] chars may have a value in the range 0 to 65535;
therefore, this comparison to 0 will always evaluate to true
if (ch >= 0 && ch < inUse.length) {
       ^
see https://errorprone.info/bugpattern/ComparisonOutOfRange

Change-Id: I9625aa7894a34dbffd77d39a40c6e285c86b56d5

14 months agoUpdate org.eclipse.jdt:ecj to 3.35.0 45/204345/1
Matthias Sohn [Fri, 15 Sep 2023 00:06:48 +0000 (02:06 +0200)]
Update org.eclipse.jdt:ecj to 3.35.0

Change-Id: Ic1d7fe65a0255bc0cdaf7a7285dd3532277ec07b

14 months agoUpdate org.apache.commons:commons-compress to 1.24.0 44/204344/1
Matthias Sohn [Thu, 14 Sep 2023 22:55:17 +0000 (00:55 +0200)]
Update org.apache.commons:commons-compress to 1.24.0

Change-Id: I896298f9e94b50dda6c6396e652f4a191a722a68

14 months ago[errorprone] Suppress ImmutableEnumChecker for ShutdownHook 43/204343/1
Matthias Sohn [Thu, 14 Sep 2023 22:50:19 +0000 (00:50 +0200)]
[errorprone] Suppress ImmutableEnumChecker for ShutdownHook

Here we use enum to implement a singleton. Hence suppress the errorprone
error ImmutableEnumChecker.

Change-Id: I21f6ed83c08936dfc9aa591af809e69f3053a050

14 months agoUpdate bytebuddy to 1.14.8 42/204342/1
Matthias Sohn [Thu, 14 Sep 2023 22:48:47 +0000 (00:48 +0200)]
Update bytebuddy to 1.14.8

Change-Id: I60ad9ea9300099eeabbb5023d7a5264593e60dc0

14 months agoUse ShutdownHook to gracefully handle JVM shutdown 19/204219/13
Matthias Sohn [Fri, 8 Sep 2023 20:57:05 +0000 (22:57 +0200)]
Use ShutdownHook to gracefully handle JVM shutdown

in all classes which already registered their own shutdown hook
- CloneCommand
- GC#PidLock
- FS#FileStoreAttributes
- LocalDiskRepositoryTestCase#Cleanup

Change-Id: I3efc1f83f3cbbf43eeeaaedcd2bee1ef31971a72

14 months agoAdd ShutdownHook to cleanup FileLocks on graceful JVM shutdown 13/204213/12
Matthias Sohn [Fri, 8 Sep 2023 00:14:20 +0000 (02:14 +0200)]
Add ShutdownHook to cleanup FileLocks on graceful JVM shutdown

This should avoid stale lock files if the JVM is terminated gracefully.

Implement a ShutdownHook which can register/unregister listeners which
need to do some cleanup during graceful JVM shutdown. This hook is
registered as a Java shutdown hook and  when the JVM shuts down
calls #onShutdown of registered listeners using a parallel stream
to let them run concurrently.

See https://docs.oracle.com/javase/8/docs/technotes/guides/lang/hook-design.html

Bug: 582379
Change-Id: I1621dc5f7d9a8c832b6d1b74cbc47578b1c2f0b8

14 months agoUnregister ShutdownHook when GC#PidLock is closed 12/204212/3
Matthias Sohn [Fri, 8 Sep 2023 00:32:57 +0000 (02:32 +0200)]
Unregister ShutdownHook when GC#PidLock is closed

Otherwise the JVM will accumulate the ShutdownHook objects of all GCs
run while the JVM is up.

Change-Id: Iadc723a939238a3a75b4ba47f898918eb4554ea3

14 months agoMerge "OSGi: move plugin localization to subdirectory"
Matthias Sohn [Tue, 12 Sep 2023 20:39:19 +0000 (16:39 -0400)]
Merge "OSGi: move plugin localization to subdirectory"

14 months agoOSGi: move plugin localization to subdirectory 99/204299/1
Thomas Wolf [Mon, 11 Sep 2023 18:58:15 +0000 (20:58 +0200)]
OSGi: move plugin localization to subdirectory

OSGi can have its plugin localization at an arbitrary place; there is
no need to have it in a top-level plugin.properties file. In non-OSGi
environments having the files at the root level may mean that these
files clash with each other, or, as in the referenced bug, with some
third-party plug-in's plugin.properties, which may not even have
anything to do with localization.

Move our OSGi localization to a subfolder OSGI-INF/l10n. For OSGi
environments, that's just as good, and for non-OSGi environments it
avoid clashes with other root level items on the classpath or in a fat
JAR.

For fragments, use neither plugin.properties (which would clash with the
host plug-in's plugin.properties) nor fragment.properties (which might
clash with other fragments for the same fragment host bundle). Instead
use names "relative" to the host bundle.

Bug: 582394
Change-Id: Ifbcd046d912e2cfe86c0f7259c5ca8de599d9aa1
Signed-off-by: Thomas Wolf <twolf@apache.org>
14 months agossh: Remove redundant null check for home.getAbsoluteFile() 67/204267/1
Jonathan Nieder [Tue, 12 Sep 2023 00:12:17 +0000 (17:12 -0700)]
ssh: Remove redundant null check for home.getAbsoluteFile()

File#getAbsoluteFile is non-nullable, so this check can never trigger.
Worse, getAbsoluteFile can throw an exception such as
InvalidPathException, and since this call isn't in the "try" block
that checks for that, the exception would then escape the getSession
call.

Noticed because the exception is being thrown in googlesource.com's
custom SshdSessionFactory, causing incoming ssh requests to fail
(noticed using internal tests).

Change-Id: I57f2d5e497ff678b17573f79827b6e1d9a6c9b9f
Signed-off-by: Jonathan Nieder <jrn@google.com>
14 months agoRevertCommand: support for inserting a Gerrit change ID 42/204242/1
Thomas Wolf [Fri, 8 Sep 2023 20:27:19 +0000 (22:27 +0200)]
RevertCommand: support for inserting a Gerrit change ID

Add a setter for the flag to be passed through to the CommitCommand.

Bug: 342790
Change-Id: I87548d7c2742af8af5ef6105115e3ab9c58d1d9f
Signed-off-by: Thomas Wolf <twolf@apache.org>
14 months ago[releng] Bump japicmp base version to 6.7.0.202309050840-r 41/204241/1
Thomas Wolf [Fri, 8 Sep 2023 19:37:15 +0000 (21:37 +0200)]
[releng] Bump japicmp base version to 6.7.0.202309050840-r

Change-Id: I8ccf8472a8bf06669ebdcd3d59d24f7d5567d89e
Signed-off-by: Thomas Wolf <twolf@apache.org>
14 months agoDfsPackFile: Record index loads only in one place 36/204236/4
Ivan Frade [Fri, 8 Sep 2023 15:35:47 +0000 (08:35 -0700)]
DfsPackFile: Record index loads only in one place

Each index can be set in the reader from two locations: the dfs cache
callback or the code afterwards. The pack is emitting the load event
in both cases, when the reference is set. This is brittle (right now
it is missing events for BITMAP_INDEX and COMMIT_GRAPH).

Emit the index loaded event only once, after going through the cache
code. The fact that the reference was set in the callback or the main
code is irrelevant. Also, the reader is per-thread, so there shouldn't
be any concurrency involved triggering double counts.

Change-Id: I7f3d078a53741ecc1e81b96353ed8faa8fef3a49

14 months agoDfsPackfile: Emit the index load with the index object 33/204233/2
Ivan Frade [Fri, 8 Sep 2023 15:20:31 +0000 (08:20 -0700)]
DfsPackfile: Emit the index load with the index object

The DfsReader#emitIndexLoad expects a reference to the loaded object,
not to its identity hash. This makes listeneres recalculate an
identity hash over an Int object.

Pass the expected reference to the method.

Change-Id: Iee982fdd0169c93c5c7cd9cfe4260a7a82d23f6a

14 months agoPrepare 6.8.0-SNAPSHOT builds 46/204146/3
Matthias Sohn [Thu, 7 Sep 2023 00:24:53 +0000 (02:24 +0200)]
Prepare 6.8.0-SNAPSHOT builds

Change-Id: Ifc81f0a96c2ced0b25926b9daa539d9cfc951925

14 months agoMerge branch 'stable-6.7' 45/204145/3
Matthias Sohn [Thu, 7 Sep 2023 00:23:57 +0000 (02:23 +0200)]
Merge branch 'stable-6.7'

* stable-6.7:
  Prepare 6.7.1-SNAPSHOT builds
  Switch back to wagon-ssh-external
  Fix generation of maven site
  JGit v6.7.0.202309050840-r
  Remove unused API problem filters
  [releng] Bump japicmp base version to 6.6.0.202305301015-r
  Fix list of 3rd party bundles in p2 repo
  Add missing source bundle org.osgi.service.cm.source to target platform
  Prepare 6.6.2-SNAPSHOT builds
  JGit v6.6.1.202309021850-r
  Checkout: better directory handling
  Document commit-graph options supported by JGit
  Fix warning raised for local variable hiding DfsPackFile#index
  Suppress boxing warnings in DfsPackFile
  Remove unused API problem filters
  Suppress boxing warnings in tests
  Fix warning about empty block
  Update mockito to 5.5.0
  Update byte-buddy to 1.14.7
  Prepare 6.7.0-SNAPSHOT builds
  JGit v6.7.0.202308301100-rc1

Change-Id: Ib2a1000ead5ca6cf3816e9e9496ad5d92f4dc963

14 months agoPrepare 6.7.1-SNAPSHOT builds 44/204144/1
Matthias Sohn [Wed, 6 Sep 2023 20:45:52 +0000 (22:45 +0200)]
Prepare 6.7.1-SNAPSHOT builds

Change-Id: I96097ef8c6f198220f513bbc6d5f8881834a1491

14 months agoSwitch back to wagon-ssh-external 42/204142/1
Matthias Sohn [Wed, 6 Sep 2023 23:07:04 +0000 (01:07 +0200)]
Switch back to wagon-ssh-external

Bug: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/2818
Change-Id: Ic283e5229b1a8a0b1ae349555ac7cfb7b046d7be

14 months agoFix generation of maven site 41/204141/1
Matthias Sohn [Wed, 6 Sep 2023 22:06:52 +0000 (00:06 +0200)]
Fix generation of maven site

- update maven-site-plugin to 4.0.0-M9
- use wagon-ssh extension for deployment
- disable doclint
- don't fail the build for javadoc warnings

Change-Id: I81f7229deaf6892416ce4cebd6c122f00a857d51

14 months agoMerge "CommitGraphWriter: Make the list of chunks immutable"
Ivan Frade [Wed, 6 Sep 2023 21:19:21 +0000 (17:19 -0400)]
Merge "CommitGraphWriter: Make the list of chunks immutable"

14 months agoEnsure home directory not null before using in Sshdsessionfactory 57/204157/1
Minh Thai [Wed, 6 Sep 2023 14:13:05 +0000 (07:13 -0700)]
Ensure home directory not null before using in Sshdsessionfactory

Home directory might not be set in DFS.

Change-Id: I3528685838065dc291826fc73a37126af7bf47ce

14 months agoCommitGraphWriter: Make the list of chunks immutable 26/204126/1
Ivan Frade [Tue, 5 Sep 2023 18:25:54 +0000 (11:25 -0700)]
CommitGraphWriter: Make the list of chunks immutable

The chunk list is calculated before start writing and it is
immutable afterwards.

Make this explicit using an unmodifiable list for the chunks.

Change-Id: I4a5cfb1f3d06a9393d8d93a3fac3c128cf3faec0

14 months agoCommitGraphWriter: Assert written bytes 23/204123/2
Ivan Frade [Tue, 5 Sep 2023 17:17:52 +0000 (10:17 -0700)]
CommitGraphWriter: Assert written bytes

The final size of the commit-graph is known before-hand. As a
safety-net, assert the written size matches the expected value.

Change-Id: Ib0828a7cce5bacb33f6325ee3910f4eebd95eb8c