]> source.dussan.org Git - jgit.git/log
jgit.git
2 years agossh: use a single SecureRandom instance for hashing hostnames 14/187714/5
Thomas Wolf [Sat, 13 Nov 2021 12:09:58 +0000 (13:09 +0100)]
ssh: use a single SecureRandom instance for hashing hostnames

According to Spotbugs, that's better practice. It's questionable
whether it makes a big difference, though, especially since the
hash is the cryptographically weak SHA1.

Change-Id: Id293de2bad809d9cc19230bd720184786dc6c226
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoOpenSshConfigFile: line comments and quoted strings 13/187713/5
Thomas Wolf [Sat, 13 Nov 2021 12:09:01 +0000 (13:09 +0100)]
OpenSshConfigFile: line comments and quoted strings

Bring our SSH config parser up-to-date with respect to changes in
OpenSSH. In particular, they fixed[1] the handling of line comments
such that #-characters inside strings are not considered. This means
that we have to parse strings with escaped quotes correctly.

[1] https://bugzilla.mindrot.org/show_bug.cgi?id=3288

Change-Id: Ifbd9014127e8d51e7c8792e237f3fc2a9a0719d2
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoOpenSshConfigFile: update token replacements 12/187712/2
Thomas Wolf [Sat, 13 Nov 2021 12:08:14 +0000 (13:08 +0100)]
OpenSshConfigFile: update token replacements

It appears that the OpenSSH documentation[1] has changed; it now allows
more flags for a number of keys.

[1] https://man.openbsd.org/ssh_config.5#TOKENS

Change-Id: I55df174f86a3fd4a6ef22687dc433ac9f9ad181d
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoMerge "Upgrade plexus-compiler version to 2.9.0"
Matthias Sohn [Mon, 15 Nov 2021 15:57:32 +0000 (10:57 -0500)]
Merge "Upgrade plexus-compiler version to 2.9.0"

2 years agoAdd missing .gitignore in o.e.j.ssh.apache.agent 30/187730/1
Thomas Wolf [Mon, 15 Nov 2021 09:37:36 +0000 (10:37 +0100)]
Add missing .gitignore in o.e.j.ssh.apache.agent

Ignore /bin and /target.

Change-Id: I38f3748273b5243c54e010bfceac745084755f45
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoUpgrade plexus-compiler version to 2.9.0 41/187641/2
Marco Miller [Thu, 11 Nov 2021 14:17:54 +0000 (09:17 -0500)]
Upgrade plexus-compiler version to 2.9.0

Change-Id: I24ac698d3ccc01e79464b061068944ca82e8383b
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
2 years ago[sshd agent] Introduce ConnectorDescriptor 73/187573/2
Thomas Wolf [Wed, 27 Oct 2021 12:03:10 +0000 (14:03 +0200)]
[sshd agent] Introduce ConnectorDescriptor

Once a factory supports different SSH agents on the same platform,
which is planned for Windows once we use Apache MINA sshd 2.8.0,
client code may need to have a way to specify which SSH agent shall
be used when the SSH config doesn't define anything.

Add a mechanism by which a ConnectorFactory can tell what Connectors
it may provide. Client code can use this to set the identityAgent
parameter of ConnectorFactory.create() to the wanted default if it
would be null otherwise.

A ConnectorDescriptor is a pair of strings: an internal name, and a
display name. The latter is included because client code might want to
communicate agent names to the user, be it in error messages or in some
chooser dialog where a user could define which of several alternative
SSH agents should be used as default. The internal name is intended to
be used in the IdentityAgent directive in ~/.ssh/config.

Also make the ConnectorFactory discovered via the ServiceLoader
accessible and overrideable. Provide static get/setDefault() methods,
similar to the SshSessionFactory itself.

Change-Id: Ie3d077395d32dfddc72bc8627e92b23636938182
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoUpdate version of last release defining the API baseline to 5.13.0 94/187594/1
Matthias Sohn [Wed, 10 Nov 2021 14:56:36 +0000 (15:56 +0100)]
Update version of last release defining the API baseline to 5.13.0

Change-Id: I48e0d677a466a364fdd699cdb00014a9a65d082a

2 years agoUpdate Orbit to S20211108222137 85/187585/1
Matthias Sohn [Wed, 10 Nov 2021 13:51:29 +0000 (14:51 +0100)]
Update Orbit to S20211108222137

and update dependencies:
- com.google.gson to 2.8.8.v20211029-0838
- com.googlecode.javaewah to 1.1.13.v20211029-0839
- net.i2p.crypto.eddsa to 0.3.0.v20210923-1401
- org.apache.ant to 1.10.12.v20211102-1452
- org.apache.commons.compress to 1.21.0.v20211103-2100
- org.bouncycastle.bcprov to 1.69.0.v20210923-1401
- org.junit to 4.13.2.v20211018-1956

Change-Id: I90ca64f6d9f2a15c9a5d9a27d48956182f1698b4

2 years agoUpdate README 45/187445/2
Thomas Wolf [Sat, 6 Nov 2021 23:47:14 +0000 (00:47 +0100)]
Update README

* Java 11 now
* Mention new bundle org.eclipse.jgit.ssh.apache.agent
* Be honest about missing features: there are quite a few

Change-Id: Ie08a2b4581024febe1983a59414cf69845ebff96
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoUpdate jetty to 9.4.44.v20210927 65/187365/3
Matthias Sohn [Thu, 4 Nov 2021 23:13:52 +0000 (00:13 +0100)]
Update jetty to 9.4.44.v20210927

Change-Id: Iaa1478af0fe0ccfa1daf1cf44e4eef609e7ad8bb

2 years agoSimplify SshdFtpChannel 58/187358/1
Thomas Wolf [Sun, 31 Oct 2021 16:29:04 +0000 (17:29 +0100)]
Simplify SshdFtpChannel

Apache MINA sshd has simpler API for reading directories, and it has a
functional interface suitable for us. So no need to use our own
interface, or to deal with low-level abstractions like CloseableHandle.

Change-Id: Ic125c587535670504983f157a696b41ed6a76bb7
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years ago[test] test OpenSshConfigFile directly, not via the JSch config 52/186452/2
Thomas Wolf [Wed, 13 Oct 2021 20:21:52 +0000 (22:21 +0200)]
[test] test OpenSshConfigFile directly, not via the JSch config

This is a prerequisite for removing the JSch support bundle; otherwise
OpenSshConfigFile would be left without tests.

Copy OpenSshConfigTest from the JSch support bundle and adapt all tests
to perform the equivalent checks on OpenSshConfigFile directly. Add a
new lookupDefault() method to the SshConfigStore interface and implement
it so that it behaves the same and the tests work identically.

