]> source.dussan.org Git - jgit.git/log
jgit.git
5 months agoCommitGraphWriter: Move path diff calculation to its own class 64/1195564/3
Ivan Frade [Fri, 31 May 2024 19:12:57 +0000 (12:12 -0700)]
CommitGraphWriter: Move path diff calculation to its own class

To verify that we have the right paths between commits we are writing
the bloom filters, reading them and querying. The path diff
calculation is tricky enough for correctness and performance that
should be tested on its own.

Move the path diff calculation to its own class, so we can test it on
its own.

This is a noop refactor so we can verify later the steps taken in the
walk.

Change-Id: Ifbdcb752891c4adb08553802f87287de1155bb7c

5 months agoRepoCommand: Copy manifest upstream into .gitmodules ref field 29/1195529/2
Ivan Frade [Thu, 30 May 2024 21:04:56 +0000 (14:04 -0700)]
RepoCommand: Copy manifest upstream into .gitmodules ref field

Project entries in the manifest with a specific sha1 as revision can
use the "upstream" field to report the ref pointing to that sha1. This
information is very valuable for downstream tools, as they can limit
their search for a blob to the relevant ref, but it gets lost in the
translation to .gitmodules.

Save the value of the upstream field when available/relevant in the
ref field of the .gitmodules entry.

Change-Id: I14a2395925618d5e6b34be85466e32f5ef8fbf6e

5 months agoRepoProject: read the "upstream" attribute of a project 28/1195528/2
Ivan Frade [Thu, 30 May 2024 17:56:20 +0000 (10:56 -0700)]
RepoProject: read the "upstream" attribute of a project

The manifest spec [1] defines the "upstream" attribute: "name of the
git ref in which a sha1 can be found", when the revision is a
sha1. The parser is ignoring it, but RepoCommand could use it to
populate the "ref=" field of pinned submodules.

Parse the value and store it in the RepoProject.

RepoProject is public API and the current constructors are not
telescopic, so we cannot just add a new constructor with an extra
argument. Use plain getter/setters.j

[1] https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.md#Element-project

Change-Id: Ia50b85b95bfd3710f9fbda2050be5950dd686941

5 months agoPatchApplier.Result.Error: mark fields final 14/1195314/6
Matthias Sohn [Mon, 27 May 2024 16:22:29 +0000 (18:22 +0200)]
PatchApplier.Result.Error: mark fields final

Fields of an Error instance shouldn't be modifiable after its creation.
Adapt tests which were setting hh to null to skip asserting it.

Change-Id: I0f55c1d5cd529aa510029054e6f05bd2637d1bca

5 months agoUpdate tycho to 4.0.8 23/1195323/1
Matthias Sohn [Mon, 27 May 2024 21:02:28 +0000 (23:02 +0200)]
Update tycho to 4.0.8

Change-Id: Idc4c95e643ea46c2b2e33f9a60b0477185429588

5 months agoUpdate to org.assertj:assertj-core:3.26.0 09/1195309/2
Ed Merks [Mon, 27 May 2024 15:49:07 +0000 (17:49 +0200)]
Update to org.assertj:assertj-core:3.26.0

Change-Id: I3f0131cd168ba9c814341416198f955a6d5b340f

5 months agoPatchApplier: Set a boolean on the result if conflict markers were added 05/1195305/4
Patrick Hiesel [Mon, 27 May 2024 14:11:40 +0000 (16:11 +0200)]
PatchApplier: Set a boolean on the result if conflict markers were added

This will let callers show a different error message or mark the
state as conflicting.

Change-Id: Id8eea614b6b8d54c62b49ffbac90599e6f4c5efa

5 months agoPatchApplier: Add test for conflict markers on a deleted file 91/1195291/2
Patrick Hiesel [Mon, 27 May 2024 08:16:34 +0000 (10:16 +0200)]
PatchApplier: Add test for conflict markers on a deleted file

For deleted files, we want to keep erroring out even if conflicts
are allowed for the apply patch logic. The resulting file would
otherwise only consist of the patch.

Change-Id: I18defa627ad2223a3a917d2b0ee4189396732533

5 months agoUpdate org.apache.commons:commons-compress to 1.26.2 82/1195182/2
Ed Merks [Fri, 24 May 2024 15:41:55 +0000 (17:41 +0200)]
Update org.apache.commons:commons-compress to 1.26.2

commons-compress 1.26.0 added commons-lang3 as a transitive dependency.
Hence add it to the target platform, p2 repository and bazel build.

Change-Id: Iac5ca095d3e93176e21364a66a29c5e533168e16

5 months agoMerge changes I075ae7fa,I5fb12281,I420f2408,I71d1fb6c,I9013309b, ...
Matthias Sohn [Sat, 25 May 2024 21:06:04 +0000 (21:06 +0000)]
Merge changes I075ae7fa,I5fb12281,I420f2408,I71d1fb6c,I9013309b, ...

* changes:
  Update spring-boot-maven-plugin to 2.7.18
  Update jacoco-maven-plugin to 0.8.12
  Update maven-source-plugin to 3.3.1
  Update maven-shade-plugin to 3.5.3
  Update  maven-pmd-plugin to 3.22.0
  Update cyclonedx-maven-plugin to 2.8.0
  Update build-helper-maven-plugin to 3.6.0
  Update maven-site-plugin to 4.0.0-M14
  Update maven-jar-plugin to 3.4.1
  Update maven-install-plugin to 3.1.2
  Update maven-deploy-plugin to 3.1.2
  Update maven-artifact-plugin to 3.5.1
  Update tycho to 4.0.7 and set minimum maven version to 3.9.0
  Update git-commit-id-maven-plugin to 8.0.2

