Commit Graph

6646 Commits

Author SHA1 Message Date
David Pursehouse d386943b83 Upgrade maven-jar-plugin to 3.1.1
Change-Id: I1b230fb558bc4773594a11292ee12820abe3ebaf
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-12-16 16:05:48 -05:00
Michael Keppler 5ada6ede4d Upgrade Tycho to 1.3
With the upcoming Eclipse release 2018-12 a new version of Tycho has
been released. Upgrade the Tycho related build steps to the new version
in the Maven build.

Change-Id: Ifff186a9f97ed9faf70f15b20396724b0c9e801c
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
2018-12-16 10:10:32 +01:00
Thomas Wolf 6608c1c30f Update last JGit version
The jgit-last-release-version is used by japicmp as baseline.

Change-Id: If56cc1785b61c92c9a05c8c29c6cb62001e89218
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-12-15 21:59:32 +01:00
Thomas Wolf e71e0068bc Enable japicmp for new SSH bundle; update its baseline
In the original contribution of this bundle, japicmp was disabled
as no previous version to compare against existed. Enable it now.

Update the version to compare against to 5.2.0.201812061821-r.

Change-Id: I42f812befde2d0d98db5f87e05230b51af244ae6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-12-15 20:37:39 +01:00
Matthias Sohn dac7ce0434 Merge branch 'stable-5.2'
* committer:
  Update list of committers
  Add new ssh bundles to Maven central scripts
  Update maven site reports
  Prepare 5.2.1-SNAPSHOT builds
  JGit v5.2.0.201812061821-r
  Update Orbit to R20181128170323 for 2018-12

Change-Id: I97c6ce5f0c963bfab4d45462f555563d9c5bbe8a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-09 00:45:52 +01:00
Matthias Sohn 70b7c6382c Update list of committers
Change-Id: I5bd3dc06103f8f62af1485b92e7b89f8a725be28
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-09 00:24:25 +01:00
Matthias Sohn 5218d2f5da Add new ssh bundles to Maven central scripts
Change-Id: I5c41426f59a60af3da808f89be4e498c7ba2196e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-09 00:12:59 +01:00
Matthias Sohn 7a2fe0a7a9 Update maven site reports
- update name of reports which changed name in
  maven-project-info-reports-plugin 3.0.0
- add dependency-covergence report
- add dependency-management report
- add index report
- add summary report

Change-Id: I6d406ecd9e082d96b2bd250704d5ca18e7c8f735
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-09 00:12:59 +01:00
Matthias Sohn 57b8cf4261 Prepare 5.2.1-SNAPSHOT builds
Change-Id: I68d9f5b1c8ca8e8eada9143093dc4fa82519edd8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-07 01:46:38 +01:00
Matthias Sohn c84c08107d JGit v5.2.0.201812061821-r
Change-Id: I8528c913ad1a820ee9a2fa6be1c9125b518caefe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-07 00:20:43 +01:00
Matthias Sohn 1136834f02 Update Orbit to R20181128170323 for 2018-12
Change-Id: Ia3597d2d0609e5a0a67e5f2518f68ce99ab8aa3c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-05 15:25:40 +01:00
Matthias Sohn 38da21d6b0 Prepare 5.3.0-SNAPSHOT builds
Change-Id: I8951c2cf650cc3e41d2baa0b330b94468cfed5c2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-03 02:32:49 +01:00
Matthias Sohn 13afcf75fe Merge branch 'stable-5.2'
* stable-5.2:
  Format lib/BUILD with buildifier
  Update Orbit to S20181128170323 for 2018-12 RC1
  Include id_ed25519 in the known default identity files
  Apache MINA sshd client: enable support for ed25519 keys
  Prepare 5.2.0-SNAPSHOT builds
  Set git environment variables for hooks
  JGit v5.2.0.201811281532-m3