Change-Id: I046abd9197a8484003e77005024e5d973456f1a3

2 years agosshd: add support for ssh-agent 59/186859/11
Thomas Wolf [Tue, 2 Nov 2021 17:48:25 +0000 (18:48 +0100)]
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. Tested
by installing JGit built from this change into freshly downloaded
Eclipse 2021-12 M1, and then doing git fetches via SSH with different
~/.ssh/config settings (explicit IdentityFile, without any but a key in
the agent, with no keys and a key in the agent and IdentitiesOnly=yes
(must fail)).

Bug: 541274
Bug: 541275
Change-Id: I34e85467293707dbad1eb44d1f40fc2e70ba3622
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agosshd: prepare for using an SSH agent 58/186858/7
Thomas Wolf [Wed, 20 Oct 2021 07:51:43 +0000 (09:51 +0200)]
sshd: prepare for using an SSH agent

Add interfaces Connector and ConnectorFactory. A "connector" is just
something that knows how to connect to an ssh-agent and then can make
simple synchronous RPC-style requests (request-reply).

Add a way to customize an SshdSessionFactory with a ConnectorFactory.
Provide a default setup using the Java ServiceLoader mechanism to
discover an ConnectorFactory.

Implement an SshAgentClient in the internal part. Unfortunately we
cannot re-use the implementation in Apache MINA sshd: it's hard-wired
to Apache Tomcat APR, and it's also buggy.

No behavior changes yet since there is nothing that would provide an
actual ConnectorFactory. So for Apache MINA sshd, the SshAgentFactory
remains null as before.

Change-Id: I963a3d181357df2bdb66298bc702f2b9a6607a30
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years ago[releng] bazel: Enable errorprone on o.e.j.ssh.apache 42/187242/2
Thomas Wolf [Tue, 2 Nov 2021 18:20:59 +0000 (19:20 +0100)]
[releng] bazel: Enable errorprone on o.e.j.ssh.apache

Fix the few issues reported. (None serious.)

Change-Id: I8d72ef7d425ab61f4c27b657c92fc021850730d6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years ago[releng] Make the bazel build use Java 11 41/187241/2
Thomas Wolf [Tue, 2 Nov 2021 17:47:26 +0000 (18:47 +0100)]
[releng] Make the bazel build use Java 11

Make the default toolchain use Java 11, and fix two errorprone findings
introduced recently.

Change-Id: Iff51206fe8bdf096cb7d88cb1a499002550766cd
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoMerge branch 'stable-5.13' 93/187293/1
Matthias Sohn [Wed, 3 Nov 2021 22:25:17 +0000 (23:25 +0100)]
Merge branch 'stable-5.13'

* stable-5.13:
  Fix target platforms

Change-Id: Iabbbacd6acde07a2e0ff156842b928a3ba18b4c6

2 years agoMerge branch 'stable-5.12' into stable-5.13 92/187292/1
Matthias Sohn [Wed, 3 Nov 2021 22:18:21 +0000 (23:18 +0100)]
Merge branch 'stable-5.12' into stable-5.13

* stable-5.12:
  Fix target platforms

- jetty 9.4.43 moved to archive.eclipse.org
- use the final release p2 repo instead of staging for 2021-09

Change-Id: I35c1264b8e9c63874663141288dca03b47f263ed

2 years agoMerge branch 'stable-5.11' into stable-5.12 90/187290/1
Matthias Sohn [Wed, 3 Nov 2021 22:13:39 +0000 (23:13 +0100)]
Merge branch 'stable-5.11' into stable-5.12

* stable-5.11:
  Fix target platforms

- jetty 9.4.41 moved to archive.eclipse.org
- use the final release p2 repo instead of staging for 2021-06

Change-Id: I7a02b1fe271910dd82acf45242d8425aba2f52f9

2 years agoMerge branch 'stable-5.10' into stable-5.11 89/187289/1
Matthias Sohn [Wed, 3 Nov 2021 22:09:15 +0000 (23:09 +0100)]
Merge branch 'stable-5.10' into stable-5.11

* stable-5.10:
  Fix target platforms

- jetty 9.4.36 moved to archive.eclipse.org
- use the final release p2 repo instead of staging for 2021-03

Change-Id: I6ce2294bb150fedf8ded7fe6c1e23019d9c178d6

2 years agoMerge branch 'stable-5.9' into stable-5.10 88/187288/1
Matthias Sohn [Wed, 3 Nov 2021 22:01:44 +0000 (23:01 +0100)]
Merge branch 'stable-5.9' into stable-5.10

* stable-5.9:
  Fix target platforms

Change-Id: Ib1876923ba98252682f41a03877792fd22b418d6

2 years agoFix target platforms 87/187287/1
Matthias Sohn [Wed, 3 Nov 2021 21:40:48 +0000 (22:40 +0100)]
Fix target platforms

- jetty 9.4.30 moved to archive.eclipse.org
- use the final release p2 repo instead of staging for 2020-09

Change-Id: Ia096200e5983f0022c6c0da4dae035433e852807

2 years ago[doc] Add README and package-info to the SSH bundles 00/187200/1
Thomas Wolf [Sun, 31 Oct 2021 13:57:30 +0000 (14:57 +0100)]
[doc] Add README and package-info to the SSH bundles

Explain in the JSch bundle that it is essentially unmaintained. Add
descriptions in both bundles explaining how to use it, or how to use
an alternate implementation.

Change-Id: Idaf46c33b14543279f78a55cb7c6bd42b06ee6b8
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoBinary and CR-LF detection: lone CRs -> binary 98/187198/1
Thomas Wolf [Sat, 30 Oct 2021 23:35:52 +0000 (01:35 +0200)]
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.

For the C git implementation, see [1].

[1] https://github.com/git/git/blob/7e27bd589d/convert.c#L35

Bug: 576971
Change-Id: Ia169b59bdbf1477f32ee2014eeb8406f81d4b1ab
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoFactor out parsing git-style size numbers to StringUtils 90/187190/2
Thomas Wolf [Sat, 30 Oct 2021 17:37:44 +0000 (19:37 +0200)]
Factor out parsing git-style size numbers to StringUtils

Move the code to parse numbers with an optional 'k', 'm', or 'g' suffix
from the config file handling to StringUtils. This enables me to re-use
it in EGit, which has duplicate code in StorageSizeFieldEditor.

As this is generally useful functionality, providing it in the library
makes sense.

