Commit Graph

8569 Commits

Author SHA1 Message Date
Matthias Sohn 525127ebb4 Silence API error for new interface method ProtocolV2Hook#onObjectInfo
Change-Id: Ie4d09db2b89f26bc6ceb4e84f10c7e66b0ff684f
2021-09-01 14:50:48 +02:00
Bruno Albuquerque 5b8e387c67 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
2021-08-31 14:36:06 -07:00
Matthias Sohn c1961ad809 Merge branch 'stable-5.12'
* stable-5.12:
  RevWalk: getMergedInto's result is wrong on the second call

Change-Id: Iee51703b2b009df15c0d8ee19fd480058b665bce
2021-08-30 22:25:02 +02:00
Matthias Sohn 6817b7e3b4 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
2021-08-29 05:02:59 -04:00
Matthias Sohn c697f02e12 Update orbit to R20210825222808 for 2021-09
Change-Id: I5a98f2134d19c3495d7d39cccfd7cf6f07640bd5
2021-08-26 20:42:26 +02:00
Matthias Sohn 574e899051 Prepare 5.13.0-SNAPSHOT builds
Change-Id: I6db044fdd57b60adbc2dd078c4af8cb54bb331c3
2021-08-25 22:33:09 +02:00
Matthias Sohn a38ea8ede7 JGit v5.13.0.202108250949-m3
Change-Id: Icc079b28327f5a02256f9a06837c2be6352ea6e3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-08-25 15:49:20 +02:00
Marco Miller 8911bd0827 Update spotbugs-maven-plugin to 4.3.0
Change-Id: Iafb680923cbc6c81067773159a9a0e2fcdc60169
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
2021-08-24 17:46:16 -04:00
Matthias Sohn 1ca106f07a Update ant to 1.10.11 also in pom.xml
This was missed when the target platform was updated to use ant 1.10.11
in cf9baedb5d.

Change-Id: I0d503fa4b27df73a7dad68f1b729346596d78332
2021-08-24 10:54:46 +02:00
Alina Djamankulova 8173c16785 DFS block cache: add additional stats to DfsReaderIoStats
New stats are populated in DfsPackFile to provide details about loading
pack, bitmap and reverse indexes.

Signed-off-by: Alina Djamankulova <adjama@google.com>
Change-Id: Ib6e8384ecc31821261e5099d0768c0b1227e8364
2021-08-24 04:16:22 -04:00
Matthias Sohn cf9baedb5d Update Orbit to S20210817231813
and org.apache.ant to 1.10.11.v20210720-1445

Change-Id: Ic9c2f42628e47fffc99a07d591bc465b4e24b86e
2021-08-23 11:53:15 +02:00
Thomas Wolf ca7a30f231 [gpg] Better GPG home directory determination
GPG can use customized directories instead of the standard ~/.gnupg or
%APPDATA%\gnupg directories:

* Environment variable GNUPGHOME can define the location.
* On Windows, a registry key may define the location (but this is
  deprecated).
* Portable installations may use a directory defined via a file
  "gpgconf.ctl".
* GPG programs may take a --homedir command-line argument, which
  overrides anything.

Implement handling of environment variable GNUPGHOME. The other ways of
GPG to get its home directory are outside the reach of JGit. Provide a
system property "jgit.gpg.home" that the user can set in such cases.

Do tilde replacement for the system property and for GNUPGHOME.

Note that on VMS, the default directory would be ~/gnupg (without dot).
This is not accounted for, but a user on VMS could now use either the
system property or GNUPGHOME to direct JGit to the right directory.

Bug: 575327
Change-Id: Id5ea04a85d58dba0c0df7a705777630d36042467
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-08-18 08:57:14 +02:00
Matthias Sohn aad1bde522 FS: cleanup use of final modifier
See the contributor guide [1].

[1] https://wiki.eclipse.org/EGit/Contributor_Guide#Use_of_the_.22final.22_modifier

Change-Id: I4673442310a3a53d838407f7eb11964144bb04d0
2021-08-17 16:48:19 +02:00
Matthias Sohn 5fb71fb54e Ensure FS#searchPath only selects executable files
On Posix non executable files on the path should be ignored, on Windows
File#canExecute always returns true.

While we are here also add missing braces.

Bug: 575385
Change-Id: I80cd5057bdf9632a17f103db6f1356e975b6e150
2021-08-17 16:48:19 +02:00
kylezhao 35eeab41b3 RevWalk: getMergedInto's result is wrong on the second call
Make sure the future user can reset all UNINTERESTING commmits after
this operation.