Change-Id: If96adcbf35ccf8d9f4da0f5d97491f502f5a72a9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-03 02:32:16 +01:00
David Pursehouse f4d7c911fd Format lib/BUILD with buildifier
Change-Id: I63db70e6e6f4da44a211621d8721ede66bce44bd
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-12-02 20:30:52 -05:00
Matthias Sohn dbe6faffe6 Update Orbit to S20181128170323 for 2018-12 RC1
Change-Id: I4f66b907d8027cae779f54ef0bdc5d36b4a21f6f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-03 00:05:14 +01:00
Thomas Wolf 450b196627 Include id_ed25519 in the known default identity files
Change-Id: I9fb30c8fbb65536782ee73644c8990eb6661c660
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-12-02 16:35:12 +01:00
Thomas Wolf db627c4177 Apache MINA sshd client: enable support for ed25519 keys
Include the net.i2p.crypto.eddsa bundle via a hard dependency.

Add tests for dealing with ed25519 host keys and user key files.

Manual tests: fetching from git.eclipse.org with an ed25519 user key,
and pushing this change itself using the same ed25519 key.

Note that sshd 2.0.0 does not yet support encrypted ed25519 private
keys.

Bug: 541272
Change-Id: I7072f4014d9eca755b4a2412e19c086235e5eae9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-12-02 11:43:13 +01:00
Thomas Wolf a08ffb0444 Merge "Set git environment variables for hooks" into stable-5.2 2018-12-02 05:34:18 -05:00
Michael Keppler 8ed9e489e0 Upgrade spotbugs-maven-plugin to 3.1.9
Change-Id: Idc447dfbcd165ef0362142bd17434d304c6c7f01
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
2018-12-02 09:35:28 +01:00
Matthias Sohn 055c312bd1 Prepare 5.2.0-SNAPSHOT builds
Change-Id: I18646aaeee51047b234b758dcc1c2f89fd01b2f8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-30 22:57:04 +01:00
Thomas Wolf 9c755c9e7c Set git environment variables for hooks
Set GIT_DIR and GIT_WORK_TREE when calling hooks.

Bug: 541622
Change-Id: I6153d8a6a934ec37a3a5e7319c2d0e516f539ab7
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-30 00:37:03 +01:00
Matthias Sohn 12d840dfcb JGit v5.2.0.201811281532-m3
Change-Id: I79988b473d67e565d8f6bcac40ee9a14b26c9e60
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-28 21:35:26 +01:00
Matthias Sohn ae805bd717 Update Apache commons compress to 1.18.0
to consume fix for vulnerability [1] in Apache commons compress which is
fixed in version 1.18.

[1] https://nvd.nist.gov/vuln/detail/CVE-2018-1324

CQ: 18320
Change-Id: I39b1d815e5b8e0208600afafe7a72bb603d04fb8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-28 20:18:04 +01:00
Matthias Sohn 2532fa74c2 Fix running tests from bazel
The new dependency to mockito for JDKHttpConnectionTest wasn't added for
bazel test run.

Change-Id: Ie967b7152340a0b3e05cced7eadfd40af78d9995
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-28 20:18:04 +01:00
Matthias Sohn 4b3c87f639 Update Orbit to I20181128011035
to consume fix for vulnerability [1] in Apache commons compress which is
fixed in version 1.18.

[1] CVE-2018-1324

CQ: 18320
Change-Id: I01e435fda834bbb22892a1cfba411d0196d7de17
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-28 16:43:44 +01:00
Matthias Sohn 065aab5131 Update bcprov-jdk15on used in tests to 1.59
CQ: 15889
Change-Id: I04c9099941dd1929cd9075ad6c89660a63e7de8f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-28 09:54:06 -05:00
Christian Halstrick 158294f912 Merge "Fix IndexDiffs for git links" 2018-11-28 06:11:05 -05:00
David Pursehouse c5306b84ae Merge branch 'stable-5.1'
* stable-5.1:
  Fix DescribeCommand with multiple match options
  Fix git-describe tie-breakers

Change-Id: I64d9b0099fc0d8449ec08f0b5653572b5c2f840f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-11-27 20:01:45 +09:00
David Pursehouse 9372cf496f Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  Fix DescribeCommand with multiple match options
  Fix git-describe tie-breakers