Change-Id: I86e4f5f62e14f99b35726b198ba3bbf1669418d9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoMake the buffer size for text/binary detection configurable 89/187189/2
Thomas Wolf [Tue, 12 Oct 2021 22:28:38 +0000 (00:28 +0200)]
Make the buffer size for text/binary detection configurable

The various streams used in JGit for text/binary and CR-LF detection
used different buffer sizes. Most used 8000, but one used 8KiB, and one
used 8096 (SIC!) bytes.

Considering only the first 8kB of a file/blob is not sufficient; it
may give behavior incompatible with C git. C git considers the whole
blob; since it uses memory-mapped files it can do so with acceptable
performance. Doing this in JGit would most likely incur a noticeable
performance penalty. But 8kB is a bit small; in the file in bug 576971
the limit was hit before the first CR-LF, which occurred on line 155
at offset 9759 in the file.

Make RawText.FIRST_FEW_BYTES only a default and minimum setting, and
set it to 8KiB. Make the actual buffer size configurable: provide
static methods getBufferSize() and setBuffersize(), and use
getBufferSize() throughout instead of the constant.

This enables users of the JGit library to set their own possibly larger
buffer size.

Bug: 576971
Change-Id: I447762c9a5147a521f73d2864ba59ed89f555d54
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoMerge branch 'stable-6.0' 86/187086/1
Matthias Sohn [Thu, 28 Oct 2021 12:27:29 +0000 (14:27 +0200)]
Merge branch 'stable-6.0'

* stable-6.0:
  Prepare 6.0.0-SNAPSHOT builds
  JGit v6.0.0.202110270955-m2
  Prepare 6.0.0-SNAPSHOT builds
  JGit v6.0.0.202110060947-m1

Change-Id: I3c0f760ce13b6afbfb06ebd569ce0162b531d67d

2 years agoPrepare 6.0.0-SNAPSHOT builds 71/187071/1
Matthias Sohn [Thu, 28 Oct 2021 07:20:25 +0000 (09:20 +0200)]
Prepare 6.0.0-SNAPSHOT builds

Change-Id: Iff7b4f834ecb43c7a0a9bf79bb8b30dd10d1fa07

2 years agoJGit v6.0.0.202110270955-m2 34/187034/1 v6.0.0.202110270955-m2
Matthias Sohn [Wed, 27 Oct 2021 12:54:49 +0000 (14:54 +0200)]
JGit v6.0.0.202110270955-m2

Change-Id: I8057bbbf6acd478ad062e30cf5cbfc287531a66a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2 years agoMerge branch 'master' into stable-6.0 30/187030/1
Matthias Sohn [Wed, 27 Oct 2021 12:48:15 +0000 (14:48 +0200)]
Merge branch 'master' into stable-6.0

* master:
  Fix checkout of files with mixed line endings on text=auto eol=crlf
  Don't rely on an implicit default character set
  Fix bad indentation in pom.xml
  Minor code-clean-up in OpenSshConfigFile
  Remove use of deprecated getAllRefs() in UploadPack
  DFS block cache: fix lock issue and support parallel index loading
  JSch: fix service publication for ServiceLoader
  Set JSch global config values only if not set already
  Fix missing peel-part in lsRefsV2 for loose annotated tags
  DFS block cache: allow multiple passes for blocks before eviction
  Fix RevWalk.getMergedInto() ignores annotated tags
  Optimize RevWalk.getMergedInto()
  GarbageCollectCommand: add numberOfBitmaps to statistics
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix running benchmarks from bazel
  Update eclipse-jarsigner-plugin to 1.3.2
  Add org.bouncycastle.bcutil to p2 repository

Change-Id: Icaa36ded0439853a05ce21de9282e69d87a32284

2 years agoFix checkout of files with mixed line endings on text=auto eol=crlf 07/186407/3
Thomas Wolf [Tue, 12 Oct 2021 20:14:33 +0000 (22:14 +0200)]
Fix checkout of files with mixed line endings on text=auto eol=crlf

Add tests for files having been checked in with mixed LF and CR-LF
line endings, and then being checked out with text or text=auto and
eol=lf or eol=crlf. These test cases were missing, and thus commit
efd1cc05 missed that AutoCRLFOutputStream needs the same detection
as AutoLFOutputStream.

Fix AutoCRLFOutputStream to not convert line endings if the blob in
the repository contains CR-LF.

Bug: 575393
Change-Id: Id0c7ae772e282097e95fddcd3f1f9d82aae31e43
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoDon't rely on an implicit default character set 95/185995/3
Thomas Wolf [Fri, 3 Sep 2021 17:49:27 +0000 (19:49 +0200)]
Don't rely on an implicit default character set

JEP 400 (Java 18) will change the default character set to UTF-8
unconditionally.[1] Introduce SystemReader.getDefaultCharset() that
provides the locale-dependent charset the way JEP 400 recommends.

Change all code locations using Charset.defaultCharset() to use the
new SystemReader method instead.

[1] https://openjdk.java.net/jeps/400

Change-Id: I986f97a410d2fc70748b6f93228a2d45ff100b2c
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoFix bad indentation in pom.xml 69/186869/1
Thomas Wolf [Sun, 24 Oct 2021 19:32:33 +0000 (21:32 +0200)]
Fix bad indentation in pom.xml

Change-Id: I683f190d6914fb48f32cc3b3f0910b4264c7d725
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoMinor code-clean-up in OpenSshConfigFile 57/186857/2
Thomas Wolf [Wed, 20 Oct 2021 19:17:55 +0000 (21:17 +0200)]
Minor code-clean-up in OpenSshConfigFile

Change-Id: I45d50198e43aeb2a56c74026de7ee8c1a30f9d10
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoRemove use of deprecated getAllRefs() in UploadPack 78/182378/5
Matthias Sohn [Wed, 23 Jun 2021 08:38:50 +0000 (10:38 +0200)]
Remove use of deprecated getAllRefs() in UploadPack

Repository.getAllRefs() is deprecated and should not
be used anymore.

Bug: 534731
Change-Id: I037a9b901275bfa7952b4c79861d7639c9d42715

2 years agoDFS block cache: fix lock issue and support parallel index loading 55/186455/5
Alina Djamankulova [Wed, 13 Oct 2021 20:16:41 +0000 (13:16 -0700)]
DFS block cache: fix lock issue and support parallel index loading

This change is a fix to http://git.eclipse.org/r/c/jgit/jgit/+/183562
that was reverted in http://git.eclipse.org/r/c/jgit/jgit/+/184978
due to deadlocks. Separate locks in DfsBlockFile are removed to rely
on getting value from DfsBlockCache with region locking in place.