Signed-off-by: kylezhao <kylezhao@tencent.com>
Change-Id: I7549b9ff67bd31acd5dfc92331cb9a30b47b8278
2021-08-13 10:51:16 +08:00
Alina Djamankulova 3cd7eb1b23 DFS block cache: Refactor to enable parallel index loading
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.

Update PackBitmapIndexV1 constructor to get packIndex and reverseIndex
suppliers instead of actual objects. Inner class IdxPositionBitmap was added to initialize pack objects after bitmap
index is fully read from storage. Update DfsPackFile and PackBitmapIndex
accordingly.

Signed-off-by: Alina Djamankulova <adjama@google.com>
Change-Id: Iea59ab58501b2acbbf9263412982ec9c6898a7ee
2021-08-12 14:51:18 -04:00
Thomas Wolf 1825a2230c Merge branch 'stable-5.12'
* stable-5.12:
  [test] Create keystore with the keytool of the running JDK
  Fix garbage collection failing to delete pack file
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: I4b54f4850819736144edb784617ee902f491ffd6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 18:19:23 +02:00
Thomas Wolf 65de0d4863 Merge branch 'stable-5.11' into stable-5.12
* stable-5.11:
  [test] Create keystore with the keytool of the running JDK
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: Ie8db450a1fad05bddb812a55b2ceb03b2805403a
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:12:13 +02:00
Thomas Wolf 1a963b3976 Merge branch 'stable-5.10' into stable-5.11
* stable-5.10:
  [test] Create keystore with the keytool of the running JDK
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: I55f4dd19e9fa3b789bd9a79d256fe9abb55ee7f4
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:11:37 +02:00
Thomas Wolf bae2f86ac7 Merge branch 'stable-5.9' into stable-5.10
* stable-5.9:
  [test] Create keystore with the keytool of the running JDK
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: Ic37426211905d987ddd11480a54d95b86143c94c
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:10:56 +02:00
Thomas Wolf 59aec9b15a Merge branch 'stable-5.8' into stable-5.9
* stable-5.8:
  [test] Create keystore with the keytool of the running JDK
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: If09cbb877c674f15261715cecef7a2393bf66fa3
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:10:16 +02:00
Thomas Wolf 60bffc2fa8 Merge branch 'stable-5.7' into stable-5.8
* stable-5.7:
  [test] Create keystore with the keytool of the running JDK
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: I32010c6bf45d5138e17143d6c284ac56434eade1
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:09:39 +02:00
Thomas Wolf ae56213210 Merge branch 'stable-5.6' into stable-5.7
* stable-5.6:
  [test] Create keystore with the keytool of the running JDK
  ReachabilityCheckerTestCase: fix reachable from self test case

Change-Id: I1f6b4fc26f6ee6f22cc0aacd032c1e73ba246dbc
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:09:00 +02:00
Thomas Wolf 5bf6cfe32b Merge branch 'stable-5.5' into stable-5.6
* stable-5.5:
  [test] Create keystore with the keytool of the running JDK

Change-Id: Icb0bb6dc4ad05b1f3eb562547893f2e0aedf8775
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:07:25 +02:00
Thomas Wolf d6fab62f9e Merge branch 'stable-5.4' into stable-5.5
* stable-5.4:
  [test] Create keystore with the keytool of the running JDK

Change-Id: I5ff3dc1c771aeb33af39eb68f166c7282b478cf8
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:06:25 +02:00
Thomas Wolf e264a64190 Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  [test] Create keystore with the keytool of the running JDK

Change-Id: If92372b7bfbfb9445fcb934c48dc1cd6610e061b
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:05:46 +02:00
Thomas Wolf 3dea2b37ec Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  [test] Create keystore with the keytool of the running JDK

Change-Id: I981de862c614986a7b443fed1cce7b895b758682
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:04:26 +02:00
Thomas Wolf 4322dd26a3 Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  [test] Create keystore with the keytool of the running JDK

Change-Id: Ic56f4f23c37432377be88e07d06c5ad75591d84f
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 13:03:08 +02:00
Thomas Wolf 6cb39d145a [test] Create keystore with the keytool of the running JDK
Call keytool with the absolute path of "java.home". Otherwise a keytool
for a different, maybe even newer Java version might be picked up, and
then the keystore may not be readable by the JVM used to run the tests.

(cherry picked from commit 2d73c702d3)

Change-Id: Iea77024947a34267f008847d81312fe0abadc615
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-29 12:47:16 +02:00
Thomas Wolf f1e67911ed [gpg] Update to Bouncy Castle 1.69
Bump lower bound in MANIFEST.MF and adapt code.