5 months agoRemove version override of commons-codec 37/1195237/1
Thomas Wolf [Sat, 25 May 2024 15:03:34 +0000 (17:03 +0200)]
Remove version override of commons-codec

Since commit 8164155b the commons-codec version is pinned in the parent
POM's dependency management. Remove the version specification in
org.eclipse.jgit/pom.xml.

Also give the package-import in the MANIFEST.MF an upper bound.

Change-Id: I2785a87cf77d6df110f57a0cb939dbc9772b8ee6
Signed-off-by: Thomas Wolf <twolf@apache.org>
5 months agoUpdate spring-boot-maven-plugin to 2.7.18 47/1195147/2
Matthias Sohn [Thu, 23 May 2024 22:30:02 +0000 (00:30 +0200)]
Update spring-boot-maven-plugin to 2.7.18

Change-Id: I075ae7fa40e6c883897c8a7ec5ce422b4e808ef6

5 months agoUpdate jacoco-maven-plugin to 0.8.12 46/1195146/2
Matthias Sohn [Thu, 23 May 2024 22:27:11 +0000 (00:27 +0200)]
Update jacoco-maven-plugin to 0.8.12

Change-Id: I5fb1228199159c82d426dcb22aabd39411f381c7

5 months agoUpdate maven-source-plugin to 3.3.1 45/1195145/2
Matthias Sohn [Thu, 23 May 2024 22:25:55 +0000 (00:25 +0200)]
Update maven-source-plugin to 3.3.1

Change-Id: I420f24086948b28328f7120c1b22f4de33da0e78

5 months agoUpdate maven-shade-plugin to 3.5.3 44/1195144/2
Matthias Sohn [Thu, 23 May 2024 22:25:12 +0000 (00:25 +0200)]
Update maven-shade-plugin to 3.5.3

Change-Id: I71d1fb6c6e7ce8ab121e77ffbc05b14fd47879f1

5 months agoUpdate maven-pmd-plugin to 3.22.0 43/1195143/2
Matthias Sohn [Thu, 23 May 2024 22:24:11 +0000 (00:24 +0200)]
Update  maven-pmd-plugin to 3.22.0

Change-Id: I9013309b218fafec7d1e70c98fb32a683ecc7a0b

5 months agoUpdate cyclonedx-maven-plugin to 2.8.0 42/1195142/2
Matthias Sohn [Thu, 23 May 2024 22:22:20 +0000 (00:22 +0200)]
Update cyclonedx-maven-plugin to 2.8.0

Change-Id: If26a3d7f26d3e46bf22a23f590cd289baaaa167f

5 months agoUpdate build-helper-maven-plugin to 3.6.0 41/1195141/2
Matthias Sohn [Thu, 23 May 2024 22:21:27 +0000 (00:21 +0200)]
Update build-helper-maven-plugin to 3.6.0

Change-Id: I3bb8f751c8c7ab630eb8b4eab3e24f354d1a10e7

5 months agoUpdate maven-site-plugin to 4.0.0-M14 40/1195140/2
Matthias Sohn [Thu, 23 May 2024 22:20:26 +0000 (00:20 +0200)]
Update maven-site-plugin to 4.0.0-M14

Change-Id: I0487adb0d3c7fef0841e3fb200d9df78ee27e9e4

5 months agoUpdate maven-jar-plugin to 3.4.1 39/1195139/2
Matthias Sohn [Thu, 23 May 2024 22:19:37 +0000 (00:19 +0200)]
Update maven-jar-plugin to 3.4.1

Change-Id: I695e424a44cac2119656ceacfbe1a7abb5f4d7b5

5 months agoUpdate maven-install-plugin to 3.1.2 38/1195138/2
Matthias Sohn [Thu, 23 May 2024 22:18:46 +0000 (00:18 +0200)]
Update maven-install-plugin to 3.1.2

Change-Id: Id322cef408ce9ddac3febc8963794f5958c06d3e

5 months agoUpdate maven-deploy-plugin to 3.1.2 37/1195137/2
Matthias Sohn [Thu, 23 May 2024 22:18:04 +0000 (00:18 +0200)]
Update maven-deploy-plugin to 3.1.2

Change-Id: I60d5aae001583671a01a8c38e98e36a7293b34eb

5 months agoUpdate maven-artifact-plugin to 3.5.1 36/1195136/2
Matthias Sohn [Thu, 23 May 2024 22:16:26 +0000 (00:16 +0200)]
Update maven-artifact-plugin to 3.5.1

Change-Id: I845e101876543a6b5fb197eefa7e73029b9e4809

5 months agoUpdate tycho to 4.0.7 and set minimum maven version to 3.9.0 35/1195135/2
Matthias Sohn [Thu, 23 May 2024 22:11:47 +0000 (00:11 +0200)]
Update tycho to 4.0.7 and set minimum maven version to 3.9.0

which is required by tycho 4.0.7.

Change-Id: I7ed1bda89c8712a0a1bb47bdf77e4b7f9f66c039

5 months agoUpdate git-commit-id-maven-plugin to 8.0.2 34/1195134/2
Matthias Sohn [Thu, 23 May 2024 22:09:04 +0000 (00:09 +0200)]
Update git-commit-id-maven-plugin to 8.0.2

Change-Id: I280b649a9d4bcaf829c7949a99c129d107eec822

6 months agoUpdate spotbugs-maven-plugin to 4.8.5.0 92/1194992/1
Matthias Sohn [Wed, 22 May 2024 21:37:17 +0000 (23:37 +0200)]
Update spotbugs-maven-plugin to 4.8.5.0

Change-Id: Icc7d5840536dd9f4ef4137c8e5ec35f687c3de4a

