]> source.dussan.org Git - jgit.git/log
jgit.git
16 months agoUpdate spring-boot-maven-plugin to 2.7.13 25/202725/1
Matthias Sohn [Tue, 27 Jun 2023 08:42:50 +0000 (10:42 +0200)]
Update spring-boot-maven-plugin to 2.7.13

Change-Id: I9d28540971a9c45f961ccfef1123a0a4ba3f88f2

16 months agoUpdate maven-source-plugin to 3.3.0 24/202724/1
Matthias Sohn [Tue, 27 Jun 2023 08:25:45 +0000 (10:25 +0200)]
Update maven-source-plugin to 3.3.0

Change-Id: I4735538aeeb92a01009aad1ca837cb636dcd4b93

17 months agoPackReverseIndex: separate out the computed implementation 88/197588/42
Anna Papitto [Tue, 20 Jun 2023 22:44:30 +0000 (15:44 -0700)]
PackReverseIndex: separate out the computed implementation

PackReverseIndex is a concrete class whose implementation is computed
from a pack's forward index. Callers which have a reverse index file may
want to use an implementation that is file-based instead.

Generalize PackReverseIndex into an interface without
implementation-specific logic and separate out the logic for the
computed implementation into a new concrete class.

Change-Id: I98d9835363c5e1c8c3c11a81b0761af3cdeaa41a
Signed-off-by: Anna Papitto <annapapitto@google.com>
17 months agoDefault for global (user) git ignore file 60/202560/2
Thomas Wolf [Thu, 15 Jun 2023 20:08:06 +0000 (22:08 +0200)]
Default for global (user) git ignore file

C git has a default for git config core.excludesfile: "Its default
value is $XDG_CONFIG_HOME/git/ignore. If $XDG_CONFIG_HOME is either
not set or empty, $HOME/.config/git/ignore is used instead." [1]

Implement this in the WorkingTreeIterator$RootIgnoreNode.

To make this testable, mock the "user.home" directory for all JGit
tests, otherwise tests might pick up a real user's git ignore file.
Also ensure that JGit code always reads "user.home" via the
SystemReader.

Add tests for both locations.

[1] https://git-scm.com/docs/gitignore#_description

Bug: 436127
Change-Id: Ie510259320286c3c13a6464a37da1bd9ca1e373a
Signed-off-by: Thomas Wolf <twolf@apache.org>
17 months agoFix all Javadoc warnings and fail on them 03/202303/11
Antoine Musso [Wed, 31 May 2023 15:57:28 +0000 (17:57 +0200)]
Fix all Javadoc warnings and fail on them

This fixes all the javadoc warnings, stops ignoring doclint 'missing'
category and fails the build on javadoc warnings for public and
protected classes and class members.

Since javadoc doesn't allow access specifiers when specifying doclint
configuration we cannot set `-Xdoclint:all,-missing/private`
hence there is no simple way to skip private elements from doclint.
Therefore we check javadoc using the Eclipse Java compiler
(which is used by default) and javadoc configuration in
`.settings/org.eclipse.jdt.core.prefs` files.
This allows more fine grained configuration.

We can reconsider this when javadoc starts supporting access specifiers
in the doclint configuration.

Below are detailled explanations for most modifications.

@inheritDoc
===========
doclint complains about explicits `{@inheritDoc}` when the parent does
not have any documentation. As far as I can tell, javadoc defaults to
inherit comments and should only be used when one wants to append extra
documentation from the parent. Given the parent has no documentation,
remove those usages which doclint complains about.

In some case I have moved up the documentation from the concrete class
up to the abstract class.

Remove `{@inheritDoc}` on overriden methods which don't add additional
documentation since javadoc defaults to inherit javadoc of overridden
methods.

@value to @link
===============
In PackConfig, DEFAULT_SEARCH_FOR_REUSE_TIMEOUT and similar are forged
from Integer.MAX_VALUE and are thus not considered constants (I guess
cause the value would depends on the platform). Replace it with a link
to `Integer.MAX_VALUE`.

In `StringUtils.toBoolean`, @value was used to refer to the
`stringValue` parameter. I have replaced it with `{@code stringValue}`.

{@link <url>} to <a>
====================
@link does not support being given an external URL. Replaces them with
HTML `<a>`.

@since: being invalid
=====================