With this change bitmap index creation is not blocked on index and
reverse index full initialization in DfsPackFile. Now bitmap index
and index could be read from storage in parallel in separate threads.

A unit test is added for parallel index loading.

Signed-off-by: Alina Djamankulova <adjama@google.com>
Change-Id: Ic6d9c5a4a254628636aa98a5008447a27a003f69

2 years agoMerge changes I1f180d7f,I04415f07
Thomas Wolf [Tue, 19 Oct 2021 09:38:54 +0000 (05:38 -0400)]
Merge changes I1f180d7f,I04415f07

* changes:
  JSch: fix service publication for ServiceLoader
  Set JSch global config values only if not set already

2 years agoJSch: fix service publication for ServiceLoader 43/186643/1
Thomas Wolf [Tue, 19 Oct 2021 07:32:20 +0000 (09:32 +0200)]
JSch: fix service publication for ServiceLoader

The file name in META-INF/services must be the fully qualified
interface name; the content the fully qualified implementation class
name.

This was broken in commit 9683bc71.

Add a test for the default factory being found by the ServiceLoader.

Change-Id: I1f180d7f60e5c1e74a39bbd9a5f0099bd8343e21
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2 years agoSet JSch global config values only if not set already 38/186638/1
Thomas Wolf [Tue, 19 Oct 2021 07:07:14 +0000 (09:07 +0200)]
Set JSch global config values only if not set already

Bug: 576604
Change-Id: I04415f07bf2023bc8435c097d1d3c65221d563f1
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoMerge branch 'stable-5.13' 60/186560/1
Matthias Sohn [Fri, 15 Oct 2021 21:10:12 +0000 (23:10 +0200)]
Merge branch 'stable-5.13'

* stable-5.13:
  Fix missing peel-part in lsRefsV2 for loose annotated tags
  Fix RevWalk.getMergedInto() ignores annotated tags
  Optimize RevWalk.getMergedInto()
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix running benchmarks from bazel
  Update eclipse-jarsigner-plugin to 1.3.2
  Add org.bouncycastle.bcutil to p2 repository

Change-Id: I789e3c84045cc9dcd8a26de34d09fc1e3ccc41e7

3 years agoMerge branch 'stable-5.12' into stable-5.13 56/186556/1
Matthias Sohn [Fri, 15 Oct 2021 20:58:21 +0000 (22:58 +0200)]
Merge branch 'stable-5.12' into stable-5.13

* stable-5.12:
  Fix missing peel-part in lsRefsV2 for loose annotated tags
  Fix RevWalk.getMergedInto() ignores annotated tags
  Optimize RevWalk.getMergedInto()
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix running benchmarks from bazel
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: Ie5da8d2d07f39ab5aaeca560040637635d4eb04c

3 years agoMerge branch 'stable-5.11' into stable-5.12 55/186555/1
Matthias Sohn [Fri, 15 Oct 2021 20:48:01 +0000 (22:48 +0200)]
Merge branch 'stable-5.11' into stable-5.12

* stable-5.11:
  Fix missing peel-part in lsRefsV2 for loose annotated tags
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix running benchmarks from bazel
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: I2122b3966bddb10d43d439eb8c5d6cc4583c6ba6

3 years agoMerge branch 'stable-5.10' into stable-5.11 53/186553/1
Matthias Sohn [Fri, 15 Oct 2021 20:45:18 +0000 (22:45 +0200)]
Merge branch 'stable-5.10' into stable-5.11

* stable-5.10:
  Fix missing peel-part in lsRefsV2 for loose annotated tags
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix running benchmarks from bazel
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: I23ccb89306263ce042ce782d881812d4b5187672

3 years agoMerge branch 'stable-5.9' into stable-5.10 52/186552/1
Matthias Sohn [Fri, 15 Oct 2021 20:32:00 +0000 (22:32 +0200)]
Merge branch 'stable-5.9' into stable-5.10

* stable-5.9:
  Fix missing peel-part in lsRefsV2 for loose annotated tags
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2
  Fix running benchmarks from bazel
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: I4e7c7727ebfa9a7748477f2300bd66d775548ad6

3 years agoFix missing peel-part in lsRefsV2 for loose annotated tags 20/186520/4
Saša Živkov [Fri, 15 Oct 2021 08:13:53 +0000 (10:13 +0200)]
Fix missing peel-part in lsRefsV2 for loose annotated tags

We observed the following issue:

  $ git tag -a v1.0 -m v1.0
  $ git push origin tag v1.0
  $ git ls-remote origin v1.0^{}
  ... empty result ...

  On the server (Gerrit) side run git-gc to pack the refs:
  $ git gc

  Repeat the ls-remote from the client and the result is correct:
  $ git ls-remote origin v1.0^{}
  7ad85c810de3ae922903d4bdd17c53cd627260ba        refs/tags/v1.0^{}

Unfortunately, the existing UploadPackTest didn't reveal this issue
although it provided the test case needed to do so: testV2LsRefsPeel.
This is because The UploadPackTest uses InMemoryRepository which
internally uses Dfs* implementations. The issue is only reproducible
when using the FileRepository.

It is a non-trivial task to refactor the UploadPackTest to work against
both InMemoryRepository and FileRepository and this change is not trying
to do that. This change creates a new test:
UploadPackLsRefsFileRepositoryTest and copies the necesssary code from
the UploadPackTest.

Change-Id: Icfc7d0ca63f1524bafe24c9626ce12ea72aa3718
Signed-off-by: Saša Živkov <sasa.zivkov@sap.com>
3 years agoDFS block cache: allow multiple passes for blocks before eviction 41/184341/6
Alina Djamankulova [Tue, 24 Aug 2021 01:22:41 +0000 (18:22 -0700)]
DFS block cache: allow multiple passes for blocks before eviction

Let certain pack extensions that are expensive to load from storage
(e.g. pack index, bitmap index) stay in DFS block cache longer than
others by overriding default cache count through DfsBlockCacheConfig

Don't change default behavior when cache override map is empty. Use int
cacheCount instead of boolean hot for Ref<T>

Signed-off-by: Alina Djamankulova <adjama@google.com>
Change-Id: I18062784ec9cc14dbba3e4bb8d9509440cf2d44f

3 years agoFix RevWalk.getMergedInto() ignores annotated tags 01/184901/5
kylezhao [Thu, 2 Sep 2021 03:53:48 +0000 (11:53 +0800)]
Fix RevWalk.getMergedInto() ignores annotated tags

If an annotated tag refers to a commit, we should not ignore it.