6 months agoUpdate japicmp-maven-plugin to 0.21.2 91/1194991/1
Matthias Sohn [Wed, 22 May 2024 21:35:24 +0000 (23:35 +0200)]
Update japicmp-maven-plugin to 0.21.2

Change-Id: Ifcab62d1ed7837258c257cac3a862668fe9db923

6 months agoUpdate maven-compiler-plugin to 3.13.0 90/1194990/1
Matthias Sohn [Wed, 22 May 2024 21:32:48 +0000 (23:32 +0200)]
Update maven-compiler-plugin to 3.13.0

Change-Id: I282498fee64bcfb542a063413b55821efc77302b

6 months agoUpdate bytebuddy to 1.14.16 88/1194988/1
Matthias Sohn [Wed, 22 May 2024 17:13:28 +0000 (19:13 +0200)]
Update bytebuddy to 1.14.16

Change-Id: Iaf958d05f31cd03d1f4d7ba64610abdee85bf63d

6 months agoUpdate com.google.code.gson:gson to 2.11.0 32/1195032/2
Ed Merks [Wed, 22 May 2024 06:46:31 +0000 (08:46 +0200)]
Update com.google.code.gson:gson to 2.11.0

Change-Id: Ibbd8e1675e3b8c67af0e13de16c470db108d3a0f

6 months agoUpdate Apache commons-logging to 1.3.2 79/1194979/2
Matthias Sohn [Mon, 20 May 2024 21:25:23 +0000 (23:25 +0200)]
Update Apache commons-logging to 1.3.2

Stop bundling the source bundle since the upstream artifact doesn't have
a valid OSGi manifest.

Change-Id: I819685f7f6d6ebcf8f179dd3133e7fc809bba392

6 months agoUpdate jetty to 10.0.21 78/1194978/1
Matthias Sohn [Mon, 20 May 2024 21:15:36 +0000 (23:15 +0200)]
Update jetty to 10.0.21

Change-Id: I1d7bf0fb66d329aad24b512bed082e3f74a5b2a8

6 months agoUpdate Apache commons-io to 2.16.1 77/1194977/1
Matthias Sohn [Mon, 20 May 2024 21:06:06 +0000 (23:06 +0200)]
Update Apache commons-io to 2.16.1

Change-Id: Ia8dec10b4d487611a9cad2268764fa53fcd35c47

6 months agoUpdate Apache commons-codec to 1.17.0 76/1194976/1
Matthias Sohn [Mon, 20 May 2024 20:55:39 +0000 (22:55 +0200)]
Update Apache commons-codec to 1.17.0

Change-Id: Ife807c38cd163a75a70e91610127b01807be2f68

6 months agoWalkFetchConnection: Remove marked packs on all function exits 56/1194856/4
Ivan Frade [Thu, 16 May 2024 19:28:53 +0000 (12:28 -0700)]
WalkFetchConnection: Remove marked packs on all function exits

[1] replaces Iterator.remove() with a list of "toRemove" that gets
processed when returning at the end. There are two others returns in
the function where the list is not processed.

Let the method report the broken packages and wrap it so the caller
can clean them up in any case.

[1] https://review.gerrithub.io/c/eclipse-jgit/jgit/+/1194812

Change-Id: I1ffb7829039f644df03b0b3ea1e5d10408ce19b7

6 months agoMerge "Do not use ArrayList when there will be deletions"
Ivan Frade [Thu, 16 May 2024 16:24:01 +0000 (16:24 +0000)]
Merge "Do not use ArrayList when there will be deletions"

6 months agoDo not use ArrayList when there will be deletions 12/1194812/7
jackdt@google.com [Wed, 15 May 2024 21:41:57 +0000 (14:41 -0700)]
Do not use ArrayList when there will be deletions

In https://gerrithub.io/c/eclipse-jgit/jgit/+/1194015, LinkedList was
replaced with ArrayList in DfsReader and WalkFetchConnection. In this
case, the Iterator.remove() method of List is called, which is an O(n)
operation for ArrayList. This results in an O(n^2) algorithm.

Instead of reverting to LinkedList, use a HashSet and LinkedHashmap
instead. This maintains O(1) removal, and is less likely to be treated
as an antipattern than LinkedList.

A likely innocuous usage of Iterator.remove() in UnionInputStream was
also fixed.

Change-Id: I57d884440c726b2fc80c1b8b2bec9bd7e2e6e3fe

6 months agoMerge changes I12e4d0fd,I082ffb20
Matthias Sohn [Thu, 16 May 2024 11:13:29 +0000 (11:13 +0000)]
Merge changes I12e4d0fd,I082ffb20

* changes:
  Remove unused API problem filters
  Fix warning "Redundant specification of type arguments <Object>"

6 months agoPatchApplierTest: remove unused import 25/1194625/1
Matthias Sohn [Wed, 15 May 2024 20:55:30 +0000 (22:55 +0200)]
PatchApplierTest: remove unused import

Change-Id: Ie3ac82a8160c605e27ee3167e3640cd76b1b2a76

6 months agoMerge "Allow applying a patch with conflicts"
Matthias Sohn [Wed, 15 May 2024 19:45:15 +0000 (19:45 +0000)]
Merge "Allow applying a patch with conflicts"

6 months agoAllow applying a patch with conflicts 80/200480/10
Patrick Hiesel [Fri, 10 Mar 2023 15:50:37 +0000 (16:50 +0100)]
Allow applying a patch with conflicts

In some settings, we want to let users apply a patch that does
not cleanly apply and add conflict markers. In Gerrit, this is
useful when cherry picking (via Git patches) from one host to
another.