Change-Id: I3a3c7948e5fc29f5517fe84209fcea81834e8e5b
2021-07-26 13:30:37 +02:00
Thomas Wolf 2d73c702d3 [test] Create keystore with the keytool of the running JDK
Call keytool with the absolute path of "java.home". Otherwise a keytool
for a different, maybe even newer Java version might be picked up, and
then the keystore may not be readable by the JVM used to run the tests.

Change-Id: Iea77024947a34267f008847d81312fe0abadc615
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-25 15:48:26 +02:00
Thomas Wolf cbb9188cda [sshd] Minor code clean-up
Since upstream changed the method profile to throw Exception it's not
necessary anymore to re-throw as IOException.

Change-Id: I31afab4f6e1a2f0feef79e6abced20d0ca1c493b
2021-07-21 16:06:57 -04:00
Julian Ruppel e2798413f9 Support commit.template config property
Adds functionality to read the git commit.template property. The
template content is read either via a default encoding or, if present,
via encoding specified by i18n.commitEncoding property.

Bug: 446355

Change-Id: I0c45db98e324ddff26a7e0262835f259d6528a86
Signed-off-by: Julian Ruppel <julian.ruppel@sap.com>
2021-07-21 15:50:02 -04:00
Matthias Sohn ca969ecc61 Relax version range for hamcrest and assertj
We currently cannot use hamcrest 2.2 and assertj 3.20.2 (which requires
hamcrest 2.2) in egit tests since other Eclipse dependencies (e.g.
swtbot) require hamcrest 1.1.

Hence relax version range for these components in jgit so that jgit
tests also work when using the egit target platform.

Change-Id: I521e2ec4491bd8d790609b8a66a8f14511a865a1
2021-07-19 12:32:26 +02:00
Matthias Sohn 8089c8b39c bazel: don't expose jsch and jzlib to org.eclipse.jgit
These libraries are no longer used by org.eclipse.jgit since the code
depending on them was moved to org.eclipse.jgit.ssh.jsch.

Change-Id: Ic1c66e8ca06d904abf44d84154bbe9a770aa94d5
2021-07-16 23:47:30 +02:00
Matthias Sohn 02344254ea Update orbit to I20210713220109
update
- org.apache.commons.compress to 1.20.0.v20210713-192
- org.bouncycastle.bcpg to 1.69.0.v20210713-1924
- org.bouncycastle.bcpkix to 1.69.0.v20210713-1924
- org.bouncycastle.bcprov to 1.69.0.v20210713-1924

- add org.bouncycastle.bcutil 1.69.0.v20210713-1924

In bazel build don't expose bouncycastle to org.eclipse.jgit since it's
not used there anymore since code depending on bouncycastle was moved to
org.eclipse.jgit.gpg.bc.

CQ: 21771
CQ: 23471
CQ: 23472
CQ: 23473
CQ: 23474
Change-Id: Id3d94c00c39bbc57e3f49a61150841249dc3985c
2021-07-16 23:47:30 +02:00
Matthias Sohn e0ba98edd2 Update orbit to I20210711110031
and update
- assertj to 3.20.2.v20210706-1104
- hamcrest to 2.2.0.v20210711-0821
  - classes which were in org.hamcrest.core 1.3 and org.hamcrest.library
    1.3 were all moved to org.hamcrest in 2.2
  - the annotation org.hamcrest.Factory was removed and is no longer
    needed
  - junit 4.13 requires hamcrest-core and hamcrest-library 1.3 therefore
    keep them in the target platform

CQ: 23501
Change-Id: Ife871c0343b611be9203aed7f86577e85bbf5c95
2021-07-16 23:47:29 +02:00
Thomas Wolf 13777a3a62 [sshd] Ignore revoked keys in OpenSshServerKeyDatabase.lookup()
It makes no sense to return revoked keys.

Change-Id: I99eee1de3dba5c0c8d275b7c1a24053874b3cb03
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-16 08:45:24 +02:00
Thomas Wolf 4c5c3e9fb8 [sshd] Distinguish key type and signature algorithm for host key
Since the introduction of the rsa-sha2-512 and rsa-sha2-256 signature
types, the key type for RSA is no longer automatically the signature
algorithm. We re-order the list for the host key proposal such that
keys we already have are preferred; this minimizes warnings about new
host keys. When doing so, put all of rsa-sha2-512, rsa-sha2-256, and
ssh-rsa at the front, in that order, not just ssh-rsa.

This ensures that we do prefer RSA keys if we already have an RSA host
key, but at the same time we still prefer the stronger signature
algorithms over the weaker and deprecated SHA1-based ssh-rsa signature.
It also helps avoid a bug found in some Github versions where the Github
SSH server uses a rsa-sha2-512 signature even though ssh-rsa was
negotiated.[1]

