Commit Graph

9442 Commits

Author SHA1 Message Date
Antoine Musso c7960910f0 Mark COMMIT_GENERATION_* constants final
In org.eclipse.jgit.lib.Constants the constants are all marked final
with the exception of:

- COMMIT_GENERATION_UNKOWN
- COMMIT_GENERATION_NOT_COMPUTED

They were introduced by cf70e7cbe4 without the `final` keyword while
other constants have it which certainly has been forgotten.

The javadoc `{@value}` tag causes raises a warning about the fields not
being constants which is how I have discovered the ommission.

Change-Id: I0ad87f42355440c7d50158e773a280a0526e9671
2023-06-09 16:40:35 +02:00
Luca Milanesio ff4caff26a Merge branch 'stable-6.6'
* stable-6.6:
  Revert "RefDirectory: Throw exception if CAS of packed ref list fails"

Change-Id: I6011c20b1aca179126393b0e03fbfb0ba1b6d64c
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
2023-06-08 00:28:55 +01:00
Luca Milanesio 5074a31510 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>
2023-06-08 00:28:20 +01:00
Luca Milanesio ff581f51e9 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>
2023-06-08 00:27:49 +01:00
Luca Milanesio b6237ca8b6 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>
2023-06-08 00:27:00 +01:00
Luca Milanesio 880f1234b2 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>
2023-06-08 00:26:04 +01:00
Luca Milanesio b77fdf6df4 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>
2023-06-08 00:25:12 +01:00
Luca Milanesio 42d201f46c 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>
2023-06-08 00:24:00 +01:00
Luca Milanesio a22c62cb6d 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>
2023-06-08 00:21:15 +01:00
Martin Fick f6928f5736 Revert "RefDirectory: Throw exception if CAS of packed ref list fails"
This reverts commit 9c33f7364d.

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 c5617711a1)
2023-06-07 19:08:39 -04:00
Matthias Sohn c608bac9ae Merge "Merge branch 'stable-6.6'" 2023-06-07 12:14:35 -04:00
Anna Papitto 74547f4a68 PackReverseIndex: use static builder instead of constructor
PackReverseIndex instances are created using the constructor directly,
which limits control over the construction logic and refactoring
opportunities for the class itself. These will be needed for a
file-based implementation of the reverse index.

Use a static builder method to create a PackReverseIndex instance using
a pack's forward index.

Change-Id: I4421d907cd61d9ac932df5377e5e28a81679b63f
Signed-off-by: Anna Papitto <annapapitto@google.com>
2023-05-31 10:09:50 +02:00
Anna Papitto 181b629f7d Gc#writePack: write the reverse index file to disk
The reverse index is currently created in-memory when needed. A writer
for reverse index files was already implemented.

Make garbage collection write the reverse index file when the PackConfig
enables it. Write it during #writePack, which mirrors how the primary
index is written.

Change-Id: I50131af6622c41a7b24534aaaf2a423ab4178981
Signed-off-by: Anna Papitto <annapapitto@google.com>
2023-05-31 10:09:50 +02:00
Matthias Sohn 13fe601fd2 Merge branch 'stable-6.6'
* stable-6.6:
  Prepare 6.6.1-SNAPSHOT builds
  JGit v6.6.0.202305301015-r

Change-Id: I4f7fc395122d4c34ceaa639726e9d0e255641c8d
2023-05-31 00:07:59 +02:00
Matthias Sohn ceeb9ad80d Prepare 6.6.1-SNAPSHOT builds
Change-Id: I0036999e2be076d4ad8231410faeff51bf9cbf52
2023-05-30 17:24:58 +02:00
Matthias Sohn d3962e0e72 JGit v6.6.0.202305301015-r
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I33b45b0cf36835b289ecbb5a1a9fc4ad7fc200cd
2023-05-30 16:11:53 +02:00
David Ostrovsky 0f071a7bce 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
2023-05-29 18:39:59 +02:00
Matthias Sohn a9520419e2 Merge branch 'stable-6.6'
* stable-6.6:
  Update to Orbit S20230516204213
  Prepare 6.6.0-SNAPSHOT builds
  JGit v6.6.0.202305241045-m3
  Prepare 6.6.0-SNAPSHOT builds
  JGit v6.6.0.202305031100-m2