This commit takes a simple approach: If a hunk doesn't apply,
go to the pre-image line, treat all lines in pre-image length
as left side of the conflict and all context and newly added
lines as right side of the conflict.

Change-Id: I01411d7a32b3f3207097b26231909aae6b835650

6 months agoRemove unused API problem filters 24/1194624/1
Matthias Sohn [Tue, 14 May 2024 14:33:04 +0000 (16:33 +0200)]
Remove unused API problem filters

Change-Id: I12e4d0fd48b5b7420d421874c8d63caed9628266

6 months agoFix warning "Redundant specification of type arguments <Object>" 23/1194623/2
Matthias Sohn [Tue, 14 May 2024 14:25:43 +0000 (16:25 +0200)]
Fix warning "Redundant specification of type arguments <Object>"

Use a lambda to fix this and make the code easier to read.

Change-Id: I082ffb2073f86d21deb4b51a24e53de9371b765e

6 months agoAdd 4.32 target platform 22/1194622/1
Matthias Sohn [Tue, 14 May 2024 14:18:24 +0000 (16:18 +0200)]
Add 4.32 target platform

and
- add orbit-4.32
- update objenesis to 3.4

Change-Id: Ia9df427eb3c97f867caaffbc92674fb750433aad

6 months agoMerge "sshd: fix IdentiesOnly if SSH agent is enabled and has keys"
Matthias Sohn [Tue, 14 May 2024 12:32:43 +0000 (12:32 +0000)]
Merge "sshd: fix IdentiesOnly if SSH agent is enabled and has keys"

6 months agosshd: fix IdentiesOnly if SSH agent is enabled and has keys 67/1194667/1
Thomas Wolf [Mon, 6 May 2024 17:32:12 +0000 (19:32 +0200)]
sshd: fix IdentiesOnly if SSH agent is enabled and has keys

Commit a44b9e8bf changed the logic so that we try to read a public key
from the file given first, and only then try the file with the ".pub"
extension. Unfortunately the exception handling was not sufficient to
correctly deal with the given file containing a private key.

Apache MINA SSHD may throw a StreamCorruptedException when one tries
to read a public key from a file containing a private key. Handle
this exception in addition to GeneralSecurityException, and change
the order of exception handlers because StreamCorruptedException is
an IOException.

Bug: jgit-53
Change-Id: I7dddc2c11aa75d7663f7fe41652df612bf8c88cd
Signed-off-by: Thomas Wolf <twolf@apache.org>
6 months agoUpdate mina-sshd to 2.12.1 21/1194621/2
Matthias Sohn [Mon, 13 May 2024 00:06:38 +0000 (02:06 +0200)]
Update mina-sshd to 2.12.1

Change-Id: I3f7b76243af0add3ee66a7f808a73f10d01a7627

6 months agoUpdate byte-buddy to 1.14.15 20/1194620/2
Matthias Sohn [Sun, 12 May 2024 23:52:12 +0000 (01:52 +0200)]
Update byte-buddy to 1.14.15

Change-Id: Ie5192a7c02c60e26c7c76f618b05f24307afcc63

6 months agoUpdate org.apache.commons:commons-compress to 1.26.1 19/1194619/2
Matthias Sohn [Sun, 12 May 2024 23:40:59 +0000 (01:40 +0200)]
Update org.apache.commons:commons-compress to 1.26.1

Change-Id: I53a0308145d1caa62a09b2262b721d155b62a4b8

6 months agoUpdate mockito to 5.12.0 18/1194618/2
Matthias Sohn [Sun, 12 May 2024 23:31:12 +0000 (01:31 +0200)]
Update mockito to 5.12.0

Change-Id: Ia346c37673369ee497ab4797aa96d82fe51f84c0

6 months agoUpdate org.eclipse.jdt:ecj to 3.37.0 17/1194617/2
Matthias Sohn [Sun, 12 May 2024 23:10:33 +0000 (01:10 +0200)]
Update org.eclipse.jdt:ecj to 3.37.0

Change-Id: Iedc5cd96f85367546f0b15df05ac242a38af3b16

6 months agoUpdate groovy to 4.0.21 15/1194615/2
Matthias Sohn [Sun, 12 May 2024 22:58:15 +0000 (00:58 +0200)]
Update groovy to 4.0.21

Change-Id: I7eb29ba080f6c2e3f4097977adf48b246c4a7822

6 months agoUpdate args4j to 2.37 14/1194614/2
Matthias Sohn [Sun, 12 May 2024 22:56:20 +0000 (00:56 +0200)]
Update args4j to 2.37

Change-Id: I6f8c1cce050017aad5b0d36886f85c42c1a3aed9

6 months agoCheck an execution bit by reading it from the file system 28/1193828/4
Yury Molchan [Wed, 6 Dec 2023 02:29:39 +0000 (04:29 +0200)]
Check an execution bit by reading it from the file system

Files.isExecutable() checks possibility to execute a file from the JVM,
not POSIX attributes. So it fails when Java Security Manager does not
allow to execute a file, but file has X-bit.

Change-Id: I85b96fb6cedbaff1b3c063728c25b6ce4d04e9b9

6 months ago[releng] Bump Bouncy Castle to 1.78.1 95/1194595/1
Thomas Wolf [Sat, 11 May 2024 12:11:17 +0000 (14:11 +0200)]
[releng] Bump Bouncy Castle to 1.78.1

Update version in pom.xml; update target platforms; update bazel
workspace.

BC 1.78 had broken OSGi metadata in MANIFEST.MF; this was fixed in
1.78.1.