Change-Id: I77504f93636e9e984540e7d8535ef301adce6a80
Signed-off-by: kylezhao <kylezhao@tencent.com>
3 years agoOptimize RevWalk.getMergedInto() 06/184806/6
kylezhao [Tue, 31 Aug 2021 11:36:44 +0000 (19:36 +0800)]
Optimize RevWalk.getMergedInto()

Transitive Relation Definition:
On the DAG of commit history, if A can reach B, C can reach A, then C
can reach B.

Example:
As is shown in the graph below:

  1 - 2 - 3 - 4 (side)
            \
             5 -  6^ (master) - 7 (topic)

Find out which branches is 2 merged into:
After we calculated that master contains 2, we can mark 6 as TEMP_MARK
to avoid unwanted walks.
When we want to figure out if 2 is merge into the topic, the traversal
path would be [7, 6] instead of [7, 6, 5, 3, 2].

Test:
This change can significantly improve performance for tags.
On a copy of the Linux repository, the command 'git tag --contains
<commit>' had the following performance improvement:

commit      | Before   | After   | Rel %
47a44d27ca  | 29251ms  | 6687ms  | -77%
90327e7dff  | 21388ms  | 6256ms  | -70%
f85fac0efa  | 11150ms  | 7338ms  | -34%

The current version ignores tags, even though the tag is a type of
the ref.
Follow-up commits I'll fix it.

Change-Id: Ie6295ca4d16070499912af462239e679a97cce47
Signed-off-by: kylezhao <kylezhao@tencent.com>
Reviewed-by: Christian Halstrick <christian.halstrick@sap.com>
Reviewed-by: Martin Fick <mfick@codeaurora.org>
3 years agoGarbageCollectCommand: add numberOfBitmaps to statistics 80/185880/5
kylezhao [Tue, 28 Sep 2021 02:48:11 +0000 (10:48 +0800)]
GarbageCollectCommand: add numberOfBitmaps to statistics

Change-Id: I630afac9408c7313d1cecb1b24476f645c94fc27
Signed-off-by: kylezhao <kylezhao@tencent.com>
3 years agoMerge branch 'stable-5.8' into stable-5.9 99/186299/1
Matthias Sohn [Thu, 7 Oct 2021 22:36:14 +0000 (00:36 +0200)]
Merge branch 'stable-5.8' into stable-5.9

* stable-5.8:
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: I9e66ef90dc9a65bac47b35705d679bf992bd72b9

3 years agoMerge branch 'stable-5.7' into stable-5.8 97/186297/1
Matthias Sohn [Thu, 7 Oct 2021 22:33:33 +0000 (00:33 +0200)]
Merge branch 'stable-5.7' into stable-5.8

* stable-5.7:
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: I88c47ff57f4829baec5b19aad3d8d6bd21f31a86

3 years agoMerge branch 'stable-5.6' into stable-5.7 96/186296/1
Matthias Sohn [Thu, 7 Oct 2021 22:18:42 +0000 (00:18 +0200)]
Merge branch 'stable-5.6' into stable-5.7

* stable-5.6:
  reftable: drop code for truncated reads
  reftable: pass on invalid object ID in conversion
  Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: I1c18f5f435f4a4a86e0548a310dbfc74191e1ed5

3 years agoPrepare 6.0.0-SNAPSHOT builds 46/186246/1
Matthias Sohn [Wed, 6 Oct 2021 19:09:26 +0000 (21:09 +0200)]
Prepare 6.0.0-SNAPSHOT builds

Change-Id: Iac4504923b34e29b5981cb77fdbe9e4cac7e625e

3 years agoJGit v6.0.0.202110060947-m1 25/186225/1 v6.0.0.202110060947-m1
Matthias Sohn [Wed, 6 Oct 2021 13:47:07 +0000 (15:47 +0200)]
JGit v6.0.0.202110060947-m1

Change-Id: I182115d974d5ef3e611e0e082667d7e51d8babd0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoRename a local variable 94/185994/1
Thomas Wolf [Thu, 30 Sep 2021 15:16:30 +0000 (17:16 +0200)]
Rename a local variable

To avoid a warning about a name clash with the field.

Change-Id: Ib1950486a9c63647e4240a268a3c9a7d613f3303
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoRemove redundant type arguments 63/185963/1
Thomas Wolf [Thu, 30 Sep 2021 07:31:12 +0000 (09:31 +0200)]
Remove redundant type arguments

In Java 11 type arguments for anonymous subclasses can be inferred
and don't need to be specified. This resolves a number of compiler
warnings.

Change-Id: I55eff3babb7628aa0627085e65a1b45eb12c2cd3
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoDelete old target platforms and corresponding Orbit releases 25/185925/4
Matthias Sohn [Wed, 29 Sep 2021 00:10:34 +0000 (02:10 +0200)]
Delete old target platforms and corresponding Orbit releases

We updated 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.

Change-Id: I93b2d8585bdc3c3312264d34657ceaf3f4a27bd5

3 years agoUpdate tycho to 2.5.0 and target platform to jgit-4.17 24/185924/4
Matthias Sohn [Wed, 29 Sep 2021 00:03:02 +0000 (02:03 +0200)]
Update tycho to 2.5.0 and target platform to jgit-4.17

jgit-4.17 corresponds to Eclipse 2020-09, which is the first Eclipse
version that required Java 11, and which is JGit's new baseline as of
JGit 6.0.

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) [1],
deprecated in JEP 336 (Java SE 11) [2] and removed in JEP 367 (Java SE
14) [3].

[1] https://www.jcp.org/en/jsr/detail?id=200
[2] https://openjdk.java.net/jeps/336
[3] https://openjdk.java.net/jeps/367

Change-Id: I12c196586397779d2be81d2374207703e3fc5dbf

3 years agoUpdate ecj to 3.27.0 23/185923/3
Matthias Sohn [Tue, 28 Sep 2021 23:58:43 +0000 (01:58 +0200)]
Update ecj to 3.27.0

Change-Id: Ia3845a14d8169595425fd435ef3ef09c08e82f53

3 years agoReplace XMLReaderFactory deprecated since Java 9 47/185347/8
Matthias Sohn [Sun, 12 Sep 2021 23:47:08 +0000 (01:47 +0200)]
Replace XMLReaderFactory deprecated since Java 9

Change-Id: Ie8a9d411fc19e8b7bf86c0b4df0b02153a0e9444

3 years agoIndexDiffWithSymlinkTest: handle InaccessibleObjectException 46/185346/9
Matthias Sohn [Sun, 12 Sep 2021 23:02:26 +0000 (01:02 +0200)]
IndexDiffWithSymlinkTest: handle InaccessibleObjectException

