Eclipse JGit: Java implementation of Git 6.0.0

6.0.0

Description

Prerequisites

  • JGit 6.0 requires at least Java 11 to run

Features

  • 446355 Support commit.template git config option
  • ssh: Handle "ProxyJump none" from SSH config file
  • OpenSshConfigFile: update handling of line comments and quoted strings following changes in OpenSSH
  • OpenSshConfigFile: update token replacements. It appears that the OpenSSH documentation has changed; it now allows more flags for a number of keys.
  • [sshd agent] Introduce ConnectorDescriptor
  • Simplify SshdFtpChannel
  • 541274, 541275 sshd: add support for ssh-agent. Add a simple SSH agent connector using JNA. Include com.sum.jna and com.sun.jna.platform in the target platform. JNA is used to communicate through Unix domain sockets with ssh-agent, and if on Windows, to communicate via shared memory with Pageant. The new bundle o.e.j.ssh.apache.agent is an OSGi fragment so that the java.util.ServiceLoader can find the provided factory without further ado in OSGi environments. Adapt both maven and bazel builds to include the new bundle.    Manually tested on OS X, CentOS 7, and Win10 with Pageant 0.76.
  • 576971 Binary and CR-LF detection: lone CRs -> binary. C git considers not only files containing NUL bytes as binary but also files containing lone CRs. Implement this also for JGit. C git additionally counts printable vs. non-printable characters and considers files that have non_printable_count > printable_count / 128 also as binary. This is not implemented because such counting probably only makes sense if one looks at the full file or blob content. The Auto[CR]LF* streams in JGit look only at the first few KiB of a stream in order not to buffer too much.
  • 576971 Make the buffer size for text/binary detection configurable
  • GarbageCollectCommand: add numberOfBitmaps to statistics

API cleanup

  • Don't block in GC#gc until garbage collection finished. Let GC#gc return collection of newly created packs as CompletableFuture to enable using gc() asynchronously.
  • 549777 Let ObjectDatabase implement AutoClosable
  • 576340 [6.0 API cleanup] Public interface for PackLock. Provide a public interface PackLock exposing only the unlock() method. Rename the internal PackLock class to PackLockImpl and have it implement the new interface.
  • 576340 [6.0 API cleanup] StoredObjectRepresentationNotAvailableException. Remove the unused parameter, which had a non-API type anyway.
  • RepoCommand: Do not wrap GitApiExceptions in GitApiExceptions. While building the commit for the destination project, RepoCommand catches GitApiExceptions and wraps them into ManifestErrorException (a subclass of GitApiException). This hides the real exception from the caller and prevent them to do a fine-grained catch. Specifically this is problematic for gerrit's supermanifest plugin, that won't see ConcurrentRefUpdate exceptions to detect lock-failures. Use ManifestErrorException to wrap non-GitApiExceptions, let GitApiExceptions pass through as they are.
  • [6.0 API cleanup] CancelledException vs. CanceledException. Use the GitAPIException CanceledException instead of IOExceptionCancelledException in the rename detector.
  • 564544 Fix split package in bundle org.eclipse.jgit.ssh.jsch
  • 553116 Enable CommitCommand to use a fluent style

Performance Improvements

  • Make BinaryBlobException stackless
  • DFS block cache: allow multiple passes for blocks before eviction
  • Optimize RevWalk.getMergedInto()