Change-Id: Iac5751910b283b04983abe399264e0dabfe6162c
Signed-off-by: Thomas Wolf <twolf@apache.org>
6 months agoPackIndex: Make it an interface 74/1194474/3
Ivan Frade [Thu, 28 Mar 2024 22:11:05 +0000 (15:11 -0700)]
PackIndex: Make it an interface

As we work on different backends for PackIndex, it is much easier to
extend an interface than an abstract class.

Note that PackIndex is alredy acting as an interface, offering barely
any functionality.

Change-Id: Icd0db0e96a097631c2b9c3b05e5700f601f606d5

6 months agoPackIndex: Make iterator static (pass object count in ctor) 73/1194473/2
Ivan Frade [Thu, 28 Mar 2024 22:07:34 +0000 (15:07 -0700)]
PackIndex: Make iterator static (pass object count in ctor)

The iterator uses an implicit reference to the external class to
call #getObjectCount(). This implicit reference prevents PackIndex to
become an interface. The object count is immutable and known at
index (and iterator) construction time.

Pass the object count in the constructor of the iterator and make it
static.

Change-Id: I4949ff943de2a88380fb7f4c9b65b089734854b9

6 months agoPackIndex: move checksum to the subclasses 72/1194472/2
Ivan Frade [Thu, 28 Mar 2024 21:55:09 +0000 (14:55 -0700)]
PackIndex: move checksum to the subclasses

PackIndex is almost an interface, and making it so simplifies writing
implementations over other storages. Checksum and its getter is the
only functionality that is class specific.

Make getChecksum abstract and implement it in the subclasses.

Change-Id: I3746515d816abab075210505f1bb31b1936962e9

6 months agoGitDateFormatterTest: Remove printlns 01/1194201/1
Ivan Frade [Thu, 2 May 2024 16:43:12 +0000 (09:43 -0700)]
GitDateFormatterTest: Remove printlns

Left overs from https://review.gerrithub.io/c/eclipse-jgit/jgit/+/204984

Change-Id: I169ce2a008ca70267323fa4fb0f1e54981f1ec33

6 months agoBazel: Add support for JDK 21 84/204984/10
David Ostrovsky [Tue, 17 Oct 2023 07:47:35 +0000 (09:47 +0200)]
Bazel: Add support for JDK 21

There are two failing tests when switching to JDK 21.

One failure is related to the changed behaviour related to the locale
providers. Adapt `GitDateFormatterTest` to changes in unicode [1].

Second failure related to changed behaviour in URL.openConnection(),
see: [2] for more details.

Before JDK 20, some of the parsing/validation performed by the JDK
built-in URLStreamHander implementations were delayed until
URL::openConnection or URLConnection::connect was called. Starting
JDK 20, some of these parsing/validations are now performed early,
i.e. within URL constructors.

IOW, the assumption made in HttpSupport.TesttestMalformedUri() isn't
met any more: providing mailformed URI to the URL ctor now throws an
exception starting with JDK 20. To rectify the problem, remove the
offending test.

Test plan:

To build with JDK 21 and run the tests locally:

  $> bazel test --config=java21 //...

To build with JDK 21 and run the tests on RBE:

  $> bazel test --config=remote21 --remote_instance_name=$PROJECT //...

[1] https://bugs.openjdk.org/browse/JDK-8304925
[2] https://bugs.openjdk.org/browse/JDK-8293590

Change-Id: I796de67f7945d5f1fa5e8146f4ec8cbe9ac7bd3e

6 months agoMerge "Bazel: Replace deprecated --experimental_strict_action_env option"
David Ostrovsky [Thu, 2 May 2024 12:52:47 +0000 (12:52 +0000)]
Merge "Bazel: Replace deprecated --experimental_strict_action_env option"

6 months agoMerge "PackIndex: Make #getOffset protected to allow out-of-package subclasses"
Ivan Frade [Wed, 1 May 2024 16:21:32 +0000 (16:21 +0000)]
Merge "PackIndex: Make #getOffset protected to allow out-of-package subclasses"

6 months agoBazel: Replace deprecated --experimental_strict_action_env option 69/1194069/1
David Ostrovsky [Tue, 30 Apr 2024 05:07:20 +0000 (07:07 +0200)]
Bazel: Replace deprecated --experimental_strict_action_env option

In recent Bazel release the option was deprecated and replaced with:
--incompatible_strict_action_env option.

Hence this change is fixing this warning:

  WARNING: Option 'experimental_strict_action_env' is deprecated:
  Use --incompatible_strict_action_env instead

Change-Id: I49645b084c338d9c2bfff8ad20831bcf18de6b53

6 months agoFix warning about using raw type 25/1194025/1
Matthias Sohn [Mon, 29 Apr 2024 13:24:02 +0000 (15:24 +0200)]
Fix warning about using raw type

This fixes the warning in UploadPackHandleDeletedPackFileTest. line 116:

"Type safety: The method register(Object, Repository) belongs to the raw
type TestProtocol. References to generic type TestProtocol<C> should be
parameterized."

Change-Id: I5a74269f1af7369dd397dd0f1c3cd807c0351367

6 months ago[errorprone] Fix pattern ModifiedButNotUsed 24/1194024/3
Matthias Sohn [Mon, 29 Apr 2024 00:16:23 +0000 (02:16 +0200)]
[errorprone] Fix pattern ModifiedButNotUsed

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

Change-Id: I3bd3f865d50a26af6c594391de5adf35230c984f

6 months ago[errorprone] Fix pattern CatchAndPrintStackTrace 23/1194023/3
Matthias Sohn [Sun, 28 Apr 2024 23:54:01 +0000 (01:54 +0200)]
[errorprone] Fix pattern CatchAndPrintStackTrace

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

