]> source.dussan.org Git - jgit.git/log
jgit.git
8 months agoImprove handling of NFS stale handle errors 25/1176125/1
Dariusz Luksza [Mon, 20 Nov 2023 11:53:19 +0000 (11:53 +0000)]
Improve handling of NFS stale handle errors

Mark packfile as invalid when NFS stale handle error occurs.

This should fix broken fetch operations when the repo is located on the
NFS system and is GC'ed on a separate system (or process). Which may
result in the index, pack or bitmap file being removed when they are
accessed from the fetch operation.

Bug: 573770
Signed-off-by: Dariusz Luksza <dariusz.luksza@gmail.com>
Change-Id: I70217bfb93bf7421ea2c1d74cbe4f15c76d9c098
(cherry picked from commit c701c01b49d92993f1c3df0a0e26a2dd68b8cec1)

8 months agoFix handling of missing pack index file 24/1176124/1
Dariusz Luksza [Mon, 20 Nov 2023 11:00:51 +0000 (11:00 +0000)]
Fix handling of missing pack index file

As demonstrated in
`UploadPackHandleDeletedPackFile.testV2IdxFileRemovedDuringUploadPack`
the fetch operation will fail when the pack index file is removed.

This is due to a wrapping of `FileNotFoundException` (which is a
subclass of `IOExeption`) in an `IOException` at PackIndex L#68. This
is then changing the behaviour of error handling in
`Pack.file.getBitmapIndex()` where the `FileNotFoundException` is
swallowed and allows the fetch process to continue. With FNFE being
wrapped in IOE, this blows up and breaks the fetch operation.

Simply rethrowing `FileNotFoundException` from `PackFile.open()` fixes
the broken fetch operation. This will also mark the whole pack as
invalid in the `IOException` handler in `Pack.idx()` method.

Change-Id: Ibe321aa1af21d26500e1cb2eb3464cc99a6dbc62
Signed-off-by: Dariusz Luksza <dariusz.luksza@gmail.com>
(cherry picked from commit e0910eda3ea1c474b4cf9b00ac698f739a982f8c)

8 months agoAdd tests for handling pack files removal during fetch 23/1176123/1
Dariusz Luksza [Fri, 17 Nov 2023 19:28:53 +0000 (19:28 +0000)]
Add tests for handling pack files removal during fetch

Although this could sound like a corner case, it really can occur out
there in the real world. Especially in the Gerrit world where the
repositories could be GC'ed on a separate process or system.

The `FileNotFoundException` seems to be handled correctly in
`PackFile#doOpen` (line 671) and it will mark the pack as invalid. But
triggering that code path was not an easy task.

First of all, we need to add a new commit to the `master` branch of the
test repository after `UploadPack` object is created.

Secondly, in the refspec for fetch, commit id instead of "regular"
refspec must be used.

With both in place, we can see a warning log statement about deleted
pack file. And the fetch succeeds!

Also, tests for the removal of *.idx and *.bitmap files were added.

This unveiled a corner for the *.idx file deletion while fetching, as
the test will fail with "Unreachable pack index" IOException only
when the HEAD commit is empty.

Change-Id: If26c83f9b12993d1ab7d6bad6bd863c29520b062
Signed-off-by: Dariusz Luksza <dariusz.luksza@gmail.com>
(cherry picked from commit ba5adc4ce6f234cb300b0f73a1efdba9bba1b5d8)

8 months agoIntroduce a PriorityQueue sorting RevCommits by commit timestamp 40/194140/36
Luca Milanesio [Mon, 13 Jun 2022 22:09:55 +0000 (23:09 +0100)]
Introduce a PriorityQueue sorting RevCommits by commit timestamp

The DateRevQueue uses a tailor-made algorithm to keep
RevCommits sorted by reversed commit timestamp, which has a O(n*n/2)
complexity and caused the explosion of the Git fetch times to
tens of seconds.

The standard Java PriorityQueue provides a O(n*log(n)) complexity
and scales much better with the increase of the number of
RevCommits.

Introduce a new implementation DateRevPriorityQueue of the DateRevQueue
based on PriorityQueue.

Enable usage of the new DateRevPriorityQueue implementation by setting
the system property REVWALK_USE_PRIORITY_QUEUE=true. By default the old
implementation DateRevQueue is used.

Benchmark results:
```
(numCommits)  (usePriorityQueue)  Mode  Cnt     Score Error  Units
           5                true  avgt   10    39,4 ±   6,1  ns/op
           5               false  avgt   10    14,1 ±   2,2  ns/op
          10                true  avgt   10    29,7 ±   3,5  ns/op
          10               false  avgt   10    13,2 ±   2,0  ns/op
          50                true  avgt   10    50,4 ±   5,3  ns/op
          50               false  avgt   10    18,6 ±   0,2  ns/op
         100                true  avgt   10    58,3 ±   5,0  ns/op
         100               false  avgt   10    20,5 ±   0,8  ns/op
         500                true  avgt   10    51,7 ±   2,6  ns/op
         500               false  avgt   10    43,3 ±   0,5  ns/op
        1000                true  avgt   10    49,2 ±   2,4  ns/op
        1000               false  avgt   10    62,7 ±   0,2  ns/op
        5000                true  avgt   10    48,8 ±   1,5  ns/op
        5000               false  avgt   10   228,3 ±   0,5  ns/op
       10000                true  avgt   10    44,2 ±   0,9  ns/op
       10000               false  avgt   10   377,6 ±   2,7  ns/op
       50000                true  avgt   10    50,3 ±   1,6  ns/op
       50000               false  avgt   10   637,0 ± 111,8  ns/op
      100000                true  avgt   10    61,8 ±   4,4  ns/op
      100000               false  avgt   10   965,1 ± 268,0  ns/op
      500000                true  avgt   10   127,2 ±   7,9  ns/op
      500000               false  avgt   10  9610,2 ± 184,8  ns/op
```

Memory allocation results:
```
Number of commits loaded: 850 000
Custom implementation: 378 245 120 Bytes
Priority queue implementation: 340 495 616 Bytes
```