org.eclipse.jgit/src/org/eclipse/jgit/util/Equality.java has an invalid
tag `@since: ` due to the extra `:`. Javadoc does not complain about it
with version 11.0.18+10 but does with 11.0.19.7. It is invalid
regardless.

invalid HTML syntax
===================

- javadoc doesn't allow <br/>, <p/> and </p> anymore, use <br> and <p>
instead
- replace <tt>code</tt> by {@code code}
- <table> tags don't allow summary attribute, specify caption as
<caption>caption</caption> to fix this

doclint visibility issue
========================

In the private abstract classes `BaseDirCacheEditor` and
`BasePackConnection` links to other methods in the abstract class are
inherited in the public subclasses but doclint gets confused and
considers them unreachable. The HTML documentation for the sub classes
shows the relative links in the sub classes, so it is all correct. It
must be a bug somewhere in javadoc.
Mute those warnings with: @SuppressWarnings("doclint:missing")

Misc
====
Replace `<` and `>` with HTML encoded entities (`&lt; and `&gt;`).
In `SshConstants` I went enclosing a serie of -> arrows in @literal.

Additional tags
===============
Configure maven-javad0c-plugin to allow the following additional tags
defined in https://openjdk.org/jeps/8068562:
- apiNote
- implSpec
- implNote

Missing javadoc
===============
Add missing @params and descriptions

Change-Id: I840056389aa59135cfb360da0d5e40463ce35bd0
Also-By: Matthias Sohn <matthias.sohn@sap.com>
17 months agoMark COMMIT_GENERATION_* constants final 50/202450/2
Antoine Musso [Fri, 9 Jun 2023 12:03:27 +0000 (14:03 +0200)]
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 cf70e7cbe4f 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

17 months agoMerge branch 'stable-6.6' 23/202423/1
Luca Milanesio [Wed, 7 Jun 2023 23:28:52 +0000 (00:28 +0100)]
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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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)

17 months agoMerge "Merge branch 'stable-6.6'"
Matthias Sohn [Wed, 7 Jun 2023 16:14:35 +0000 (12:14 -0400)]
Merge "Merge branch 'stable-6.6'"

17 months agoPackReverseIndex: use static builder instead of constructor 87/197587/39
Anna Papitto [Tue, 30 May 2023 14:20:54 +0000 (16:20 +0200)]
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>
17 months agoGc#writePack: write the reverse index file to disk 85/197585/39
Anna Papitto [Tue, 30 May 2023 14:20:54 +0000 (16:20 +0200)]
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>
17 months agoMerge branch 'stable-6.6' 16/202216/1
Matthias Sohn [Tue, 30 May 2023 22:07:59 +0000 (00:07 +0200)]
Merge branch 'stable-6.6'

* stable-6.6:
  Prepare 6.6.1-SNAPSHOT builds
  JGit v6.6.0.202305301015-r

Change-Id: I4f7fc395122d4c34ceaa639726e9d0e255641c8d

17 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

17 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

17 months agoBump bazel vesion to 6.2.0 04/202104/2
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

18 months agoMerge branch 'stable-6.6' 16/202116/1
Matthias Sohn [Thu, 25 May 2023 21:09:17 +0000 (23:09 +0200)]
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

18 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

18 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

18 months agoPrepare 6.7.0-SNAPSHOT builds 68/202068/1
Matthias Sohn [Wed, 24 May 2023 15:31:26 +0000 (17:31 +0200)]
Prepare 6.7.0-SNAPSHOT builds

Change-Id: I50ff7ee31046cfc29a087c8963be3deae24b1c9c

18 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

18 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

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

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

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

18 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

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

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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

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

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

18 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

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

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

18 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

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

18 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

18 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

18 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

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

18 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

18 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

18 months agoUpdate Apache commons-codec to 1.15 41/201641/1
Matthias Sohn [Mon, 1 May 2023 14:27:28 +0000 (16:27 +0200)]
Update Apache commons-codec to 1.15

and consume it directly from Maven Central.

Its BundleSymbolicName changes to "org.apache.commons.commons-codec"
which is defined upstream.

Change-Id: Id9c366b3be0b97f4b191ba78f02001306f0e5035

18 months agoUpdate org.apache.commons:commons-compress to 1.23.0 40/201640/1
Matthias Sohn [Mon, 1 May 2023 12:58:23 +0000 (14:58 +0200)]
Update org.apache.commons:commons-compress to 1.23.0

and consume it directly from Maven Central.

Its BundleSymbolicName changes to "org.apache.commons.commons-compress"
which is defined upstream.

Change-Id: I691f5f49491dd2c9ba577ebe0c6f7cdd462c047a

18 months agoUpdate javaEWAH to 1.2.3 and use it directly from Maven central 39/201639/1
Matthias Sohn [Mon, 1 May 2023 09:38:36 +0000 (11:38 +0200)]
Update javaEWAH to 1.2.3 and use it directly from Maven central

This changes its BundleSymbolicName from "javaewah" (name in Orbit) to
com.googlecode.javaewah.JavaEWAH (name in upstream artefact from Maven
Central).

Change-Id: I8dee6909d496e3d05b2de938515dde831518be24

18 months agoUpdate org.eclipse.jdt:ecj to 3.33.0 37/201637/1
Matthias Sohn [Mon, 1 May 2023 08:14:18 +0000 (10:14 +0200)]
Update org.eclipse.jdt:ecj to 3.33.0

Change-Id: I0f310762313d6ccafe3ea410bf9d4c03731f0866

18 months agoAdd missing @since tag to IntComparator 36/201636/1
Matthias Sohn [Mon, 1 May 2023 13:00:37 +0000 (15:00 +0200)]
Add missing @since tag to IntComparator

Change-Id: Ic190ab404ccb3af675cdd90cac231ce6e856ea68

18 months agoUpdate to jakarta.servlet:jakarta.servlet-api:4.0.4 17/201617/2
Matthias Sohn [Sun, 30 Apr 2023 21:32:50 +0000 (23:32 +0200)]
Update to jakarta.servlet:jakarta.servlet-api:4.0.4

Change-Id: I892b44e7886f5c30be7b2003ca048e3e22aa75f6

18 months agoSupport rebasing independent branches 08/201608/1
Thomas Wolf [Sun, 23 Apr 2023 19:34:37 +0000 (21:34 +0200)]
Support rebasing independent branches

With completely independent branches, there is no merge base. In this
case, the list of commits must include the root commit of the branch to
be rebased.

Bug: 581832
Change-Id: I0f5bdf179d5b07ff09f1a274d61c7a0b1c0011c6
Signed-off-by: Thomas Wolf <twolf@apache.org>
18 months agoSupport cherry-picking a root commit 07/201607/1
Thomas Wolf [Sun, 23 Apr 2023 19:31:40 +0000 (21:31 +0200)]
Support cherry-picking a root commit

Handle the case of the commit to be picked not having any parents.

Since JGit implements cherry-pick as a 3-way-merge between the commit
to be picked and the target commit, using the parent of the picked
commit as merge base, this is super simple: just don't set a base tree.
The merger will not find any merge base and will supply an empty tree
iterator for the base.

Bug: 581832
Change-Id: I88985f1b1723db5b35ce58bf228bc48d23d6fca3
Signed-off-by: Thomas Wolf <twolf@apache.org>
18 months agoAddCommand: ability to switch off renormalization 49/201449/7
Thomas Wolf [Thu, 20 Apr 2023 19:13:59 +0000 (21:13 +0200)]
AddCommand: ability to switch off renormalization

JGit's AddCommand always renormalizes tracked files. C git does so only
on git add --renormalize. Especially for git add . and the JGit
equivalent git.add().addFilepattern(".").call() this can make a big
difference if there are many files, or large files.

Add a "renormalize" option to AddCommand. To maintain compatibility with
existing uses, this option is "true" by default, and the behavior of
AddCommand is as it has always been in JGit.

If set to "false", use an IndexDiffFilter (in addition to a path filter,
if any). This skips any unchanged files (that are not racily clean) from
content checks. Note that changes in CRLF settings or in filters will be
ignored for such files if renormalize == false.

Add the "--renormalize" option to the Add command in the JGit command
line program. For the command-line program, the default is as in C git:
renormalize is off by default and enabled only if the option is given.
Note that --renormalize implies --update in the command line program, as
in C git. In AddCommand, the two settings are independent.

Additionally, avoid opening input streams unnecessarily in
WorkingTreeIterator.getEntryContentLength() and fix some bogus
indentation.

Add a simple test that adds 1000 files of 10kB in 10 directories twice
and that fails if the second invocation (without any changes) with
renormalize=false is not significantly faster.

Locally, I observe for that second invocation

* git.add().addFilepattern(".").call()                        ~660ms
* git.add().addFilepattern(".").setRenormalize(false).call()   ~16ms

Bug: 494323
Change-Id: I30f9d518563fa55d7058a48c27c425f3b60aeb4c
Signed-off-by: Thomas Wolf <twolf@apache.org>
18 months agoUpdate jetty to 10.0.15 and use it from Maven central directly 47/201447/3
Matthias Sohn [Fri, 21 Apr 2023 22:03:56 +0000 (00:03 +0200)]
Update jetty to 10.0.15 and use it from Maven central directly

and update servlet-api to 4.0.1

Change-Id: Id17aad56fc6f10dd64ce088c4b5a0532f5f0c588

18 months agoUpdate bouncycastle to 1.73 54/201354/3
Matthias Sohn [Sun, 16 Apr 2023 22:46:03 +0000 (00:46 +0200)]
Update bouncycastle to 1.73

Review requests were created for
maven/mavencentral/org.bouncycastle/bcpkix-jdk18on/1.73
https://gitlab.eclipse.org/eclipsefdn/emo-team/iplab/-/issues/7892
maven/mavencentral/org.bouncycastle/bcprov-jdk18on/1.73
https://gitlab.eclipse.org/eclipsefdn/emo-team/iplab/-/issues/7893
maven/mavencentral/org.bouncycastle/bcutil-jdk18on/1.73
https://gitlab.eclipse.org/eclipsefdn/emo-team/iplab/-/issues/7894

Change-Id: I389cdd7500d7d9292d7ea5eee142492dd1db7112

18 months ago[errorprone] Fix MissingOverride error 05/201605/1
Matthias Sohn [Fri, 28 Apr 2023 19:46:04 +0000 (21:46 +0200)]
[errorprone] Fix MissingOverride error

see https://errorprone.info/bugpattern/MissingOverride
Change-Id: Iec8833eb52d91a4ef117160407b9151f25617cb5

18 months agoMerge "Merge branch 'stable-6.5'"
Matthias Sohn [Fri, 28 Apr 2023 19:22:52 +0000 (15:22 -0400)]
Merge "Merge branch 'stable-6.5'"

18 months agoMerge "PackReverseIndexWriter: write out version 1 reverse index file"
Ivan Frade [Fri, 28 Apr 2023 18:16:25 +0000 (14:16 -0400)]
Merge "PackReverseIndexWriter: write out version 1 reverse index file"

18 months agoMerge branch 'stable-6.5' 03/201603/1
Matthias Sohn [Fri, 28 Apr 2023 17:51:01 +0000 (19:51 +0200)]
Merge branch 'stable-6.5'

* stable-6.5:
  [bazel] Move ToolTestCase to src folder (6.2)
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest
  Fix after_open config and Snapshotting RefDir tests to work with bazel
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings
  Parse pull.rebase=preserve as alias for pull.rebase=merges
  UploadPack: Fix NPE when traversing a tag chain

Change-Id: I16e8553d187a8ef541f578291f47fc39c3da4ac0

18 months agoMerge "IntList: add #sort using quick sort for O(n log n) runtime."
Ivan Frade [Fri, 28 Apr 2023 17:49:51 +0000 (13:49 -0400)]
Merge "IntList: add #sort using quick sort for O(n log n) runtime."

18 months agoPackReverseIndexWriter: write out version 1 reverse index file 81/197581/28
Anna Papitto [Thu, 27 Apr 2023 18:01:30 +0000 (11:01 -0700)]
PackReverseIndexWriter: write out version 1 reverse index file

The reverse index for a pack is used to quickly find an object's
position in the pack's forward index based on that object's pack offset.
It is currently computed from the forward index by sorting the index
entries by the corresponding pack offset. This computation uses
bucket sort with insertion sort, which has an average runtime of
O(n log n) and worst case runtime of O(n^2); and memory usage of
3*size(int)*n because it maintains 3 int arrays, even after sorting is
completed. The computation must be performed every time that the reverse
index object is created in memory.

In contrast, Cgit persists a pack reverse index file to avoid
recomputing the reverse index ordering every time that it is needed.
Instead they write a file with format
https://git-scm.com/docs/pack-format#_pack_rev_files_have_the_format
which can later be read and parsed into an in-memory reverse index each
time it is needed.

Introduce these reverse index files to JGit. PackReverseIndexWriter
writes out a reverse index file to be read later when needed. Subclass
PackReverseIndexWriterV1 writes a file with the official version 1
format.

To avoid temporarily allocating an Integer collection while sorting and
writing out the contents, using memory 4*size(Integer)*n, use an
IntList and its #sort method, which uses quicksort.

Change-Id: I6437745777a16f723e2f1cfcce4e0d94e599dcee
Signed-off-by: Anna Papitto <annapapitto@google.com>
18 months agoIntList: add #sort using quick sort for O(n log n) runtime. 59/201559/3
Anna Papitto [Thu, 27 Apr 2023 18:01:29 +0000 (11:01 -0700)]
IntList: add #sort using quick sort for O(n log n) runtime.

IntList is a class for working with lists of primitive ints without
boxing them into Integers. For writing the reverse index file format,
sorting ints will be needed but IntList doesn't provide a sorting
method yet.

Add the #sort method to sort an IntList by an IntComparator, using
quicksort, which has a average runtime of O(n log n) and sorts in-place
by using O(log n) stack frames for recursive calls.

Change-Id: Id69a687c8a16d46b13b28783b194a880f3f4c437
Signed-off-by: Anna Papitto <annapapitto@google.com>
18 months agoMerge branch 'stable-6.4' into stable-6.5 30/201530/1
Matthias Sohn [Thu, 27 Apr 2023 00:30:20 +0000 (02:30 +0200)]
Merge branch 'stable-6.4' into stable-6.5

* stable-6.4:
  [bazel] Move ToolTestCase to src folder (6.2)
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest
  Fix after_open config and Snapshotting RefDir tests to work with bazel
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings
  UploadPack: Fix NPE when traversing a tag chain

Change-Id: I6d20fea3a417e4361b61e81756253343668eb5de

18 months agoMerge branch 'stable-6.3' into stable-6.4 81/201481/2
Matthias Sohn [Thu, 27 Apr 2023 00:20:10 +0000 (02:20 +0200)]
Merge branch 'stable-6.3' into stable-6.4

* stable-6.3:
  [bazel] Move ToolTestCase to src folder (6.2)
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest
  Fix after_open config and Snapshotting RefDir tests to work with bazel
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings
  UploadPack: Fix NPE when traversing a tag chain

Change-Id: I463f8528e623316add204848d551c44d44d04858

18 months agoMerge branch 'stable-6.2' into stable-6.3 80/201480/3
Matthias Sohn [Thu, 27 Apr 2023 00:07:23 +0000 (02:07 +0200)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  [bazel] Move ToolTestCase to src folder (6.2)
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest
  Fix after_open config and Snapshotting RefDir tests to work with bazel
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings
  UploadPack: Fix NPE when traversing a tag chain

Change-Id: I736c7d0ed9c6e9718fa98976c3dc5a25ab8cda85

18 months ago[bazel] Move ToolTestCase to src folder (6.2) 25/201525/2
Matthias Sohn [Mon, 24 Apr 2023 16:50:10 +0000 (18:50 +0200)]
[bazel] Move ToolTestCase to src folder (6.2)

Bazel barks at the abstract ToolTestCase not containing any test. Move
it from the tst/ source folder to the src/ source folder so that bazel
knows this is a helper class which doesn't contain tests.

Change-Id: Ie353c27526644ea9b47437b9bd9cd730a432ab29

18 months agoMerge branch 'stable-6.1' into stable-6.2 79/201479/3
Matthias Sohn [Wed, 26 Apr 2023 23:48:07 +0000 (01:48 +0200)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest
  Fix after_open config and Snapshotting RefDir tests to work with bazel
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings
  UploadPack: Fix NPE when traversing a tag chain

Change-Id: I9863cbce95d845efc891724898954b0b2f8dbf7b

18 months agoMerge branch 'stable-6.0' into stable-6.1 29/201529/1
Matthias Sohn [Wed, 26 Apr 2023 23:37:29 +0000 (01:37 +0200)]
Merge branch 'stable-6.0' into stable-6.1

* stable-6.0:
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest

Change-Id: I9c622de39200c6ee248d600736dc5db477f6bf9f

18 months agoMerge branch 'stable-5.13' into stable-6.0 28/201528/1
Matthias Sohn [Wed, 26 Apr 2023 23:07:47 +0000 (01:07 +0200)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest

Adapt GcConcurrentTest to changed FileRepositoryBuilder API.

Change-Id: I8906662a6391ceed20ab29cfbe238daf13e1be63

18 months agoGcConcurrentTest: @Ignore flaky testInterruptGc 27/201527/1
Jonathan Tan [Wed, 5 Apr 2023 20:44:59 +0000 (13:44 -0700)]
GcConcurrentTest: @Ignore flaky testInterruptGc

During my development of Id7721cc5b7ea650e77c2db47042715487983cae6, I
have found this test to be flaky when run by CI. As a speculative fix,
mark this test as @Ignore so it won't be run.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Change-Id: Idfe04d7f1fb72a772d4c8d249ca86a9c2eec0b1a

18 months agoFix CommitTemplateConfigTest 26/201526/1
Matthias Sohn [Wed, 26 Apr 2023 23:00:44 +0000 (01:00 +0200)]
Fix CommitTemplateConfigTest

The cherry-picked 61d4e313 doesn't match 5.13 APIs which changed in
newer versions.

Change-Id: I61ed0242472ed822028d86d3038f956f6bd5735c

18 months agoFix after_open config and Snapshotting RefDir tests to work with bazel 63/201463/3
Prudhvi Akhil Alahari [Mon, 24 Apr 2023 09:15:17 +0000 (14:45 +0530)]
Fix after_open config and Snapshotting RefDir tests to work with bazel

The changes I1db6fcf414b and I634b92877f added tests which were failing
with errors [1] and [2] with "bazel test //...". This was not caught
because we don't have CI running with bazel. Fix bazel build file so
that these errors are no longer thrown when run with bazel.

[1] error: cannot find symbol FileRepositoryBuilderTest
[2] error: cannot find symbol RefDirectoryTest

Bug: 581816
Signed-off-by: Prudhvi Akhil Alahari <quic_prudhvi@quicinc.com>
Change-Id: I1e57111662825f5f14f373bc4f8d24cce1fec0b8

18 months agoMerge branch 'stable-6.0' into stable-6.1 78/201478/2
Matthias Sohn [Wed, 26 Apr 2023 19:55:16 +0000 (21:55 +0200)]
Merge branch 'stable-6.0' into stable-6.1

* stable-6.0:
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings
  UploadPack: Fix NPE when traversing a tag chain

Change-Id: I5e13d5b5414aef97e518898166bfa166c692e60f

18 months agoMerge branch 'stable-5.13' into stable-6.0 21/201521/1
Matthias Sohn [Wed, 26 Apr 2023 19:40:22 +0000 (21:40 +0200)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings

Change-Id: I63b9adc22e1e1d9a9c754fe070ddfe21a52446c7

18 months ago[bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory 20/201520/1
Matthias Sohn [Wed, 12 Jan 2022 22:45:34 +0000 (23:45 +0100)]
[bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory

Move this test to another class and skip it when running tests with
bazel since the bazel test runner does not allow to create files in the
home directory.

FS#userHome retrieves the home directory on the first call and caches it
for subsequent calls to avoid overhead in case path translation is
required (currently on cygwin). This prevents that the test can mock the
home directory using MockSystemReader like SshTestHarness does.

Change-Id: I6a22f37f4a19eb4b4935509eae508a23e56db7aa

18 months agoDemote severity of some error prone bug patterns to warnings 19/201519/1
David Ostrovsky [Wed, 26 Apr 2023 08:08:25 +0000 (10:08 +0200)]
Demote severity of some error prone bug patterns to warnings

The code is not violation free, so demote the severity of these bug
patterns to warning:

o DefaultCharset
o FutureReturnValueIgnored
o UnusedException

Change-Id: Ie886a4a247770a74953385f018498ac2515ed209

19 months ago[bazel] Fix version number of bcpg-jdk18on 64/201464/1
Matthias Sohn [Mon, 24 Apr 2023 11:28:32 +0000 (13:28 +0200)]
[bazel] Fix version number of bcpg-jdk18on

Add the missing quotes around the version number.

Change-Id: Ia24484f50a4e771e046aa65621ae4779fff64d86