Change-Id: Ibceebbce6aebba7a8670de41eb39eb23b14b8c74
2023-05-25 23:09:17 +02:00
Matthias Sohn cae6d4e6b1 Update to Orbit S20230516204213
Change-Id: I4daae47b8d2e244b78dff5ca072e41153e7e6734
2023-05-24 18:24:21 +02:00
Matthias Sohn 264b91c3ee Prepare 6.6.0-SNAPSHOT builds
Change-Id: If0e4e8ce5f3e2f5170f313fb9b26b4ec0e34dab9
2023-05-24 18:23:45 +02:00
Matthias Sohn 9afff3e808 Prepare 6.7.0-SNAPSHOT builds
Change-Id: I50ff7ee31046cfc29a087c8963be3deae24b1c9c
2023-05-24 17:31:26 +02:00
Matthias Sohn 246f37d193 JGit v6.6.0.202305241045-m3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I204708812b9cb6f98f9c29e28548b91da0d88d91
2023-05-24 16:46:23 +02:00
Matthias Sohn f7ba6c2356 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
2023-05-24 15:50:27 +02:00
Matthias Sohn 590f03b7dc 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'
2023-05-23 19:25:05 -04:00
Jonathan Tan 44461b215e Merge "GraphObjectIndex: fix search in findGraphPosition" 2023-05-23 18:26:47 -04:00
Jonathan Tan 6b3b2b33a5 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>
2023-05-23 13:57:32 -07:00
Matthias Sohn d3d0ec4290 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
2023-05-23 19:47:08 +02:00
Matthias Sohn 0d92f543f5 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
2023-05-23 19:47:08 +02:00
Thomas Wolf f8038b6b58 Revert 'Use net.i2p.crypto:eddsa directly from Maven Central'
This reverts commit 7e094c6cf3.

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>
2023-05-23 19:47:08 +02:00
Matthias Sohn 5a00dd873d Update dash license-tool-plugin to 1.0.2
Change-Id: I9708d918f4610503d7a16f55cea3aa3931dcd2cc
2023-05-20 10:58:02 +02:00
Matthias Sohn 0eedb1affb Merge "Also add suppressed exception if unchecked exception occurs in finally" 2023-05-19 13:49:42 -04:00
Matthias Sohn 2cbf0c1774 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
2023-05-18 21:10:33 +02:00
Fabio Ponciroli 334852c52f Candidate: use "Objects.equals" instead of "=="
Errorprone raises the following warning:
"[ReferenceEquality] Comparison using reference equality
instead of value equality".

Change-Id: Iacb207ef0625bb987a08406d4e7461e48fade97f
2023-05-18 05:37:11 -04:00
Matthias Sohn 4562e79e23 Use hamcrest 2.2 directly from Maven Central
Change-Id: I4039b56b1cdc54ff1886c2a4973d857d785989c2
2023-05-17 22:24:02 +02:00
Matthias Sohn 04ca81308f Use commons-logging directly from Maven Central
Change-Id: I08e51450f70f941761539d3f08dd65c5d706dcdc
2023-05-17 22:23:39 +02:00
Matthias Sohn 72455b5fd3 Update jna to 5.13.0
Change-Id: I87d65e66e1cac64ccb744632ea45d06f8b8637fe
2023-05-17 22:23:10 +02:00
Matthias Sohn e532509219 Use bytebuddy directly from Maven Central
Change-Id: I5e24a31b78ef3758e1ce84e3b0eacaff1608fcd9
2023-05-17 22:22:32 +02:00
Matthias Sohn ca0696664f Use jna directly from Maven Central
Change-Id: I3c2576648748a6c6020c13a604cf5fcd4864aeb8
2023-05-17 22:20:45 +02:00
Matthias Sohn 7e094c6cf3 Use net.i2p.crypto:eddsa directly from Maven Central
Change-Id: I8e864380fa5eb3006943b78b19f6cbe7ae9f8111
2023-05-17 17:03:56 +02:00
Matthias Sohn b3dcf6344b Use org.tukaani:xz directly from Maven Central
Change-Id: I4ab835cee694778eedaa125cc372be8b6c876133
2023-05-17 17:03:34 +02:00
Matthias Sohn 4aa89daac2 Use args4j directly from Maven Central
Change-Id: I91c7c42c1fc779278fe30294638edef182e88347
2023-05-17 17:03:06 +02:00
Matthias Sohn 7e67fe1d40 Use gson directly from Maven Central
Change-Id: I4741f733aa7ca219296ed788d4dc93df77cc65ff
2023-05-17 17:02:27 +02:00
Matthias Sohn 6f2d93fb8d Remove unused $NON-NLS-1$
Change-Id: I3314e5106d873c03903562f9798de6af2ae588a7
2023-05-17 17:01:33 +02:00
Matthias Sohn 0f7d485bc9 Remove unused API filters
Change-Id: I1971b31753fd4c3568016e7db955cce8e391a1e0
2023-05-17 17:01:33 +02:00
Thomas Wolf 913e6cf3f6 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>
2023-05-16 12:59:37 +02:00
Thomas Wolf 43954ea62a [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>
2023-05-15 20:45:22 +02:00
Ivan Frade c40683929c Merge "UploadPack: Record negotiation stats on fetchV2 call" 2023-05-11 16:53:12 -04:00
Anna Papitto 2c89a3ec74 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>
2023-05-11 16:49:55 -04:00
Ronald Bhuleskar d0564cf8ae 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
2023-05-11 11:55:38 -07:00
Simon Sohrt e6f216119f RewriteGeneratorTest: Introduce test cases for the RewriteGenerator
Bug: 577948
Signed-off-by: Simon Sohrt <sohrt@his.de>
Change-Id: I5af1a43d49379e2417611eaacdd5f06be8147bc4
2023-05-09 10:51:29 +02:00