On Java 16 this test throws InaccessibleObjectException, handle and
ignore it similar to IllegalAccessException.

Change-Id: I19b4f577579694a146516861a7ec567141f3464b

3 years agoFix split package in bundle org.eclipse.jgit.ssh.jsch 45/185345/9
Matthias Sohn [Sun, 12 Sep 2021 21:35:33 +0000 (23:35 +0200)]
Fix split package in bundle org.eclipse.jgit.ssh.jsch

The package org.eclipse.jgit.transport was split between
org.eclipse.jgit and org.eclipse.jgit.ssh.jsch.

Bug: 564544
Change-Id: I91d38e67c65ed97a880f8dc8f9559663b9eec33b

3 years agoKeyGrip: fix build error on java 15 44/185344/8
Matthias Sohn [Sun, 12 Sep 2021 19:40:04 +0000 (21:40 +0200)]
KeyGrip: fix build error on java 15

CryptlibObjectIdentifiers can't be used because bouncycastle doesn't
export the package org.bouncycastle.asn1.cryptlib.

Bug: 573638
Change-Id: I1f9e2af02d9fec69d2249a7d78301ba4b333a9ba

3 years agoEnable using JMH annotation processor on Java>=9 81/185681/4
Matthias Sohn [Tue, 21 Sep 2021 21:24:47 +0000 (23:24 +0200)]
Enable using JMH annotation processor on Java>=9

See
- https://issues.apache.org/jira/browse/MCOMPILER-369
- https://stackoverflow.com/questions/53927874/jmh-doesnt-run-inside-a-java-module-unable-to-find-the-resource-meta-inf-ben

Change-Id: Ie810092399d9fe540e5c2e243d3fdb19493c6bcb

3 years agoUpdate errorprone to 2.9.0 and enable using it on java 16 43/185343/7
Matthias Sohn [Sun, 12 Sep 2021 16:44:08 +0000 (18:44 +0200)]
Update errorprone to 2.9.0 and enable using it on java 16

Enabling <fork>true</fork> and setting the --add-exports= flags is
required on JDK 16 due to JEP 396: Strongly Encapsulate JDK Internals by
Default.

see https://errorprone.info/docs/installation
and https://openjdk.java.net/jeps/396

Change-Id: I03c257ffb48f429dd7d49a403d65c700abe133ca

3 years ago[errorprone] fix ReturnValueIgnored in PushCertificateStore#next 42/185342/7
Matthias Sohn [Sun, 12 Sep 2021 18:17:47 +0000 (20:17 +0200)]
[errorprone] fix ReturnValueIgnored in PushCertificateStore#next

Change-Id: I8deb7fa702bb973436b7ca21edf3634a087047b7

3 years ago[errorprone] NameRevCommand: remove ignored call of #toString 41/185341/7
Matthias Sohn [Sun, 12 Sep 2021 16:46:01 +0000 (18:46 +0200)]
[errorprone] NameRevCommand: remove ignored call of #toString

This fixes errorprone error: [ReturnValueIgnored] Return value of
'toString' must be used.

Change-Id: I90d2725ae16725a053179322cfaab18cab7b8e68

3 years agoEnable compiler option --release 32/174132/9
Matthias Sohn [Mon, 28 Dec 2020 17:51:57 +0000 (18:51 +0100)]
Enable compiler option --release

This ensures the compiler compiles against the public, supported and
documented API for a specific VM version (here 11) [1]. This also means
that
we don't need EE descriptors in Eclipse anymore in order to ensure that
only supported APIs of the selected Java version can be used.

According to [2] if option --release is used --source and --target
options can't be used.

While we are at it also add default value for all new jdt core options
added in Eclipse 4.21.

[1] https://docs.oracle.com/en/java/javase/11/tools/javac.html
[2] https://docs.oracle.com/en/java/javase/14/docs/specs/man/javac.html#option-release

Change-Id: I852a5d7b0a3210751c15d79ec91915b4c01c41e2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoBump minimum required Java version to 11 28/174128/8
Matthias Sohn [Sun, 27 Dec 2020 10:50:52 +0000 (11:50 +0100)]
Bump minimum required Java version to 11

Bug: 569917
Change-Id: Ifdcdb022a3f29321b4d10da1cc34acca68ed7b03
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoreftable: drop code for truncated reads 02/185902/4
Han-Wen Nienhuys [Tue, 28 Sep 2021 18:05:03 +0000 (20:05 +0200)]
reftable: drop code for truncated reads

The reftable format is a block based format, but allows for variably
sized blocks. This obviously happens for reflog blocks (which are zlib
compressed), but is also accepted for index blocks: In the spec, this
is motivated as

     To achieve constant O(1) disk seeks for lookups the index must be
     a single level, which is permitted to exceed the file's
     configured block size, but not the format's max block size of
     15.99 MiB.

Hence, when parsing a block, one cannot be sure of its exact size:
after reading a default-size block (eg. 4kb), the block header may
state that the block is in fact larger.

Before, the code would mark the block as `truncated`, noting

     // Its OK during sequential scan for an index block to have been
     // partially read and be truncated in-memory. This happens when
     // the index block is larger than the file's blockSize. Caller
     // will break out of its scan loop once it sees the blockType.

This looks like either

* a remnant of never-implemented functionality. There is no reason to
  ever sequentially scan an index block.

* alluding to sequential scan of the data blocks before the index
  blocks (eg. scanning refs, which ends when we find the first ref index
  block, and we can then ignore the index block).

This comment is followed by code that populates the
restartTbl/restartCnt fields relative to the (possibly truncated)
buffer. If the buffer is truncated, this essentially reads garbage,
leading to OOB array access when using the index block.

Fix this by dropping the truncated logic and issuing a second read if
the first read was short.

Add a test.

We have never observed this failure scenario at Google. We use 64kb
blocksize, which requires us to need fewer index entries. The reftable
spec mentions an Android repo of size 36M. With 64kb blocks, that's
just 562 index entries. Even with historical growth, we are long from
requiring an index whose size exceeds a single block.

When adding the analogous test for seeking refs, there was no failure.
This points to another possibility which is that the code tries to
avoid writing large index blocks for refs.

I did not investigate further which one it is.

Fixes https://bugs.eclipse.org/bugs/show_bug.cgi?id=576250

Bug: 576250
Change-Id: I41ec21fac9e526ef57b3d6fb57b988bd353ee338
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
3 years agoreftable: pass on invalid object ID in conversion 56/185856/2
Han-Wen Nienhuys [Mon, 27 Sep 2021 14:07:27 +0000 (16:07 +0200)]
reftable: pass on invalid object ID in conversion