Change-Id: I63e7a56bb617b5ce8774e1dc7f5efdde25e7cd97
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-11-27 20:01:11 +09:00
David Pursehouse 28f0ef8509 Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Fix DescribeCommand with multiple match options
  Fix git-describe tie-breakers

Change-Id: Ibb98f143ee0ce7635beb30ec404b4134a73788f6
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-11-27 19:51:01 +09:00
Matthias Sohn 7c798905ed Remove unused externalized text "submodulesNotSupported"
This text is unused since d72b9328.

Change-Id: I82e5652e205d7b238ff8adc21994029b828b09f4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-27 03:48:09 -05:00
Thomas Wolf 4678f4b735 Fix IndexDiffs for git links
After cloning a repo with a submodule, non-recursively, JGit would
encounter in its TreeWalk in IndexDiff:

* first, a missing gitlink (in index & HEAD, not in working tree)
* second, the untracked folder (not in index and head, in working tree)

As a result, it would report the submodule as missing. Canonical git
reports a clean workspace.

The root cause of this is that the path of a gitlink "x" did
not compare equal to the path of a tree "x" in JGit.

Correct Paths.compare() to account for that. If two paths are otherwise
equal, then let gitlinks match both trees and files. Matching trees
solves the bug. Matching files is necessary to handle the case where
the gitlink directory was replaced by a file; see the new test case
IndexDiffSubmoduleTest.testSubmoduleReplacedByFile(). Comparisons of
unequal paths are left untouched, so the sort order is unchanged.

After the fix, another bug(?) in WorkingTreeIterator became apparent:
with core.dirNoGitLinks = true, it was no longer possible to overwrite
a gitlink in the index. This is now fixed in WorkingTreeIterator.

Add new test cases for the bug itself and for some related cases
(submodule directory deleted or replaced by a file) in
IndexDiffSubmoduleTest. Add a test for missing files in IndexDiffTest,
and adapt the PathsTest to test matching gitlinks.

Bug: 467631
Change-Id: I0549d10d46b1858e5eec3cc15095aa9f1d5f5280
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-26 20:53:42 +01:00
Matthias Sohn df6263644b Fix DescribeCommand with multiple match options
when multiple match options are given in git describe the result must
not depend on the order of the match options. JGit wrongly picked the
first match using the match options in the order they were defined. Fix
this by concatenating the streams of matching tags for all match options
and then choosing the first match on the concatenated stream sorted in
tie break order.

See https://git-scm.com/docs/git-describe#git-describe---matchltpatterngt

Change-Id: Id01433d35fa16fb4c30526605bee041ac1d954b2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-26 18:49:30 +01:00
Matthias Sohn 3f745e40a1 Add a method to get all values of HTTP header defined as list
According to RFC 2616 [1] header field names are case insensitive.
Header fields defined as a comma separated list can have multiple header
fields with the same field name. Add a method to HttpConnection which
retrieves all values with a given header field name with the field name
compared case insensitive.

[1] https://tools.ietf.org/html/rfc2616#section-4.2"

Change-Id: I7f601b21cda99e84f43f866c7c7cb4cb0e3cf5c3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-26 03:07:58 -05:00
Thomas Wolf f974c9c790 Undo treating blobs with NULs as a single line
This partially reverts commit a551b646: revert the changes in
RawParseUtils.lineMap(). Forcing all blobs containing a NUL byte
as a single line causes blame to produce useless results as soon
as it hits any version containing a NUL byte.

Doing binary detection at this level also has the problem that the
user cannot control it. Not by setting the text attribute nor in any
other way.

This came up in bug 541036, where a Java source inadvertently
contained NUL bytes in strings. Even fixing this by using escapes
"\000" will not fix JGit's blame for this file because the past
versions will still contain the NUL byte.

Native git can blame that file from bug 541036 fine.

Added new tests verifying that blaming a text file containing a NUL
byte produces sensible results.