Change-Id: I7a6698293d1485f384c275bf7e4dcddc529af4a1

6 months ago[errorprone] Fix pattern FutureReturnValueIgnored 22/1194022/3
Matthias Sohn [Sun, 28 Apr 2024 23:37:28 +0000 (01:37 +0200)]
[errorprone] Fix pattern FutureReturnValueIgnored

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

Change-Id: I7225fd6388ce70ed5eea9e61b29bd10e1a927acb

6 months ago[errorprone] Fix pattern BadImport 21/1194021/3
Matthias Sohn [Sun, 28 Apr 2024 23:11:16 +0000 (01:11 +0200)]
[errorprone] Fix pattern BadImport

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

Change-Id: I24e5a7a4a64d8b3cf2cc3d394090ce90e849f9f9

6 months ago[errorprone] Fix pattern UseCorrectAssertInTests 20/1194020/3
Matthias Sohn [Sun, 28 Apr 2024 22:55:54 +0000 (00:55 +0200)]
[errorprone] Fix pattern UseCorrectAssertInTests

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

Change-Id: Iffde63ac795ad30c3e7774764cb8189cb089ed86

6 months ago[errorprone] Fix pattern ProtectedMembersInFinalClass 19/1194019/3
Matthias Sohn [Sun, 28 Apr 2024 22:42:46 +0000 (00:42 +0200)]
[errorprone] Fix pattern ProtectedMembersInFinalClass

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

Change-Id: I5993093ca012f091dfe8ee1f2099b9596c2ee697

6 months ago[errorprone] Fix pattern CatchFail 18/1194018/3
Matthias Sohn [Sun, 28 Apr 2024 22:29:30 +0000 (00:29 +0200)]
[errorprone] Fix pattern CatchFail

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

Change-Id: If1c637a420c4e669a5bdbe4abcefc5c3a2b3a43b

6 months ago[errorprone] Fix pattern see UnusedVariable 17/1194017/2
Matthias Sohn [Sun, 28 Apr 2024 22:11:46 +0000 (00:11 +0200)]
[errorprone] Fix pattern see UnusedVariable

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

Change-Id: I75d7602af31ed7d3264d2beab2d159cfbf29e7cb

6 months ago[errorprone] Fix pattern LongLiteralLowerCaseSuffix 16/1194016/2
Matthias Sohn [Sun, 28 Apr 2024 20:46:09 +0000 (22:46 +0200)]
[errorprone] Fix pattern LongLiteralLowerCaseSuffix

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

Change-Id: I139eadef5d66dfed2952ba9e1c91b3fe83259e97

6 months ago[errorprone] Fix error pattern JdkObsolete 15/1194015/2
Matthias Sohn [Sun, 28 Apr 2024 20:41:46 +0000 (22:41 +0200)]
[errorprone] Fix error pattern JdkObsolete

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

Change-Id: Id105e2695eb64523bd217f507bf95f909bc6b348

6 months ago[errorprone] Fix UnnecessaryParentheses errors 14/1194014/1
Matthias Sohn [Sun, 28 Apr 2024 19:28:30 +0000 (21:28 +0200)]
[errorprone] Fix UnnecessaryParentheses errors

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

Change-Id: I783fd24286ec1bd55efbf21d05758465f4af87ee

6 months agoBazel: Update RBE docker image to Ubuntu 22.04 and JDK 17 70/1193970/2
David Ostrovsky [Sun, 28 Apr 2024 12:30:56 +0000 (14:30 +0200)]
Bazel: Update RBE docker image to Ubuntu 22.04 and JDK 17

In this change we update the JDK used in RBE to JDK 17.

Use Ubuntu 22.04 docker image with JDK 17 from Bazel project as the new
base image. So that we don't need to maintain our own docker image any
more.

Also align the naming convention for the docker images with the Bazel
project: <OS version>-<JDK version>, and remove "rbe"-prefix from the
docker image name, because the image doesn't have any RBE specifics and
could be used for Gerrit build and tests outside of the RBE pipeline.

Change-Id: I617354c79301ec6dd52161dd3727f646c2a8ac56

6 months agoBump Bazel version to 7.1.1 80/204980/7
David Ostrovsky [Sun, 28 Apr 2024 17:17:41 +0000 (19:17 +0200)]
Bump Bazel version to 7.1.1

In Bazel 7.x release line, the bzlmod feature is activated per default,
so that we need to disable it. See this issue for more details: [1].

Test plan:

  $> bazel test //...

[1] https://github.com/bazelbuild/bazel/issues/18958

Change-Id: I2526d93020c5d82314a09206907ebeed6f1a1700

6 months agoPackIndex: Make #getOffset protected to allow out-of-package subclasses 61/1193961/1
Ivan Frade [Fri, 26 Apr 2024 21:04:08 +0000 (14:04 -0700)]
PackIndex: Make #getOffset protected to allow out-of-package subclasses

PackIndex#getOffset is abstract and package-private, limiting
subclasses to the same package. Given than the class and all other
relevant methods are public, this looks like an oversight and it
should be ok to write subclasses in other packages.

Make the method protected, allowing to write PackIndex subclasses in
other packages.

Change-Id: I7d3762b0a6c0681c29bd827bbaf094f1ee4583d2

6 months agoResolveMerger: Fix the issue with binary modify-modify conflicts 33/1176833/5
Sruteesh [Wed, 14 Feb 2024 16:49:39 +0000 (22:19 +0530)]
ResolveMerger: Fix the issue with binary modify-modify conflicts

1) If the file was marked as binary by git attributes, we should add the
path to conflicts if content differs in OURS and THEIRS
2) If the path is a file in OURS, THEIRS and BASE and if it is a binary
in any one of them, no content merge should be attempted and the file
content is kept as is in the work tree