Bug: 580137
Change-Id: I8b33df6e9ee88933098ecc81ce32bdb189715041
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
8 months agoRemove org.eclipse.jgit.benchmark/.factorypath 04/1174604/1
Matthias Sohn [Fri, 19 Jan 2024 00:27:07 +0000 (01:27 +0100)]
Remove org.eclipse.jgit.benchmark/.factorypath

it's outdated and seems to be unused.

Change-Id: I4ac0f6d6427ee9f76a59296e991e4e03b25bcf05

8 months agoUpdate jmh to 1.37 for org.eclipse.jgit.benchmark 03/1174603/2
Matthias Sohn [Thu, 18 Jan 2024 12:35:01 +0000 (13:35 +0100)]
Update jmh to 1.37 for org.eclipse.jgit.benchmark

and
- fix org.eclipse.jgit.benchmark/.classpath

Change-Id: I66f81228f17ede5732fa43aa693b4cfddb5a71f6

9 months agoMerge branch 'stable-6.5' into stable-6.6 09/1174309/1
Matthias Sohn [Wed, 10 Jan 2024 22:44:46 +0000 (23:44 +0100)]
Merge branch 'stable-6.5' into stable-6.6

* stable-6.5:
  Checkout: better directory handling

Change-Id: I1712191514b8c1b9ea048974376a6765ff7970c7

9 months agoMerge branch 'stable-6.4' into stable-6.5 08/1174308/1
Matthias Sohn [Wed, 10 Jan 2024 22:44:17 +0000 (23:44 +0100)]
Merge branch 'stable-6.4' into stable-6.5

* stable-6.4:
  Checkout: better directory handling

Change-Id: I68e11fb06a354961f4146de51d326b69be5b69d3

9 months agoMerge branch 'stable-6.3' into stable-6.4 07/1174307/1
Matthias Sohn [Wed, 10 Jan 2024 22:43:50 +0000 (23:43 +0100)]
Merge branch 'stable-6.3' into stable-6.4

* stable-6.3:
  Checkout: better directory handling

Change-Id: Ie0fefa8afc07f638ee05a46d272db7b7b0f8d464

9 months agoMerge branch 'stable-6.2' into stable-6.3 06/1174306/1
Matthias Sohn [Wed, 10 Jan 2024 22:43:17 +0000 (23:43 +0100)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  Checkout: better directory handling

Change-Id: Id27612578f822cabc1a38ad1f8e859ae354045a9

9 months agoMerge branch 'stable-6.1' into stable-6.2 05/1174305/1
Matthias Sohn [Wed, 10 Jan 2024 22:42:47 +0000 (23:42 +0100)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  Checkout: better directory handling

Change-Id: I2f8e5410f4962d38bc6e822b5cda42df68aef32b

9 months agoMerge branch 'stable-6.0' into stable-6.1
Matthias Sohn [Wed, 10 Jan 2024 22:42:07 +0000 (23:42 +0100)]
Merge branch 'stable-6.0' into stable-6.1

* stable-6.0:
  Checkout: better directory handling

Change-Id: Ide9fb318b5fe413d73d73a19943c6dacdcf07f3d

9 months agoMerge branch 'stable-5.13' into stable-6.0 03/1174303/1
Matthias Sohn [Wed, 10 Jan 2024 19:56:19 +0000 (20:56 +0100)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  Checkout: better directory handling

Revert commit 170244d05977491271a1cc234583d2e5ba75145d
"Checkout: better directory handling" which is the downport of the
original fix Ie12864c54c9f901a2ccee7caddec73027f353111 which was done
on stable-6.6. Merging this up to stable-6.6 would be a lot of work and
these branches aren't maintained anymore hence revert this change here.
This way the fix is available on stable-5.13 for those who still need
Java 8 and everybody else should upgrade to 6.6.1 or higher.

Change-Id: Iffe50a5e62c6655814265d9cc6c5c2996baa1a31

9 months agoSilence API warnings 02/1174302/1
Matthias Sohn [Mon, 8 Jan 2024 08:33:59 +0000 (09:33 +0100)]
Silence API warnings

Change-Id: I44084c45ed2c5e642021d1de4f37af769e4b317f

10 months agoMake sure ref to prune is in packed refs 31/1173231/9
Fabio Ponciroli [Wed, 6 Dec 2023 13:38:21 +0000 (14:38 +0100)]
Make sure ref to prune is in packed refs

RefDirectory:pack might raise an NPE when deleting loose
refs as final part of the RefDirectory.pack().

This is what the code does:
1) packed ref update: update the list of refs which will be
persisted in packed-refs
2) persit packed-refs: flush on file the refs computed in #1
3) prune loose refs: prune loose refs that have been packed in #2

The code correctly locks the packed-refs file during phases 1 to 3.
However, it makes the wrong assumption of considering
the loose refs set as immutable between phases 1 and 3.

The number and values of loose refs on the filesystem can mutate
at any time whilst the RefDirectory.pack() is in progress.
Assuming the contrary can lead to an NPE when retrieving refs
from the mutable loose refs list during phase #3.

Make sure that the ref is not null before dereferencing its
object-id value.

Bug: jgit-4
Change-Id: I2cd01f8a880f3c6561ad978a389ec2db45b6018b

11 months agoCheckout: better directory handling 42/204642/6
Thomas Wolf [Fri, 11 Aug 2023 19:40:13 +0000 (21:40 +0200)]
Checkout: better directory handling

This backports the upstream security fix to downstream stable-5.13 branch.
(cherry picked from commit 9072103f3b3cf64dd12ad2949836ab98f62dabf1)

When checking out a file into the working tree ensure that all parent
directories of the file below the working tree root are actually
directories and do exist before we try to create the file.

When multiple files are to be checked out (or even a whole tree), this
may check the same directories over and over again. Asking the file
system every time for file attributes is a potentially expensive
operation. As a remedy, introduce an in-memory cache of directory
states for a particular check-out operation.

Apply the same fix also in the ResolveMerger, which may also check out
files, and also in the PatchApplier. In PatchApplier, also validate
paths.