Bug: 541036
Change-Id: I8991bec88e9827cc096868c6026ea1890b6d0d32
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-26 00:30:21 +01:00
Matthias Sohn 6f68ed2ed3 Update Ant to 1.10.5
CQ: 18322
Change-Id: I88982116e02598b0ac658c4d740d7a7c1e37280a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-22 01:15:31 +01:00
Matthias Sohn ae8533f1c4 Update Orbit to S20181120221132 for 2018-12
Change-Id: Ice169d000e4757732e847ba5e2ea5e59945a09e8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-22 00:21:18 +01:00
Matthias Sohn bcce65eea9 Update mockito to 2.13.0
Update mockito and its dependencies to latest version available in
Orbit:
- mockito 2.13.0.v20180426-1843
- net.bytebuddy.byte-buddy 1.7.9.v20180420-1519
- net.bytebuddy.byte-buddy-agent 1.7.9.v20180420-1519
- org.objenesis 2.6.0.v20180420-1519

CQ: 18301
CQ: 18303
CQ: 18319
Change-Id: I3dd01e5b0b5a023fcb6530e8ec76729cfc41d735
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-11-22 00:01:55 +01:00
Jonathan Nieder 647cc8f604 Remove unnecessary modifiers from interfaces
This continues what commit d9ac7ddf10
(Remove unnecessary modifiers from interfaces, 2018-11-15) started.

Change-Id: I89720985a5a986722a0dcb9b5e9bbc25996bd5b3
2018-11-20 16:18:44 -08:00
Gunnar Wagenknecht e751c878b0 New GpgConfig for typed access to GPG settings
Change-Id: Ifece38132e0390931d33b5678bbbd4a43f9099da
Signed-off-by: Gunnar Wagenknecht <gunnar@wagenknecht.org>
2018-11-20 19:35:50 +01:00
Masaya Suzuki 49befd84d7 Revert C Git 1.7.5 bug workaround
This reverts the workaround introduced by
1c6c73c5a9, which is a patch for dealing
with a buggy C Git client v1.7.5 in 2012. We'll stop supporting very old
C Git clients.

Change-Id: I94999a39101c96f210b5eca3c2f620c15eb1ac1b
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
2018-11-19 13:37:28 -08:00
Thomas Wolf c567b6ecde Apache MINA sshd client: don't leak HostConfigEntry
ProxyDataFactory had a parameter of type HostConfigEntry, but actually
it wasn't used anywhere. Remove it -- it was the last leaked type from
Apache MINA sshd.

Also use the logger provided by upstream SshClient instead of creating
a new Logger.

Bug: 520927
Change-Id: Iaa78bbb998a5e574fa091664b75c48a3b9cfb897
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-17 18:55:06 +01:00
Thomas Wolf 00b235f0b8 Apache MINA sshd client: test & fix password authentication
Add tests for password and keyboard-interactive authentication.
Implement password authentication; the default provided by sshd
is non-interactive, which is not useful for JGit.