Before, while trying to determine if an object ID was a tag or not,
the reftable conversion would yield an exception.

Change-Id: I3688a0ffa9e774ba27f320e3840ff8cada21ecf0

3 years agoUpdate eclipse-jarsigner-plugin to 1.3.2 54/185754/1
Matthias Sohn [Mon, 20 Sep 2021 22:18:03 +0000 (00:18 +0200)]
Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: Id5d05d96c392913de7b4451421c2ffb7b63ab83f
(cherry picked from commit c70c0acb4752f00672e3b856539587e4977bfaea)

3 years agoFix running benchmarks from bazel 55/185855/2
Matthias Sohn [Mon, 27 Sep 2021 13:53:30 +0000 (15:53 +0200)]
Fix running benchmarks from bazel

add missing dependency to
- javaewah
- slf4j-api

Change-Id: I28dc982791b32f10d20b2fd0671aa8d2514a0fb3

3 years agoUpdate eclipse-jarsigner-plugin to 1.3.2 43/185643/2
Matthias Sohn [Mon, 20 Sep 2021 22:18:03 +0000 (00:18 +0200)]
Update eclipse-jarsigner-plugin to 1.3.2

Change-Id: Id5d05d96c392913de7b4451421c2ffb7b63ab83f

3 years agoAdd org.bouncycastle.bcutil to p2 repository 11/185611/1
Matthias Sohn [Mon, 20 Sep 2021 14:41:17 +0000 (16:41 +0200)]
Add org.bouncycastle.bcutil to p2 repository

Bug: 575621
Change-Id: I57de7af9f9b236cac570d9c10c3d1c3886720868

3 years agoUpdate maven plugins 34/185334/4
Matthias Sohn [Sat, 11 Sep 2021 14:15:29 +0000 (16:15 +0200)]
Update maven plugins

- maven-enforcer-plugin 3.0.0
- maven-javadoc-plugin 3.3.1
- maven-pmd-plugin 3.15.0
- org.eclipse.cbi.maven.plugins:eclipse-jarsigner-plugin 1.3.2
- org.springframework.boot:spring-boot-maven-plugin 2.5.4

Change-Id: I377732b651f3718060c58ca48993e0c3ac79fa8b

3 years agoRemoved unused API filters 19/185219/3
Matthias Sohn [Thu, 9 Sep 2021 13:58:11 +0000 (15:58 +0200)]
Removed unused API filters

Change-Id: I39f7173879f64b1cd508990927d4e732f345724e

3 years agoMerge "Merge branch 'next'"
Matthias Sohn [Tue, 14 Sep 2021 22:14:02 +0000 (18:14 -0400)]
Merge "Merge branch 'next'"

3 years agoMerge "RepoCommand: Move building the index for base repos to its own method"
Ivan Frade [Tue, 14 Sep 2021 19:58:08 +0000 (15:58 -0400)]
Merge "RepoCommand: Move building the index for base repos to its own method"

3 years agoMerge branch 'next' 89/185389/1
Matthias Sohn [Mon, 13 Sep 2021 22:15:31 +0000 (00:15 +0200)]
Merge branch 'next'

* next:
  Enable CommitCommand to use a fluent style
  Prepare 6.0.0-SNAPSHOT builds

Change-Id: Ibd247d5990983bedadd8b959a82215914d216ed1

3 years agoMerge branch 'master' into next 13/185213/2
Matthias Sohn [Thu, 9 Sep 2021 12:41:30 +0000 (14:41 +0200)]
Merge branch 'master' into next

* master: (38 commits)
  Revert "DFS block cache: Refactor to enable parallel index loading"
  GitServlet: allow to override default error handlers
  Silence API error for new interface method ProtocolV2Hook#onObjectInfo
  transport: add object-info capability
  Ignore IllegalStateException if JVM is already shutting down
  Update orbit to R20210825222808 for 2021-09
  Update spotbugs-maven-plugin to 4.3.0
  Update ant to 1.10.11 also in pom.xml
  DFS block cache: add additional stats to DfsReaderIoStats
  Update Orbit to S20210817231813
  [gpg] Better GPG home directory determination
  FS: cleanup use of final modifier
  Ensure FS#searchPath only selects executable files
  RevWalk: getMergedInto's result is wrong on the second call
  DFS block cache: Refactor to enable parallel index loading
  [test] Create keystore with the keytool of the running JDK
  [gpg] Update to Bouncy Castle 1.69
  [test] Create keystore with the keytool of the running JDK
  [sshd] Minor code clean-up
  Support commit.template config property
  ...

Change-Id: I9f99e9a513a23c0c0d252334e79c351512d7355e

3 years agoMerge branch 'stable-5.13' 14/185214/1
Matthias Sohn [Thu, 9 Sep 2021 12:42:28 +0000 (14:42 +0200)]
Merge branch 'stable-5.13'

* stable-5.13:
  Prepare 5.13.1-SNAPSHOT builds
  JGit v5.13.0.202109080827-r
  Prepare 5.13.0-SNAPSHOT builds
  JGit v5.13.0.202109011149-rc1
  Prepare 5.13.0-SNAPSHOT builds
  JGit v5.13.0.202108250949-m3

Change-Id: I54ccb4bef74c929a440f77939aea0cc5b1da2181

3 years agoPrepare 5.13.1-SNAPSHOT builds 70/185170/1
Matthias Sohn [Wed, 8 Sep 2021 18:24:36 +0000 (20:24 +0200)]
Prepare 5.13.1-SNAPSHOT builds

Change-Id: Ib2f689d8d13eab022da5b5e83d6d6bebc1bb81d3

3 years agoJGit v5.13.0.202109080827-r 48/185148/1 v5.13.0.202109080827-r
Matthias Sohn [Wed, 8 Sep 2021 12:27:06 +0000 (14:27 +0200)]
JGit v5.13.0.202109080827-r

Change-Id: If3b2d4256712cc7e577c23e75c0d4ad940870e72
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'master' into stable-5.13 82/184982/1
Matthias Sohn [Sat, 4 Sep 2021 09:45:33 +0000 (11:45 +0200)]
Merge branch 'master' into stable-5.13

* master:
  Revert "DFS block cache: Refactor to enable parallel index loading"

Change-Id: Ifd7cf7a366bf682da6e92ac9dd416bd88e9f1654

3 years agoRevert "DFS block cache: Refactor to enable parallel index loading" 78/184978/2
Minh Thai [Fri, 3 Sep 2021 20:48:57 +0000 (13:48 -0700)]
Revert "DFS block cache: Refactor to enable parallel index loading"