Bug Fixes

  • 577492 FS: debug logging only if system config file cannot be found
  • AppServer: fix keystore used to setup test SSL context factory
  • 576604 Set JSch global config values only if not set already
  • 577358 Better git system config finding. We've used "GIT_EDITOR=edit git config --system --edit" to determine the location of the git system config for a long time. But git 2.34.0 always expects this command to have a TTY, but there isn't one when called from Java. If there isn't one, the Java process may get a SIGTTOU from the child process and hangs. Arguably it's a bug in C git 2.34.0 to unconditionally assume there was a tty. But JGit needs a fix *now*, otherwise any application using JGit will lock up if git 2.34.0 is installed on the machine. Therefore, use a different approach if the C git found is 2.8.0 or newer: parse the output of
    git config --system --show-origin --list -z
  • DFS block cache: harden against race over ref locks.
  • ssh: use a single SecureRandom instance for hashing hostnames
  • 575393 Fix checkout of files with mixed line endings on text=auto eol=crlf
  • Don't rely on an implicit default character set. JEP 400 (Java 18) will change the default character set to UTF-8 unconditionally. Introduce SystemReader.getDefaultCharset() that provides the locale-dependent charset the way JEP 400 recommends.
  • DFS block cache: fix lock issue and support parallel index loading
  • JSch: fix service publication for ServiceLoader
  • Fix missing peel-part in lsRefsV2 for loose annotated tags
  • Fix RevWalk.getMergedInto() ignores annotated tags
  • 573638 KeyGrip: fix build error on java 15
  • 576250 reftable: drop code for truncated reads
  • reftable: pass on invalid object ID in conversion
  • Fix running benchmarks from bazel

Build and Release Engineering

  • Implement RecordingLogger based on org.slf4j.Logger
  • Add 4.22 target platform for 2021-12
  • Update Orbit to R20211122181901 for 2021-12
  • Skip javadoc generation for test bundles.
  • Add missing .gitignore in o.e.j.ssh.apache.agent
  • [test] test OpenSshConfigFile directly, not via the JSch config
  • [releng] bazel: Enable errorprone on o.e.j.ssh.apache
  • [doc] Add README and package-info to the SSH bundles
  • Factor out parsing git-style size numbers to StringUtils
  • 534731 Remove use of deprecated getAllRefs() in UploadPack

Build

  • Upgrade plexus-compiler version to 2.9.0
  • Update tycho to 2.5.0 and target platform to jgit-4.17
  • Remove pack200 which is deprecated in Java 11 and isn't supported by tycho 2.5.0 anymore. It was specified in JSR 200 (J2SE 1.5), deprecated in JEP 336 (Java SE 11) and removed in JEP 367 (Java SE 14).
  • Update ecj to 3.27.0
  • Update errorprone to 2.9.0 and enable using it on java 16
  • update maven-enforcer-plugin 3.0.0
  • update maven-javadoc-plugin 3.3.1
  • update maven-pmd-plugin 3.15.0
  • update org.eclipse.cbi.maven.plugins:eclipse-jarsigner-plugin 1.3.2
  • update org.springframework.boot:spring-boot-maven-plugin 2.5.4
  • 575621 Add org.bouncycastle.bcutil to p2 repository

Update to Java 11

  • 569917 Bump minimum required Java version to 11
  • [releng] Make the bazel build use Java 11
  • Update the baseline target platform to jgit-4.17 corresponding to Eclipse 4.17 (2020-09). Delete all target platforms older than this version and the corresponding Orbit releases.
  • Replace XMLReaderFactory deprecated since Java 9
  • IndexDiffWithSymlinkTest: handle InaccessibleObjectException
  • Enable using JMH annotation processor on Java>=9
  • Enable compiler option --release

Dependencies

  • 571932, 576100 Update Jetty to 10.0.6
  • Update servlet-api to 4.0
  • Update com.google.gson to 2.8.8.v20211029-0838
  • Update com.googlecode.javaewah to 1.1.13.v20211029-0839
  • Update net.i2p.crypto.eddsa to 0.3.0.v20210923-1401
  • Update org.apache.ant to 1.10.12.v20211102-1452
  • Update org.apache.commons.compress to 1.21.0.v20211103-2100
  • Update org.bouncycastle.bcprov to 1.69.0.v20210923-1401
  • Update org.junit to 4.13.2.v20211018-1956
API Certification

The project leadership certifies that the APIs in this release are "Eclipse Quality".

Conforms To UI/UX Guidelines
Not verified
This release is part of Eclipse IDE 2021-12