Make sure the CredentialsProvider gets reset on successive password
retrieval attempts. Otherwise it might always return the same non-
accepted password from a secure storage. (That one was discovered
by actually trying this via EGit; the JGit tests don't catch this.)

Change the default order of authentication mechanisms to prefer
password over keyboard-interactive. This is a mitigation for upstream
bug SSHD-866.[1]

Also include a fix for upstream bug SSHD-867.[2]

[1] https://issues.apache.org/jira/projects/SSHD/issues/SSHD-866
[2] https://issues.apache.org/jira/projects/SSHD/issues/SSHD-867

Bug: 520927
Change-Id: I423e548f06d3b51531016cf08938c8bd7acaa2a9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-17 07:28:08 -08:00
Thomas Wolf 1316d43e51 Move SshTestGitServer to new bundle org.eclipse.jgit.junit.ssh
Create the bundle and move the SshTestGitServer there. Verified that
the Eclipse build still works and ran JSchSshTest and ApacheSshTest as
junit tests inside Eclipse.

Update maven build and features to account for that. Verified by
running full maven build including packaging.

Update bazel build files to account for that. Verified by a
clean-slate bazel build :all, followed by running the JSchSshTest
and the ApacheSshTest via bazel.

Change-Id: Ia084942f4425b454529de148e00417e7da786a90
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-17 07:28:08 -08:00
Thomas Wolf 6c14d273fa Apache MINA sshd client: proxy support
This is not about the ssh config ProxyCommand but about programmatic
support for HTTP and SOCKS5 proxies. Eclipse allows the user to
specify such proxies, and JSch at least contains code to connect
through proxies. So our Apache MINA sshd client also should be able
to do this.

Add interfaces and provide two implementations for HTTP and SOCKS5
proxies. Adapt the core code to be able to deal with proxy connections
at all. The built-in client-side support for this in sshd 2.0.0 is
woefully inadequate.

Tested manually by running proxies and then fetching various real-
world repositories via these proxies from different servers. Proxies
tested: ssh -D (SOCKS, anonymous), tinyproxy (HTTP, anonymous), and
3proxy (SOCKS & HTTP, username-password authentication). The GSS-API
authentication is untested since I have no Kerberos setup.

Bug: 520927
Change-Id: I1a5c34687d439b3ef8373c5d58e24004f93e63ae
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-17 07:28:06 -08:00
Thomas Wolf 7aaeb6489f Apache MINA sshd client: don't leak upstream classes and interfaces
We will get an API evolution problem if we expose as API classes and
interfaces that derive from upstream classes or interfaces. Upstream
interfaces also evolve quite erratically and evolution doesn't seem
to follow semantic versioning.

Introduce a new KeyPasswordProvider interface so that we don't have
to depend on the upstream FilePasswordProvider in our API. (We do
need _some_ abstraction for getting passwords for encrypted keys in
the API; EGit will need to provide its own implementation.)

Move some other upstream dependencies (HostConfigEntry, and various
previously protected methods in SshdSessionFactory) out of the API:
classes moved to internal space, and methods made private.

The only dependencies on upstream interfaces are thus in a few method
parameter types. Those cannot be avoided, but should also not pose
problems.

Bug: 520927
Change-Id: Idc9c6b0f237f29f46343c0fe15179242f2007bec
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-16 15:56:31 -08:00
Ivan Frade d9ac7ddf10 Remove unnecessary modifiers from interfaces
From Oracle's "Defining an interface":

"All abstract, default, and static methods in an interface are
implicitly public, so you can omit the public modifier."

(Without any modifier, the interface methods are also abstract, so we
omit also the "abstract")

"In addition, an interface can contain constant declarations. All
constant values defined in an interface are implicitly public, static,
and final. Once again, you can omit these modifiers."

This makes the code more consistent. Now all interfaces under
org.eclipse.jgit follow the guidelines.

Change-Id: I4fe6deb111899ec1b4318ab5a6050f3851fa1fd3
Signed-off-by: Ivan Frade <ifrade@google.com>
2018-11-15 22:36:43 -08:00
David Pursehouse c56afbf18c Merge "Call unlockPack in finally" 2018-11-14 22:11:26 -05:00
David Pursehouse 32a7c9622e Format org.eclipse.jgit.pgm/BUILD with buildifier
Change-Id: I08de1e262c56ffdd9f4bc9b58f7b43964cce969a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-11-14 08:06:45 -08:00
Thomas Wolf a151190bef Add --ssh option to command-line commands
Enables using the new ssh client based on Apache MINA sshd instead
of the old JSch client. The default is still JSch, so unless the
command is invoked with --ssh apache, there's no change.

I prefer this over some fiddling with the GIT_SSH environment variable
since that variable is handled in the JGit core bundle, which should
remain free of any dependency to org.eclipse.jgit.ssh.apache to avoid
problems in Gerrit or other JGit users that may use a different Apache
MINA sshd version.

Bug: 520927
Change-Id: I8460759c7113ef7887520fb0d297aa312200c69f
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-11-14 04:47:33 -08:00