Change-Id: Ie12864c54c9f901a2ccee7caddec73027f353111
Signed-off-by: Thomas Wolf <twolf@apache.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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 agoPrepare 6.6.2-SNAPSHOT builds 44/204044/1
Matthias Sohn [Sat, 2 Sep 2023 23:57:43 +0000 (01:57 +0200)]
Prepare 6.6.2-SNAPSHOT builds

Change-Id: Id4e2fbefc49115c7e3de26a34cfbe01ba6de25b2

13 months agoJGit v6.6.1.202309021850-r 43/204043/1 v6.6.1.202309021850-r
Matthias Sohn [Sat, 2 Sep 2023 22:50:37 +0000 (00:50 +0200)]
JGit v6.6.1.202309021850-r

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

13 months agoCheckout: better directory handling 42/204042/1
Thomas Wolf [Fri, 11 Aug 2023 19:40:13 +0000 (21:40 +0200)]
Checkout: better directory handling

When checking out a file into the working tree ensure that all parent
directories of the file below the working tree root are actually
directories and do exist before we try to create the file.

When multiple files are to be checked out (or even a whole tree), this
may check the same directories over and over again. Asking the file
system every time for file attributes is a potentially expensive
operation. As a remedy, introduce an in-memory cache of directory
states for a particular check-out operation.

Apply the same fix also in the ResolveMerger, which may also check out
files, and also in the PatchApplier. In PatchApplier, also validate
paths.

Change-Id: Ie12864c54c9f901a2ccee7caddec73027f353111
Signed-off-by: Thomas Wolf <twolf@apache.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
14 months agoMerge branch 'stable-6.5' into stable-6.6 25/203525/2
Matthias Sohn [Thu, 3 Aug 2023 08:14:45 +0000 (10:14 +0200)]
Merge branch 'stable-6.5' into stable-6.6

* stable-6.5:
  Add verification in GcKeepFilesTest that bitmaps are generated
  Express the explicit intention of creating bitmaps in GC
  GC: prune all packfiles after the loosen phase
  Prepare 5.13.3-SNAPSHOT builds
  JGit v5.13.2.202306221912-r

Change-Id: Id2e49252a9dc268210c9439848e77604885371aa

14 months agoUpdate to Tycho 4.0.1 28/203528/1
Matthias Sohn [Thu, 3 Aug 2023 08:12:57 +0000 (10:12 +0200)]
Update to Tycho 4.0.1

Tycho 4.0.0-SNAPSHOT is no longer available and it's a bad practice to
depend on any snapshot version (we had to since this was the only way
to get gpg signing to work in time for releasing 6.6.0).

Change-Id: I1d4af5f69965b4cad50b379fd81f6f442b38c8d0

14 months agoMerge branch 'stable-6.4' into stable-6.5 23/203523/1
Matthias Sohn [Wed, 2 Aug 2023 23:55:12 +0000 (01:55 +0200)]
Merge branch 'stable-6.4' into stable-6.5

* stable-6.4:
  Add verification in GcKeepFilesTest that bitmaps are generated
  Express the explicit intention of creating bitmaps in GC
  GC: prune all packfiles after the loosen phase
  Prepare 5.13.3-SNAPSHOT builds
  JGit v5.13.2.202306221912-r

Change-Id: Idb6dd6160e023673e3650653a15f6b1c540de96e

14 months agoMerge branch 'stable-6.3' into stable-6.4 22/203522/1
Matthias Sohn [Wed, 2 Aug 2023 23:51:36 +0000 (01:51 +0200)]
Merge branch 'stable-6.3' into stable-6.4

* stable-6.3:
  Add verification in GcKeepFilesTest that bitmaps are generated
  Express the explicit intention of creating bitmaps in GC
  GC: prune all packfiles after the loosen phase
  Prepare 5.13.3-SNAPSHOT builds
  JGit v5.13.2.202306221912-r

Change-Id: I0bccc36d9cc9a36f1be9b1562df35ce3a0e95eee