Bug: jgit-14
Change-Id: I9201bdc53a55f8f40adade4b6a36ee8ae25f4db8

7 months agoExplain why RacyGitTests may be flaky in some environments 34/1193534/1
Matthias Sohn [Sat, 20 Apr 2024 18:28:20 +0000 (20:28 +0200)]
Explain why RacyGitTests may be flaky in some environments

Change-Id: I5bbd04754f5f29299a7b9a58a3717e3f615199d0

7 months agoMerge "PackBitmapIndexBuilder.StoredEntry: add getter for objectId"
Ivan Frade [Fri, 12 Apr 2024 16:05:14 +0000 (16:05 +0000)]
Merge "PackBitmapIndexBuilder.StoredEntry: add getter for objectId"

7 months agoMerge "PackBitmapIndex: clarify naming of getObject inputs"
Ivan Frade [Fri, 12 Apr 2024 16:03:58 +0000 (16:03 +0000)]
Merge "PackBitmapIndex: clarify naming of getObject inputs"

7 months agoPackBitmapIndexBuilder.StoredEntry: add getter for objectId 41/1192941/11
Sam Delmerico [Wed, 10 Apr 2024 18:03:46 +0000 (11:03 -0700)]
PackBitmapIndexBuilder.StoredEntry: add getter for objectId

If you only have access to the PackBitmapIndexBuilder there is no way to
get the ObjectId from a StoredEntry instance without also having access
to a reverse pack index. The StoredEntry can provide the idxPosition,
but the PackBitmapIndexBuilder's getObject method requires a
ridxPosition in order to find an ObjectId.

Providing an ObjectId from the StoredEntry gives this information
directly and also allows a caller to get the ridxPosition if desired by
calling PackBitmapIndexBuilder.findPosition(objectId) without needing
an index object.

This closes the operations of the PackBitmapIndexBuilder such that any
method can be called by using information provided by the other methods.

Change-Id: I5a11479b9635cd6b5e7aaff2f862cd41069ac469

7 months agoPackBitmapIndex: clarify naming of getObject inputs 08/1192808/11
Sam Delmerico [Tue, 9 Apr 2024 23:56:38 +0000 (16:56 -0700)]
PackBitmapIndex: clarify naming of getObject inputs

The documentation for the getObject function seems to be a little
outdated. This commit clarifies that this function accepts an offset
based on the ordering of objects in the pack.

Change-Id: Icffaf4fb72155c415f5fd248e721cab87a1a083e

7 months agoMerge "Add more tests on rewriting parents in a RevWalk"
Ivan Frade [Thu, 11 Apr 2024 21:11:58 +0000 (21:11 +0000)]
Merge "Add more tests on rewriting parents in a RevWalk"

7 months agoRevert "[releng] Bump Bouncy Castle to 1.78" 42/1192942/1
Thomas Wolf [Wed, 10 Apr 2024 18:53:33 +0000 (20:53 +0200)]
Revert "[releng] Bump Bouncy Castle to 1.78"

This reverts commit 718d121bb38860e66f6e34a4045aa6d5d9490e8a.

Bouncy Castle 1.78 has broken OSGi metadata: the package imports in
MANIFEST.MF are missing. See also [1] and [2].

[1] https://github.com/bcgit/bc-java/issues/1621
[2] https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/pull/1968#issuecomment-2048151288

Change-Id: Iedec921215dabe0b63fb0dd7f6a4b28c18f854a0
Signed-off-by: Thomas Wolf <twolf@apache.org>
7 months ago[releng] Bump Bouncy Castle to 1.78 51/1192751/2
Thomas Wolf [Mon, 8 Apr 2024 16:37:32 +0000 (18:37 +0200)]
[releng] Bump Bouncy Castle to 1.78

Update version in pom.xml; update target platforms; update bazel
workspace.

Also update the p2 repository; the Bouncy Castle bundle symbolic names
have changed from plain "bc*" to "bc*-jdk18on".

Change-Id: I07a5709c791f644d2247c76404a36ba7d0625a1c
Signed-off-by: Thomas Wolf <twolf@apache.org>
7 months agoMerge changes Ib7e3e562,I9d1f641c,Ia50445b8
Thomas Wolf [Tue, 9 Apr 2024 18:15:35 +0000 (18:15 +0000)]
Merge changes Ib7e3e562,I9d1f641c,Ia50445b8

* changes:
  [gpg] Remove obsolete import-package
  [gpg] Correct finding public keys from pubring.gpg
  [gpg] Fix reading ed25519 GPG keys

7 months agoMerge "MergeAlgorithm: Fix diff3 conflict hunk computation"
Ivan Frade [Tue, 9 Apr 2024 18:01:37 +0000 (18:01 +0000)]
Merge "MergeAlgorithm: Fix diff3 conflict hunk computation"

7 months agoMergeAlgorithm: Fix diff3 conflict hunk computation 76/1177976/4
Antonin Delpeuch [Sun, 10 Mar 2024 20:19:12 +0000 (21:19 +0100)]
MergeAlgorithm: Fix diff3 conflict hunk computation

Closes https://github.com/eclipse-jgit/jgit/issues/38.

The previous code computed the boundaries of the base part of
conflict hunks using line numbers computed for the 'ours' and
'theirs' revisions, leading to incorrect boundaries.

This only affects the presentation of merge conflicts in diff3
mode (which is probably not used a lot yet on Gerrit).
Successful merges are unaffected.