[1] https://www.eclipse.org/forums/index.php/t/1108282/

Bug: 574635
Change-Id: I0a49dcfa0c2c93f23118c983cd0bc9e5a467d886
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-16 08:45:23 +02:00
Thomas Wolf 27a1fa1872 [sshd] Implement SSH config KexAlgorithms
Make the used KEX algorithms configurable via the ssh config. Also
implement adding algorithms not in the default set: since sshd 2.6.0
deprecated SHA1-based algorithms, it is possible that the default set
has not all available algorithms, so adding algorithms makes sense.

This enables users who have to use a git server that only supports
old SHA1-based key exchange methods to enable those methods in the
ssh config:

  KexAlgorithms +diffie-hellman-group1-sha1

There are two more SHA1 algorithms that are not enabled by default:
diffie-hellman-group14-sha1 and diffie-hellman-group-exchange-sha1.
KeyAlgorithms accepts a comma-separated list of algorithm names.

Since adding algorithms is now supported, adapt the handling of
signature algorithms, too. Make sure that definitions for the KEX
exchange signature (HostKeyAlgorithms) don't conflict with the
definition for signatures for pubkey auth (PubkeyAcceptedAlgorithms).

HostKeyAlgorithms updates the signature factories set on the session
to include the default factories plus any that might have been added
via the SSH config. Move the handling of PubkeyAcceptedAlgorithms
from the client to the JGitPubkeyAuthentication, where it can be done
only if pubkey auth is attempted at all and where it can store its
adapted list of factories locally.

Bug: 574636
Change-Id: Ia5d5f174bbc8e5b41e10ec2c25216d861174e7c3
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-16 08:45:23 +02:00
Matthias Sohn 1e391d47ba Update orbit to S20210705204906
Change-Id: Ib4ec9f80a8a346fa8c709e58f8076372d14eca64
2021-07-08 21:54:38 +02:00
Matthias Sohn 729c92d723 Update jetty to 9.4.43.v20210629
Change-Id: I4ceea58cb0a04d041ca4e698e096a00ccd12bfc0
2021-07-08 18:15:04 +02:00
Matthias Sohn caf3fbe8bf Update JMH used in benchmarks to 1.32
Change-Id: I98734165de8256ab1461733169957efbfa5f36e4
CQ: 23499
CQ: 23500
2021-07-08 17:59:49 +02:00
Thomas Wolf 66c9c7bf87 Update target platform to I20210626190330
Update
- com.google.gson to 2.8.7.v20210624-1215
- javaewah to 1.1.12.v20210622-2206
- org.apache.sshd.osgi to 2.7.0.v20210623-0618
- org.apache.sshd.sftp to 2.7.0.v20210623-0618
- org.tukaani.xz to 1.9.0.v20210624-1259
- Apache MINA sshd to 2.7.0
  - Remove work-arounds for problems resolved upstream since 2.6.0, and
    adapt to upstream API changes.
- update DEPENDENCIES.

CQ: 23469
CQ: 23470
CQ: 23496
CQ: 23497
CQ: 23498
Bug: 574220
Change-Id: I898b216c3492f8488fbf25fa4b49f1250f86f3c8
Also-by: David Ostrovsky <david@ostrovsky.org>
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-07-06 13:22:38 +02:00
Matthias Sohn 1c6bd377ff Add 4.21 target platform
Change-Id: I88d32956fd7ad5c23aa395abd88f35359b519b79
2021-07-01 20:15:21 +02:00
Matthias Sohn 4acedc5d2e Update 4.20 target platform to use final 4.20 release
Change-Id: I8d6a1617a7713faf5186cfb5b2a084d0f1f9e63f
2021-07-01 20:15:20 +02:00
Matthias Sohn 23ae9f827c Merge "Remove use of deprecated getAllRefs() in ReceivePack" 2021-07-01 14:13:19 -04:00
Matthias Sohn 06ca6cb3b0 Merge "Merge branch 'stable-5.11' into stable-5.12" into stable-5.12 2021-06-29 14:22:22 -04:00
Matthias Sohn 0b9193e69f [pgm] Fix default meta variable defined in StopOptionHandler
Change-Id: I703718e2476d40d34b11083414ac0ed5e34bf90a
2021-06-28 01:10:41 +02:00
Matthias Sohn d947e84980 Fix typo in javadoc of PathTreeFilterHandler
Change-Id: Icf0dc814baf0dc44addd102d9c03b821b4022a84
2021-06-28 01:08:48 +02:00