14 months agoMerge branch 'stable-6.2' into stable-6.3 21/203521/1
Matthias Sohn [Wed, 2 Aug 2023 23:37:43 +0000 (01:37 +0200)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  Add verification in GcKeepFilesTest that bitmaps are generated
  Express the explicit intention of creating bitmaps in GC
  GC: prune all packfiles after the loosen phase
  Prepare 5.13.3-SNAPSHOT builds
  JGit v5.13.2.202306221912-r

Change-Id: I589ed444b5cbfc5b073cac91323e2cc97ab98087

14 months agoMerge branch 'stable-6.1' into stable-6.2 20/203520/1
Matthias Sohn [Wed, 2 Aug 2023 23:28:07 +0000 (01:28 +0200)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  Add verification in GcKeepFilesTest that bitmaps are generated
  Express the explicit intention of creating bitmaps in GC
  GC: prune all packfiles after the loosen phase
  Prepare 5.13.3-SNAPSHOT builds
  JGit v5.13.2.202306221912-r

Change-Id: I5b16c3b613a95b7f28c8f6ac0b20c4c593759cea

14 months agoMerge branch 'stable-6.0' into stable-6.1 19/203519/1
Matthias Sohn [Wed, 2 Aug 2023 23:19:21 +0000 (01:19 +0200)]
Merge branch 'stable-6.0' into stable-6.1

* stable-6.0:
  Add verification in GcKeepFilesTest that bitmaps are generated
  Express the explicit intention of creating bitmaps in GC
  GC: prune all packfiles after the loosen phase
  Prepare 5.13.3-SNAPSHOT builds
  JGit v5.13.2.202306221912-r

Change-Id: Ib08037f6055dac1776e38cfb4ff8c88a50ad3e60

14 months agoMerge branch 'stable-5.13' into stable-6.0 18/203518/1
Matthias Sohn [Wed, 2 Aug 2023 23:17:17 +0000 (01:17 +0200)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  Add verification in GcKeepFilesTest that bitmaps are generated
  Express the explicit intention of creating bitmaps in GC
  GC: prune all packfiles after the loosen phase
  Prepare 5.13.3-SNAPSHOT builds
  JGit v5.13.2.202306221912-r

Change-Id: I1f50995d9d9c592ec0e02a04e0e409440b49f9f3

15 months agoAdd verification in GcKeepFilesTest that bitmaps are generated 09/202509/2
Luca Milanesio [Sat, 10 Jun 2023 00:20:44 +0000 (01:20 +0100)]
Add verification in GcKeepFilesTest that bitmaps are generated

The packfiles with the .keep extensions are meant to prevent
a packfile from being processed or removed during GC.
From the point of view of the GC process then, the associated
packfile should be completely transparent:
- it should not included in the repacked file
- it should not pruned
- its objects should be left untouched, even if unreachable
- the GC process, including the bitmap generation should continue
  as usual, as the the packfiles with .keep file did not exist

Add one explicit test for making sure that the management
of .keep file is also transparent to the generation of bitmaps,
which are still generated if a .keep file exists.

Bug: 582039
Change-Id: I14f6adc3f961c606fbc617e51ea6ed6e2ef8604f

15 months agoExpress the explicit intention of creating bitmaps in GC 08/202508/2
Luca Milanesio [Sat, 10 Jun 2023 01:21:07 +0000 (02:21 +0100)]
Express the explicit intention of creating bitmaps in GC

Add an explicit flag to PackWriter for allowing the
GC.repack() phase to explicitly generate bitmaps only for the
heads packfile and not for the others.

Previously the bitmap generation was conditioned to the
presence of object ids exclusion from the PackWriter.

The introduction of the bitmap generation in the PackWriter
done in Icdb0cdd66 has accidentally made the .keep files not
completely transparent, because their presence have disabled
the generation of the bitmap index, even if the generation
of bitmaps is enabled.

This bug has been an accidental consequence of the intention
of the bitmap generator to avoid generating bitmaps for the
non-heads packfile, however the implementation done by Colby
decided to use the excludeInPacks variable (see [1]) which
is unfortunately also used for excluding the packfiles having
an associated .keep file (see [2]).

[1] https://git.eclipse.org/r/c/jgit/jgit/+/7940/18/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java#1617
[2] https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/dafcb8f6db82b899c917832768f1c240d273190c/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/GC.java#506

Bug: 582039
Change-Id: Id722e68d9ff4ac24e73bf765ab11017586b6766e

15 months agoGC: prune all packfiles after the loosen phase 10/202510/2
Luca Milanesio [Sun, 11 Jun 2023 16:24:29 +0000 (17:24 +0100)]
GC: prune all packfiles after the loosen phase

When loosening the objects inside the packfiles to be pruned, make sure
that the packfile list is stable and prune all the files after the
loosening is done.

This prevents a series of exceptions previously thrown when loosening
the packfiles, due to the too early pruning of the packfiles that were
still in the pack list.

Bug: 581532
Change-Id: I776776e2e083f1fa749d53f965bf50f919823b4f

15 months agoPrepare 5.13.3-SNAPSHOT builds 58/202658/1
Matthias Sohn [Thu, 22 Jun 2023 00:15:21 +0000 (02:15 +0200)]
Prepare 5.13.3-SNAPSHOT builds

Change-Id: I02b9388c8bc1c266bb29b4502504d137dd42142f

15 months agoJGit v5.13.2.202306221912-r 57/202657/1 v5.13.2.202306221912-r
Matthias Sohn [Wed, 21 Jun 2023 23:12:05 +0000 (01:12 +0200)]
JGit v5.13.2.202306221912-r

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

16 months agoUpdate Orbit to R20230531010532 for 2023-06 29/202429/1
Matthias Sohn [Fri, 9 Jun 2023 08:52:45 +0000 (10:52 +0200)]
Update Orbit to R20230531010532 for 2023-06

Change-Id: I844efc4bec153931f0a7b3c694bade4f5b166295

16 months agoMerge "Merge branch 'stable-6.5' into stable-6.6" into stable-6.6
Matthias Sohn [Thu, 8 Jun 2023 20:36:55 +0000 (16:36 -0400)]
Merge "Merge branch 'stable-6.5' into stable-6.6" into stable-6.6

16 months agoMerge branch 'stable-6.5' into stable-6.6 22/202422/1
Luca Milanesio [Wed, 7 Jun 2023 23:28:15 +0000 (00:28 +0100)]
Merge branch 'stable-6.5' into stable-6.6

* stable-6.5:
  Revert "RefDirectory: Throw exception if CAS of packed ref list fails"

Change-Id: Ia2f6f41f27ab430c31871a2cf2cd99dfcbfd9b61
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
16 months agoMerge branch 'stable-6.4' into stable-6.5 21/202421/1
Luca Milanesio [Wed, 7 Jun 2023 23:27:42 +0000 (00:27 +0100)]
Merge branch 'stable-6.4' into stable-6.5

* stable-6.4:
  Revert "RefDirectory: Throw exception if CAS of packed ref list fails"

Change-Id: I7d922a92b7674723cbf6a93fb7c9bc5c0cdb8206
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
16 months agoMerge branch 'stable-6.3' into stable-6.4 20/202420/1
Luca Milanesio [Wed, 7 Jun 2023 23:26:54 +0000 (00:26 +0100)]
Merge branch 'stable-6.3' into stable-6.4

* stable-6.3:
  Revert "RefDirectory: Throw exception if CAS of packed ref list fails"

Change-Id: I33049e70595f097a66e8f4a63b3d8d1c147e878e
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
16 months agoMerge branch 'stable-6.2' into stable-6.3 99/202299/1
Luca Milanesio [Wed, 7 Jun 2023 23:26:00 +0000 (00:26 +0100)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  Revert "RefDirectory: Throw exception if CAS of packed ref list fails"

Change-Id: I70db1bc8529eb6a66610946946da5447a578bffa
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
16 months agoMerge branch 'stable-6.1' into stable-6.2 98/202298/1
Luca Milanesio [Wed, 7 Jun 2023 23:25:07 +0000 (00:25 +0100)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  Revert "RefDirectory: Throw exception if CAS of packed ref list fails"

Change-Id: I1a98e293ef10917b2d8ad64e88be9e82c7bcf693
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
16 months agoMerge branch 'stable-6.0' into stable-6.1 97/202297/1
Luca Milanesio [Wed, 7 Jun 2023 23:23:54 +0000 (00:23 +0100)]
Merge branch 'stable-6.0' into stable-6.1

* stable-6.0:
  Revert "RefDirectory: Throw exception if CAS of packed ref list fails"

Change-Id: Idc0d1f8ab4524868b7e9754799f70acc1d24f2cb
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
16 months agoMerge branch 'stable-5.13' into stable-6.0 96/202296/1
Luca Milanesio [Wed, 7 Jun 2023 23:21:07 +0000 (00:21 +0100)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  Revert "RefDirectory: Throw exception if CAS of packed ref list fails"

Change-Id: I883b21b00317cc6d9951a8a5f9505078ddd2a3a7
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
16 months agoRevert "RefDirectory: Throw exception if CAS of packed ref list fails" 92/201992/2
Martin Fick [Wed, 8 Mar 2023 15:34:38 +0000 (08:34 -0700)]
Revert "RefDirectory: Throw exception if CAS of packed ref list fails"

This reverts commit 9c33f7364d41956240818ba12d8b79d5ea846162.

Reason for revert: This change was based on the false claim that the
packedrefs file lock is held while the CAS is being done, but it is
actually released before the CAS (the in memory lock is still held,
however that does not prevent external actors from updating the
packedrefs files and then another thread from subsequently re-reading it
and updating the in memory packedRefList). Although reverting this
change can cause the CAS to fail, it should not actually matter since
the failure would indicate that another thread has already updated the
in memory packedRefList to either the same version this thread was
trying to update it too, or to a more recent version. Either way,
failing the CAS is then appropriate and should not be problematic.

Although this change reverts the code in the RefDirectory class, it
keeps the "improvements" to the test so that it continues to pass
reliably. The reason for the quotes around the word "improvements" is
because I believe the test alteration actually dramatically changes the
intent of the test, and that the original intent of the test is
untestable with the GC and RefDirectory classes as is.

Bug: 582044
Change-Id: I3acee7527bb542996dcdfaddfb2bdb45ec444db5
Signed-off-by: Martin Fick <quic_mfick@quicinc.com>
(cherry picked from commit c5617711a1b4d5d0807cc7eed702b78d114d46b3)

16 months agoBazel: Fix remote build execution for Java 17 05/202105/4
David Ostrovsky [Thu, 25 May 2023 06:49:44 +0000 (08:49 +0200)]
Bazel: Fix remote build execution for Java 17

Bazel build and test with remote17 configuration was actually executed
locally, and not remotely.

Rename remote configuration setting for Java 11 from remote to remote11
and derive the common remote configuration settings for remote11 and
remote17 configurations.

Also remove deprecated --host_javabase and --javabase options.

Test Plan:

Verify that the remote build for Java 17 is actually executed remotely:

  $ bazel test --config=remote17 --remote_instance_name=$PROJECT_NAME \
    org.eclipse.jgit.test/...

Change-Id: I10ad8c1d28c92fed9e465c2d36770ed4fb2940c3

16 months agoBump bazel vesion to 6.2.0 89/201989/1
David Ostrovsky [Thu, 25 May 2023 06:19:06 +0000 (08:19 +0200)]
Bump bazel vesion to 6.2.0

Also demote severity level for bug pattern: PreferredInterfaceType, aka
MutableConstantField: [1] from error to warning.

Also fix DoubleBraceInitialization error prone bug pattern [2].

[1] https://errorprone.info/bugpattern/PreferredInterfaceType
[2] https://errorprone.info/bugpattern/DoubleBraceInitialization

Change-Id: I04b7d0792e67cbc51e3939bd47c2ea13a685cf0d
(cherry picked from commit 0f071a7bcee1f551652b2ae017f3e0e134c7eb74)

16 months agoPrepare 6.6.1-SNAPSHOT builds 11/202211/1
Matthias Sohn [Tue, 30 May 2023 15:24:58 +0000 (17:24 +0200)]
Prepare 6.6.1-SNAPSHOT builds

Change-Id: I0036999e2be076d4ad8231410faeff51bf9cbf52

16 months agoJGit v6.6.0.202305301015-r 09/202209/1 v6.6.0.202305301015-r
Matthias Sohn [Tue, 30 May 2023 14:11:53 +0000 (16:11 +0200)]
JGit v6.6.0.202305301015-r

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

16 months agoUpdate to Orbit S20230516204213 72/202072/1
Matthias Sohn [Wed, 24 May 2023 16:22:27 +0000 (18:22 +0200)]
Update to Orbit S20230516204213

Change-Id: I4daae47b8d2e244b78dff5ca072e41153e7e6734

16 months agoPrepare 6.6.0-SNAPSHOT builds 71/202071/1
Matthias Sohn [Wed, 24 May 2023 16:23:45 +0000 (18:23 +0200)]
Prepare 6.6.0-SNAPSHOT builds

Change-Id: If0e4e8ce5f3e2f5170f313fb9b26b4ec0e34dab9

16 months agoJGit v6.6.0.202305241045-m3 67/202067/1 v6.6.0.202305241045-m3
Matthias Sohn [Wed, 24 May 2023 14:46:23 +0000 (16:46 +0200)]
JGit v6.6.0.202305241045-m3

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

16 months agoMerge branch 'master' into stable-6.6 45/202045/1
Matthias Sohn [Wed, 24 May 2023 13:50:27 +0000 (15:50 +0200)]
Merge branch 'master' into stable-6.6

* master:
  GraphObjectIndex: fix search in findGraphPosition
  Update to Tycho 4.0.0-SNAPSHOT
  PGP sign p2 artefacts
  Revert 'Use net.i2p.crypto:eddsa directly from Maven Central'
  Update dash license-tool-plugin to 1.0.2
  Also add suppressed exception if unchecked exception occurs in finally
  Candidate: use "Objects.equals" instead of "=="
  Use hamcrest 2.2 directly from Maven Central
  Use commons-logging directly from Maven Central
  Update jna to 5.13.0
  Use bytebuddy directly from Maven Central
  Use jna directly from Maven Central
  Use net.i2p.crypto:eddsa directly from Maven Central
  Use org.tukaani:xz directly from Maven Central
  Use args4j directly from Maven Central
  Use gson directly from Maven Central
  Remove unused $NON-NLS-1$
  Remove unused API filters
  Switch to Apache MINA sshd 2.10.0
  [releng] API filter for PackIndex.DEFAULT_WRITE_REVERSE_INDEX
  PackExt: add a #getTmpExtension method
  UploadPack: Record negotiation stats on fetchV2 call
  RewriteGeneratorTest: Introduce test cases for the RewriteGenerator
  PackWriter: write the PackReverseIndex file

Change-Id: I6c7760a32545320862abcdcc8761c9b728e78182

16 months agoMerge changes Ib0f18147,I2a9308c0,Ica15a5dd
Matthias Sohn [Tue, 23 May 2023 23:25:05 +0000 (19:25 -0400)]
Merge changes Ib0f18147,I2a9308c0,Ica15a5dd

* changes:
  Update to Tycho 4.0.0-SNAPSHOT
  PGP sign p2 artefacts
  Revert 'Use net.i2p.crypto:eddsa directly from Maven Central'

16 months agoMerge "GraphObjectIndex: fix search in findGraphPosition"
Jonathan Tan [Tue, 23 May 2023 22:26:47 +0000 (18:26 -0400)]
Merge "GraphObjectIndex: fix search in findGraphPosition"

16 months agoGraphObjectIndex: fix search in findGraphPosition 50/201850/5
Jonathan Tan [Mon, 8 May 2023 20:55:40 +0000 (13:55 -0700)]
GraphObjectIndex: fix search in findGraphPosition

In findGraphPosition, when there is no object whose OID starts with
the first byte of the sought OID, low equals high. This violates an
invariant of the loop, and when the sought OID is lexicographically
greater than every other OID in the repository, causes an
ArrayIndexOutOfBoundsException (because we're trying to read outside the
list of OIDs).

Therefore, check the "low < high" condition at the start of the loop,
not only after the first iteration.

Change-Id: Ic8ac198c151bd161c4996b9e7cb6e6660f151733
Helped-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
16 months agoUpdate to Tycho 4.0.0-SNAPSHOT 73/201773/10
Matthias Sohn [Tue, 9 May 2023 07:44:03 +0000 (09:44 +0200)]
Update to Tycho 4.0.0-SNAPSHOT

We need to update to Tycho in order to force PGP signing of the
bouncycastle libraries which isn't supported by earlier Tycho versions.
For that we need to run Maven on Java 17 or higher.

In order to run tests on Java 11 add a `toolchain.xml` file into the
`~/.m2` directory providing the path to Java installations:

<?xml version='1.0' encoding='UTF-8'?>
<toolchains>
  <toolchain>
    <type>jdk</type>
    <provides>
      <id>JavaSE-11</id>
      <version>11</version>
    </provides>
    <configuration>
      <jdkHome>/path/to/java-11</jdkHome>
    </configuration>
  </toolchain>
  <toolchain>
    <type>jdk</type>
    <provides>
      <id>JavaSE-17</id>
      <version>17</version>
    </provides>
    <configuration>
      <jdkHome>/path/to/java-17</jdkHome>
    </configuration>
  </toolchain>
</toolchains>

Change-Id: Ib0f18147826e5b4a7fa1f41590772516269de702

16 months agoPGP sign p2 artefacts 96/201696/13
Matthias Sohn [Wed, 3 May 2023 12:39:17 +0000 (14:39 +0200)]
PGP sign p2 artefacts

This ensures bundles directly pulled from Maven Central are PGP signed
by Tycho.

See https://docs.google.com/document/d/1MnDBvOUwKvKacB-QKnH_PzK88dUlHkjs-D-DWEKmvkY

Change-Id: I2a9308c091e602d40a1c143edb506a3e43dd0dc2

16 months agoRevert 'Use net.i2p.crypto:eddsa directly from Maven Central' 26/202026/1
Thomas Wolf [Tue, 23 May 2023 17:45:12 +0000 (19:45 +0200)]
Revert 'Use net.i2p.crypto:eddsa directly from Maven Central'

This reverts commit 7e094c6cf32d6b6c2e49c72d506149427e97c5ab.

Reason: the maven artifact has a broken MANIFEST.MF with a mandatory
dependency to sun.security.x509, which is an internal package in the
JDK and moreover not needed by the bundle except for one test class
that isn't in the bundle at all.

This extra dependency makes the JGit tycho packaging build fail when
Tycho 4 is used.

We must keep using the Orbit re-packaging of this artifact, which does
not have this unnecessary mandatory dependency.

Change-Id: Ica15a5ddcada09686de3055b2b3daf081e3c5ffc
Signed-off-by: Thomas Wolf <twolf@apache.org>
16 months agoUpdate dash license-tool-plugin to 1.0.2 59/201959/2
Matthias Sohn [Fri, 19 May 2023 22:10:54 +0000 (00:10 +0200)]
Update dash license-tool-plugin to 1.0.2

Change-Id: I9708d918f4610503d7a16f55cea3aa3931dcd2cc

16 months agoMerge "Also add suppressed exception if unchecked exception occurs in finally"
Matthias Sohn [Fri, 19 May 2023 17:49:42 +0000 (13:49 -0400)]
Merge "Also add suppressed exception if unchecked exception occurs in finally"

16 months agoAlso add suppressed exception if unchecked exception occurs in finally 49/201949/2
Matthias Sohn [Thu, 18 May 2023 10:02:48 +0000 (12:02 +0200)]
Also add suppressed exception if unchecked exception occurs in finally

If a method called in a finally block throws an exception we should add
exceptions caught earlier to the exception we throw in the finally block
not regarding if it's a checked or unchecked exception.

Change-Id: I4c6be9a3a08482b07659ca31d6987ce719d81ca5

17 months agoCandidate: use "Objects.equals" instead of "==" 36/191736/7
Fabio Ponciroli [Thu, 10 Mar 2022 17:32:53 +0000 (18:32 +0100)]
Candidate: use "Objects.equals" instead of "=="

Errorprone raises the following warning:
"[ReferenceEquality] Comparison using reference equality
instead of value equality".

Change-Id: Iacb207ef0625bb987a08406d4e7461e48fade97f

17 months agoUse hamcrest 2.2 directly from Maven Central 93/201893/3
Matthias Sohn [Tue, 16 May 2023 00:06:10 +0000 (02:06 +0200)]
Use hamcrest 2.2 directly from Maven Central

Change-Id: I4039b56b1cdc54ff1886c2a4973d857d785989c2

17 months agoUse commons-logging directly from Maven Central 92/201892/3
Matthias Sohn [Tue, 16 May 2023 00:01:14 +0000 (02:01 +0200)]
Use commons-logging directly from Maven Central

Change-Id: I08e51450f70f941761539d3f08dd65c5d706dcdc

17 months agoUpdate jna to 5.13.0 91/201891/3
Matthias Sohn [Mon, 15 May 2023 22:38:52 +0000 (00:38 +0200)]
Update jna to 5.13.0

Change-Id: I87d65e66e1cac64ccb744632ea45d06f8b8637fe

17 months agoUse bytebuddy directly from Maven Central 05/201905/1
Matthias Sohn [Wed, 17 May 2023 20:22:32 +0000 (22:22 +0200)]
Use bytebuddy directly from Maven Central

Change-Id: I5e24a31b78ef3758e1ce84e3b0eacaff1608fcd9

17 months agoUse jna directly from Maven Central 90/201890/3
Matthias Sohn [Mon, 15 May 2023 22:18:45 +0000 (00:18 +0200)]
Use jna directly from Maven Central

Change-Id: I3c2576648748a6c6020c13a604cf5fcd4864aeb8

17 months agoUse net.i2p.crypto:eddsa directly from Maven Central 89/201889/2
Matthias Sohn [Mon, 15 May 2023 22:07:10 +0000 (00:07 +0200)]
Use net.i2p.crypto:eddsa directly from Maven Central

Change-Id: I8e864380fa5eb3006943b78b19f6cbe7ae9f8111

17 months agoUse org.tukaani:xz directly from Maven Central 88/201888/2
Matthias Sohn [Mon, 15 May 2023 22:03:28 +0000 (00:03 +0200)]
Use org.tukaani:xz directly from Maven Central

Change-Id: I4ab835cee694778eedaa125cc372be8b6c876133

17 months agoUse args4j directly from Maven Central 87/201887/2
Matthias Sohn [Mon, 15 May 2023 21:58:25 +0000 (23:58 +0200)]
Use args4j directly from Maven Central

Change-Id: I91c7c42c1fc779278fe30294638edef182e88347

17 months agoUse gson directly from Maven Central 46/201846/2
Matthias Sohn [Mon, 15 May 2023 21:40:17 +0000 (23:40 +0200)]
Use gson directly from Maven Central

Change-Id: I4741f733aa7ca219296ed788d4dc93df77cc65ff

17 months agoRemove unused $NON-NLS-1$ 44/201844/2
Matthias Sohn [Mon, 15 May 2023 21:01:03 +0000 (23:01 +0200)]
Remove unused $NON-NLS-1$

Change-Id: I3314e5106d873c03903562f9798de6af2ae588a7

17 months agoRemove unused API filters 43/201843/2
Matthias Sohn [Mon, 15 May 2023 20:59:55 +0000 (22:59 +0200)]
Remove unused API filters

Change-Id: I1971b31753fd4c3568016e7db955cce8e391a1e0

17 months agoSwitch to Apache MINA sshd 2.10.0 79/201879/3
Thomas Wolf [Mon, 3 Apr 2023 17:33:24 +0000 (19:33 +0200)]
Switch to Apache MINA sshd 2.10.0

Bump the version numbers in pom.xml and in MANIFESTs, and in the bazel
WORKSPACE file. Update the target platforms. Remove work-arounds in
org.eclipse.jgit.ssh.apache that are no longer necessary.

The release notes for Apache MINA sshd are at [1].

[1] https://github.com/apache/mina-sshd/blob/master/docs/changes/2.10.0.md

Bug: 581770
Change-Id: Id27e73e9712b7865353c9b32b5b768f6e998b05e
Signed-off-by: Thomas Wolf <twolf@apache.org>
17 months ago[releng] API filter for PackIndex.DEFAULT_WRITE_REVERSE_INDEX 78/201878/1
Thomas Wolf [Mon, 15 May 2023 18:35:59 +0000 (20:35 +0200)]
[releng] API filter for PackIndex.DEFAULT_WRITE_REVERSE_INDEX

New static final constant is a (very minor) API break that needs to be
suppressed explicitly despite @since 6.6.

Remove a number of no longer needed API filters, and fix a broken
$NON-NLS-1$.

Change-Id: Ie4b0c45e8bd1f3067b6ff81c07d4b21b50bb8685
Signed-off-by: Thomas Wolf <twolf@apache.org>
17 months agoMerge "UploadPack: Record negotiation stats on fetchV2 call"
Ivan Frade [Thu, 11 May 2023 20:53:12 +0000 (16:53 -0400)]
Merge "UploadPack: Record negotiation stats on fetchV2 call"

17 months agoPackExt: add a #getTmpExtension method 07/201807/2
Anna Papitto [Tue, 9 May 2023 17:27:52 +0000 (10:27 -0700)]
PackExt: add a #getTmpExtension method

During garbage collection, extensions for temporary files for indices
are formatted manually.

Add a method to PackExt to generate the temporary file extensions for
each type of index file programmatically.

Change-Id: I210bc2702e750bf0aea643b1a9a8536adebef179
Signed-off-by: Anna Papitto <annapapitto@google.com>
17 months agoUploadPack: Record negotiation stats on fetchV2 call 55/201855/8
Ronald Bhuleskar [Wed, 10 May 2023 23:29:53 +0000 (16:29 -0700)]
UploadPack: Record negotiation stats on fetchV2 call

ServiceV2 is not collecting wants/have in PackStatistics. This records
the stats for fetch and push-negotiation.

Change-Id: Iefd79f36b3d7837195e8bd9fc7007de352089e66

17 months agoRewriteGeneratorTest: Introduce test cases for the RewriteGenerator 87/201587/7
Simon Sohrt [Fri, 28 Apr 2023 11:45:15 +0000 (13:45 +0200)]
RewriteGeneratorTest: Introduce test cases for the RewriteGenerator

Bug: 577948
Signed-off-by: Simon Sohrt <sohrt@his.de>
Change-Id: I5af1a43d49379e2417611eaacdd5f06be8147bc4

17 months agoMerge "PackWriter: write the PackReverseIndex file"
Ivan Frade [Mon, 8 May 2023 19:00:46 +0000 (15:00 -0400)]
Merge "PackWriter: write the PackReverseIndex file"

17 months agoPackWriter: write the PackReverseIndex file 83/197583/33
Anna Papitto [Tue, 2 May 2023 20:45:05 +0000 (13:45 -0700)]
PackWriter: write the PackReverseIndex file

PackWriter offers the ability to write out the pack file and its various
index files, except for the newly introduced file-based reverse index.

Now that PackReverseIndexWriter can write reverse index files,
PackWriter#writeReverseIndex will write one for a pack if the
corresponding config flag PackConfig#writeReverseIndex is on.

Change-Id: Ib75dd2bbfb9ee9366d5aacb46700d8cf8af4823a
Signed-off-by: Anna Papitto <annapapitto@google.com>
17 months agoPrepare 6.6.0-SNAPSHOT builds 18/201718/1
Matthias Sohn [Thu, 4 May 2023 08:53:01 +0000 (10:53 +0200)]
Prepare 6.6.0-SNAPSHOT builds

Change-Id: Id2414c9f30d159c4f65a3c267373f7417c8ca65a

17 months agoJGit v6.6.0.202305031100-m2 01/201701/1 v6.6.0.202305031100-m2
Matthias Sohn [Wed, 3 May 2023 15:59:22 +0000 (17:59 +0200)]
JGit v6.6.0.202305031100-m2

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

17 months agoMerge "Fix inProcessPackedRefsLock not shared with copies of the instance"
Matthias Sohn [Wed, 3 May 2023 15:10:14 +0000 (11:10 -0400)]
Merge "Fix inProcessPackedRefsLock not shared with copies of the instance"

17 months agoUpdate Maven plugins 84/201684/3
Matthias Sohn [Wed, 3 May 2023 01:01:03 +0000 (03:01 +0200)]
Update Maven plugins

- com.github.siom79.japicmp:japicmp-maven-plugin to 0.17.2
- com.github.spotbugs:spotbugs-maven-plugin to 4.7.3.4
- maven-clean-plugin to 3.2.0
- maven-compiler-plugin to 3.11.0
- maven-deploy-plugin to 3.1.1
- maven-enforcer-plugin to 3.3.0
- maven-javadoc-plugin to 3.5.0
- maven-project-info-reports-plugin to 3.4.3
- maven-resources-plugin to 3.3.1
- maven-surefire-plugin to 3.0.0
- maven-surefire-report-plugin to 3.0.0
- org.codehaus.mojo:build-helper-maven-plugin to 3.3.0
- org.jacoco:jacoco-maven-plugin to 0.8.10
- org.springframework.boot:spring-boot-maven-plugin to 2.7.11

Change-Id: I42f3a09362a3b1afef65981cd3a862780f592af2

17 months agoAdd TransportHttp#getAdditionalHeaders 56/201656/2
Matthias Sohn [Tue, 2 May 2023 11:31:30 +0000 (13:31 +0200)]
Add TransportHttp#getAdditionalHeaders

to enable inspecting which additional HTTP headers have been set on the
transport.

Change-Id: I0771be9cb7c837de7c203b7f044109b9b2a7d7ad

17 months agoAdd 4.27 (2023-03) and 4.28 (2023-06) target platforms 44/201644/3
Matthias Sohn [Mon, 1 May 2023 21:55:38 +0000 (23:55 +0200)]
Add 4.27 (2023-03) and 4.28 (2023-06) target platforms

Change-Id: I81cfba607e000a107348006785ff374db960ea6d

17 months agoFix inProcessPackedRefsLock not shared with copies of the instance 82/201682/2
Nasser Grainawi [Tue, 2 May 2023 22:30:44 +0000 (16:30 -0600)]
Fix inProcessPackedRefsLock not shared with copies of the instance

The in process lock is intended to manage contention on locking the
packed-refs file within a single process without acquiring the file
system lock. Not sharing it across RefDirectory instances of the same
repository undermines that intent and results in more contention at the
file system level.

Change-Id: I68f11856aa0b4b1524f43554d7391a322a0a6897
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
17 months agoUpdate slf4j to 1.7.36 and consume it directly from Maven Central 43/201643/2
Matthias Sohn [Mon, 1 May 2023 21:33:00 +0000 (23:33 +0200)]
Update slf4j to 1.7.36 and consume it directly from Maven Central

BundleSymbolicNames changed to the names used upstream:
- slf4j.api
- slf4j.simple

Change-Id: Ibcaafae282d3a6fa013bc39d879def1b66073bca

17 months agoUpdate assertj-core to 3.24.2 42/201642/1
Matthias Sohn [Mon, 1 May 2023 15:32:28 +0000 (17:32 +0200)]
Update assertj-core to 3.24.2

and consume it directly from Maven Central.

Add the bundle to the jgit p2 repository.

Change-Id: I95f07a6d3ea645c4f56350d4b0facbaa84988440

17 months agoUpdate plexus-compiler to 2.13.0 38/201638/1
Matthias Sohn [Mon, 1 May 2023 15:01:35 +0000 (17:01 +0200)]
Update plexus-compiler to 2.13.0

Change-Id: I2e0665a5b5b41f501ab617220678d3a93fa43718