This reverts commit 3cd7eb1b23dcf3d0477e8cd22a57f1b799a5ba5f.

Change-Id: I71ce68ce19503f0f9ad83069dc53eba6ab2c489b
Signed-off-by: Minh Thai <mthai@google.com>
3 years agoPrepare 5.13.0-SNAPSHOT builds 82/184882/1
Matthias Sohn [Wed, 1 Sep 2021 18:00:56 +0000 (20:00 +0200)]
Prepare 5.13.0-SNAPSHOT builds

Change-Id: I2a1d7ab24d5ca718348f4ce3cda351553e48cd1f

3 years agoJGit v5.13.0.202109011149-rc1 66/184866/1 v5.13.0.202109011149-rc1
Matthias Sohn [Wed, 1 Sep 2021 14:49:12 +0000 (16:49 +0200)]
JGit v5.13.0.202109011149-rc1

Change-Id: Id8d0970102f18e61a2fc7cf941267c9089d71c1a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'master' into stable-5.13 62/184862/1
Matthias Sohn [Wed, 1 Sep 2021 14:31:13 +0000 (16:31 +0200)]
Merge branch 'master' into stable-5.13

* master:
  GitServlet: allow to override default error handlers
  Silence API error for new interface method ProtocolV2Hook#onObjectInfo
  transport: add object-info capability
  Ignore IllegalStateException if JVM is already shutting down
  Update orbit to R20210825222808 for 2021-09
  RevWalk: getMergedInto's result is wrong on the second call

Change-Id: I007882d0c663e406d8845cc807f3792ae7673230

3 years agoMerge branch 'stable-5.12' 61/184861/1
Matthias Sohn [Wed, 1 Sep 2021 14:23:47 +0000 (16:23 +0200)]
Merge branch 'stable-5.12'

* stable-5.12:
  GitServlet: allow to override default error handlers

Change-Id: I4710cec30c58d7a6525a42dc5f1fdffc912ed073

3 years agoMerge branch 'stable-5.11' into stable-5.12 60/184860/1
Matthias Sohn [Wed, 1 Sep 2021 14:22:21 +0000 (16:22 +0200)]
Merge branch 'stable-5.11' into stable-5.12

* stable-5.11:
  GitServlet: allow to override default error handlers

Change-Id: I65c01857ab42ec3023da16e6816d58e1a36e40e4

3 years agoMerge branch 'stable-5.10' into stable-5.11 58/184858/1
Matthias Sohn [Wed, 1 Sep 2021 14:08:03 +0000 (16:08 +0200)]
Merge branch 'stable-5.10' into stable-5.11

* stable-5.10:
  GitServlet: allow to override default error handlers

Change-Id: If10a99bcdc91105059b15a1d137dd38af228c58d

3 years agoMerge branch 'stable-5.9' into stable-5.10 57/184857/1
Matthias Sohn [Wed, 1 Sep 2021 13:55:58 +0000 (15:55 +0200)]
Merge branch 'stable-5.9' into stable-5.10

* stable-5.9:
  GitServlet: allow to override default error handlers

Change-Id: I55273087f8a67762130728eaaf635519c25255b3

3 years agoGitServlet: allow to override default error handlers 43/184843/3
Antonio Barone [Wed, 1 Sep 2021 10:04:07 +0000 (12:04 +0200)]
GitServlet: allow to override default error handlers

GitServlet delegates repository access over HTTP to the GitFilter
servlet.

GitServlet, in turn, can be extended by jgit consumers to provide custom
logic when handling such operations.

This is the case, for example, with Gerrit Code Review, which provides
custom behavior with a GitOverHttpServlet [1].

Among possible customizations, the ability of specifying a custom error
handler for UploadPack and ReceivePack was already introduced in
GitFilter by Idd3b87d6b and I9c708aa5a2, respectively.

However the `setUploadPackErrorHandler` and `setReceivePackErrorHandler`
methods were never added to the GitServlet.

Expose the `setUploadPackErrorHandler` and `setReceivePackErrorHandler`
methods to the GitServlet, so that consumers of the jgit library might
specify custom error handlers.

[1] https://gerrit.googlesource.com/gerrit/+/refs/heads/stable-3.2/java/com/google/gerrit/httpd/GitOverHttpServlet.java#95

Change-Id: I712d485ff68b662b48c71ef75650c5a155950d23

3 years agoSilence API error for new interface method ProtocolV2Hook#onObjectInfo 54/184854/1
Matthias Sohn [Wed, 1 Sep 2021 12:50:48 +0000 (14:50 +0200)]
Silence API error for new interface method ProtocolV2Hook#onObjectInfo

Change-Id: Ie4d09db2b89f26bc6ceb4e84f10c7e66b0ff684f

3 years agotransport: add object-info capability 83/183183/23
Bruno Albuquerque [Fri, 16 Jul 2021 18:44:46 +0000 (11:44 -0700)]
transport: add object-info capability

Sometimes it is useful to obtain metadata associated with an object
without the need to first download it locally. This is specially useful
when using partial clones.

This change implements the object-info capability that allows clients to
query the remote server for object metadata (currently only size). This
is a backport of the same capability that was recently added to the Git
project a2ba162cda (object-info: support for retrieving object info,
2021-04-20).

Signed-off-by: Bruno Albuquerque <bga@google.com>
Change-Id: I4dc9828e1c247f08b0976b8810be92d124366165

3 years agoRepoCommand: Move building the index for base repos to its own method 01/184501/3
Ivan Frade [Thu, 26 Aug 2021 17:25:20 +0000 (10:25 -0700)]
RepoCommand: Move building the index for base repos to its own method

Minor refactor, clearing the way to adjust the exceptions.

Change-Id: I0a669d77a1cb1daf22bd258d8ff08a40783ff44f

3 years agoMerge branch 'stable-5.12' 81/184781/1
Matthias Sohn [Mon, 30 Aug 2021 20:25:02 +0000 (22:25 +0200)]
Merge branch 'stable-5.12'

* stable-5.12:
  RevWalk: getMergedInto's result is wrong on the second call

Change-Id: Iee51703b2b009df15c0d8ee19fd480058b665bce

3 years agoIgnore IllegalStateException if JVM is already shutting down 25/183925/4
Matthias Sohn [Thu, 12 Aug 2021 07:28:04 +0000 (09:28 +0200)]
Ignore IllegalStateException if JVM is already shutting down

Trying to register/unregister a shutdown hook when the JVM is already in
shutdown throws an IllegalStateException. Ignore this exception since we
can't do anything about it.

Bug: 575367
Change-Id: Ic967c16c7f566c84778795315ab369e76668b364