Change-Id: I173c79bf5797896dc854791d6d05cb3f035726f4
Signed-off-by: Antonin Delpeuch <antonin@delpeuch.eu>
7 months ago[gpg] Remove obsolete import-package 50/1192750/1
Thomas Wolf [Mon, 8 Apr 2024 16:31:38 +0000 (18:31 +0200)]
[gpg] Remove obsolete import-package

Bug: jgit-46
Change-Id: Ib7e3e562ca7ef9a30dfb7a1198f729bb389a5208
Signed-off-by: Thomas Wolf <twolf@apache.org>
7 months ago[gpg] Correct finding public keys from pubring.gpg 67/1184467/2
Thomas Wolf [Sat, 9 Mar 2024 23:04:41 +0000 (00:04 +0100)]
[gpg] Correct finding public keys from pubring.gpg

With a master key not enabled for signing, and a signing sub-key, key
lookup went wrong in several ways and might not find a suitable key for
signing or for signature verification. Fix the code so that it finds
the sub-key, even if user.signingKey is specified not with a key ID but
with an with an e-mail. (Sub-keys don't have user ids, those are
attached only on the master key.)

Change-Id: I9d1f641c49b173d4daffb3fd2e74f5aabd856e39
Signed-off-by: Thomas Wolf <twolf@apache.org>
7 months ago[gpg] Fix reading ed25519 GPG keys 66/1184466/2
Thomas Wolf [Sat, 9 Mar 2024 09:18:10 +0000 (10:18 +0100)]
[gpg] Fix reading ed25519 GPG keys

The S-expression parser from Bouncy Castle parsed such keys wrongly;
there is a "flags" sub-list before the "q" value. Additionally, the
parser validates the key read against the given public key, this failed
because Bouncy Castle does not know the OID of curve name "Ed25519".

Fix this and add a test for reading an ed25519 GPG key.

Bug: jgit-27
Change-Id: Ia50445b88759927d2e80b9871d498fbe5ad201bc
Signed-off-by: Thomas Wolf <twolf@apache.org>
7 months agoPackBitmapIndexBuilder: make StoredEntry constructor public 06/1190806/2
Sam Delmerico [Tue, 2 Apr 2024 19:24:02 +0000 (12:24 -0700)]
PackBitmapIndexBuilder: make StoredEntry constructor public

This POD data structure can be used externally

Change-Id: I464c45b93d0a56deaadbfe31df57a87e1054741c

7 months agoMerge "PackBitmapIndexBuilder: allow repeated call of getCompressedBitmaps()"
Ivan Frade [Tue, 2 Apr 2024 20:29:21 +0000 (20:29 +0000)]
Merge "PackBitmapIndexBuilder: allow repeated call of getCompressedBitmaps()"

7 months agoPackBitmapIndexBuilder: allow repeated call of getCompressedBitmaps() 33/1188433/5
Sam Delmerico [Wed, 27 Mar 2024 19:09:42 +0000 (12:09 -0700)]
PackBitmapIndexBuilder: allow repeated call of getCompressedBitmaps()

Each call of the current implementation of
PackBitmapIndexBuilder.getCompressedBitmaps reverses the class member that is returned. So two subsequent calls of this function will
receive reversed structures.

Instead we should just reverse a copy of the structure. This way the
PackBitmapIndexBuilder can continue to efficiently accept new bitmaps
via processBitmapForWrite (because we can continue to add to the back of
the bitmapsToWrite ArrayList) while ensuring that the bitmaps are
returned in the correct ordering from getCompressedBitmaps.

Change-Id: If7364222b9e62920c0c2c06894716fe85dd13315

7 months agoDfsPackFile: Make the loader classes used to construct bitmaps public. 65/1190165/11
jackdt@google.com [Mon, 1 Apr 2024 17:46:15 +0000 (10:46 -0700)]
DfsPackFile: Make the loader classes used to construct bitmaps public.

This is necessary to swap out implementations of the PackBitmapIndex
with custom implementations.

Change-Id: Ia6f951bbc901446c255fa2902fab05d7ed974111

7 months agoDfsPackFile: make public the constructor with bitmap loader 69/1190169/2
Ivan Frade [Mon, 1 Apr 2024 19:58:27 +0000 (12:58 -0700)]
DfsPackFile: make public the constructor with bitmap loader

The constructor with the bitmap loader as a parameter is supposed to
be used from subclasses in the ObjectDatabase, but those subclasses
cannot see it with its current package-private visibility.

Make it public, so it can be used as intended.

Change-Id: I4afca3d2a13c4a41a766d08c5aa54bde352915a6

7 months agoPackWriter: writeBitmapIndex takes bitmap index writer 22/1177722/21
Sam Delmerico [Tue, 5 Mar 2024 01:40:37 +0000 (17:40 -0800)]
PackWriter: writeBitmapIndex takes bitmap index writer

PackWriter.writeBitmapIndex now takes an interface which will perform
the writing of the bitmap index to an arbitrary backing storage.

Change-Id: Icba89321d56f7b652bbcbfcd5ed3ec74999cb8c4

7 months agoAdd more tests on rewriting parents in a RevWalk 89/1178189/5
Max Haslbeck [Tue, 12 Mar 2024 13:23:20 +0000 (13:23 +0000)]
Add more tests on rewriting parents in a RevWalk

Change I4e4ff67fb279edbcc3461496b132cea774fb742f introduced new
behaviour that also rewrote parents in a RevWalk if no TreeFilter was
set. This led to unexpected behaviour when users were fetching from
chromium.googlesource.com. I added a few more tests to better describe
the behaviour of RevWalk in regards to rewriting parents.

Change-Id: I1a5e5f8a1de9d8dd0e3664918ac010644b3ef87b
Signed-off-by: Max Haslbeck <haslbeck@google.com>