]> source.dussan.org Git - jgit.git/log
jgit.git
4 years agoFix SshSessionFactory#setInstance to use service loader 87/156587/2
Matthias Sohn [Sun, 26 Jan 2020 19:26:01 +0000 (20:26 +0100)]
Fix SshSessionFactory#setInstance to use service loader

If setInstance(SshSessionFactory) is called with parameter null
set default session factory using the newly introduced service loader
instead of hard-coding the default factory class.

Change-Id: I86b5932333cc53b706534a2822e0fd96e12e6e47
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoUse ServiceLoader to define the default SSH session factory. 82/155782/3
Emmanuel Hugonnet [Mon, 13 Jan 2020 14:45:55 +0000 (15:45 +0100)]
Use ServiceLoader to define the default SSH session factory.

Use ServiceLoader and define
org.eclipse.jgit.transport.DefaultSshSessionFactory in
META-INF/services/org.eclipse.jgit.transport.SshSessionFactory so that
the legacy behavior is still the same.

Bug: 553625
Change-Id: Id1a65506140d921ed76d83699e3817f0d2ca08ed
Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoRemove Error-Prone ExpectedExceptionChecker 94/156494/1
David Pursehouse [Fri, 24 Jan 2020 07:49:14 +0000 (16:49 +0900)]
Remove Error-Prone ExpectedExceptionChecker

The checker only checks for misuse of ExpectedException. Since we've
moved to JUnit 4.13 and assertThrows, ExpectedException won't be used
at all, so now we can get rid of that setting.

Change-Id: Ia9189936ae215110f1f5fc6459c5dbc944404ade
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoReceivePack: enable overriding filterCommands and executeCommands 38/156038/4
Matthias Sohn [Fri, 10 Jan 2020 23:26:35 +0000 (00:26 +0100)]
ReceivePack: enable overriding filterCommands and executeCommands

Change-Id: Ib923e137f0fadd876434bcc49ebd0c9a4d90b45c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoReplace ExpectedException which was deprecated in junit 4.13 65/156365/5
Matthias Sohn [Tue, 21 Jan 2020 23:48:24 +0000 (00:48 +0100)]
Replace ExpectedException which was deprecated in junit 4.13

Change-Id: I64b0c057dd0a12aef2f3d56fa0c8a10e3b23fffd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoAdd org.assertj 3.14.0.v20200120-1926 to target platform 86/156386/3
Matthias Sohn [Wed, 22 Jan 2020 23:49:35 +0000 (00:49 +0100)]
Add org.assertj 3.14.0.v20200120-1926 to target platform

This will be used by JGit based NIO2 filesystem implementation in
Ic8712a091e3941634c80b19ba0e316d9c98dae3e.

CQ: 21437
Change-Id: I64f8415826e95bff7cf93e7fd28e00f0809b500c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoReplace deprecated junit assertion methods with hamcrest 64/156364/2
Matthias Sohn [Tue, 21 Jan 2020 16:50:57 +0000 (17:50 +0100)]
Replace deprecated junit assertion methods with hamcrest

Change-Id: Icebe8071eeefbc13d3bdbc231c568209cdc26195
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoUpdate to Orbit I20200120214610 and JUnit to 4.13 13/155913/3
David Pursehouse [Tue, 21 Jan 2020 16:27:59 +0000 (17:27 +0100)]
Update to Orbit I20200120214610 and JUnit to 4.13

Since version 4.13 JUnit has an assertThrows method. Remove the
implementation in MoreAsserts and use the one from JUnit.

CQ: 21439
Change-Id: I086baa94aa3069cebe87c4cbf91ed1534523c6cb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoUpdate to Tycho 1.6.0 13/156213/2
Michael Keppler [Mon, 20 Jan 2020 18:07:48 +0000 (19:07 +0100)]
Update to Tycho 1.6.0

Not many changes, but might lead to shorter build times.

Change-Id: I5d629e49e8bbdef7a5b116d4f28cdbf8a8528cf0
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoExtract method refactoring in class DirCacheCheckout 70/155670/7
Andre Bossert [Sun, 12 Jan 2020 16:44:23 +0000 (17:44 +0100)]
Extract method refactoring in class DirCacheCheckout

* added new public method getContent()
* changed checkoutEntry() to use the new getContent() method
* changed runExternalFilterCommand() parameter "entry" to "path" to be
independent from DirCacheEntry type
* removed runExternalFilterCommand() parameter "fs" as it can be derived
from repo

Bug: 356832
Change-Id: If8991b74870e0d8728093e98a990f93f1871b76a
Signed-off-by: Andre Bossert <andre.bossert@siemens.com>
4 years agoUpdate Orbit to I20200115225246 and update dependencies 03/156003/1
Matthias Sohn [Thu, 16 Jan 2020 00:54:38 +0000 (01:54 +0100)]
Update Orbit to I20200115225246 and update dependencies

update
- javaewah to 1.1.7.v20200107-0831
- org.apache.commons.codec to 1.13.0.v20200108-0001
- org.apache.commons.compress to 1.19.0.v20200106-2343
- org.apache.httpcomponents.httpclient to 4.5.10.v20200114-1512
- org.apache.httpcomponents.httpcore to 4.4.12.v20200108-1212

CQ: 21194
CQ: 21195
CQ: 21199
CQ: 21346
CQ: 21347
Change-Id: I1943f1c3bf1bb5d71b666cb6aea6083e80ff82dc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoUpdate bazlets and bazel version 02/156002/1
Matthias Sohn [Thu, 16 Jan 2020 12:07:20 +0000 (13:07 +0100)]
Update bazlets and bazel version

- bazlets need to be updated to react on Maven central no longer
supporting http protocol but only https
- update bazel to 2.0

Change-Id: I07f5f050f3b1db2014a5198a28b6bbf893434814
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.7' 70/155970/1
Matthias Sohn [Wed, 15 Jan 2020 23:58:04 +0000 (00:58 +0100)]
Merge branch 'stable-5.7'

* stable-5.7:
  Prepare 5.7.0-SNAPSHOT builds
  JGit v5.7.0.202001151323-m1

Change-Id: Ic4294957bdf409e4bfcb104132e724e7e5c4843e

4 years agoPrepare 5.7.0-SNAPSHOT builds 64/155964/1
Matthias Sohn [Wed, 15 Jan 2020 21:15:27 +0000 (22:15 +0100)]
Prepare 5.7.0-SNAPSHOT builds

Change-Id: I106098e85db05bb0142f9fb406e3aef3cf0238b4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoJGit v5.7.0.202001151323-m1 42/155942/1 v5.7.0.202001151323-m1
Matthias Sohn [Wed, 15 Jan 2020 18:22:36 +0000 (19:22 +0100)]
JGit v5.7.0.202001151323-m1

Change-Id: I7701bee6f05d66012c59092126eb4d52f828dc24
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoUpgrade jetty to 9.4.25.v20191220 21/155921/1
Matthias Sohn [Wed, 15 Jan 2020 15:14:17 +0000 (16:14 +0100)]
Upgrade jetty to 9.4.25.v20191220

Change-Id: I6a14c2beec3075eac5807cd639f55f38ae8c9c49
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoAdd ReftableNumbersNotIncreasingException#toString 82/155882/2
Han-Wen Nienhuys [Tue, 14 Jan 2020 19:13:48 +0000 (20:13 +0100)]
Add ReftableNumbersNotIncreasingException#toString

Change-Id: I28b6a6476df185f3f98f8020408b4b120086cb0b
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMove ConnectivityChecker to fix API leak 58/155558/1
Matthias Sohn [Thu, 9 Jan 2020 17:06:05 +0000 (18:06 +0100)]
Move ConnectivityChecker to fix API leak

Protected field ReceivePack.connectivityChecker is of type
ConnectivityChecker which was located in internal package
org.eclipse.jgit.transport and was thus leaking an internal type.

In order to fix this move ConnectivityChecker to package
org.eclipse.jgit.transport.

Change-Id: Idc0af75502faf39f13a56157bbb6964d24720eb8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.6' 53/155553/1
Matthias Sohn [Thu, 9 Jan 2020 15:50:13 +0000 (16:50 +0100)]
Merge branch 'stable-5.6'

* stable-5.6:
  Fix API problem filters
  Fix unclosed resource warning in SmartOutputStream
  JschConfigSessionFactory: fix boxing warning
  SshSupport#runSshCommand: don't throw exception in finally block
  Don't override already managed maven-compiler-plugin version
  Remove unused import from CreateFileSnapshotBenchmark
  Remove duplicate ignore_optional_problems entry in .classpath
  Update maven-site-plugin used by benchmark module to 3.8.2
  Add dependency to enable site generation for benchmark module
  Ignore warnings for generated source code in
org.eclipse.jgit.benchmark
  Fix MBean registration
  Enhance WindowCache statistics

Change-Id: I4a77c602bfffed60535d0b8fc251a552b128068d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.5' into stable-5.6 51/155551/1
Matthias Sohn [Thu, 9 Jan 2020 12:14:38 +0000 (13:14 +0100)]
Merge branch 'stable-5.5' into stable-5.6

* stable-5.5:
  Fix API problem filters
  Fix unclosed resource warning in SmartOutputStream
  JschConfigSessionFactory: fix boxing warning
  SshSupport#runSshCommand: don't throw exception in finally block
  Don't override already managed maven-compiler-plugin version
  Remove unused import from CreateFileSnapshotBenchmark
  Remove duplicate ignore_optional_problems entry in .classpath
  Update maven-site-plugin used by benchmark module to 3.8.2
  Add dependency to enable site generation for benchmark module
  Ignore warnings for generated source code in
org.eclipse.jgit.benchmark
  Fix MBean registration
  Enhance WindowCache statistics

Change-Id: I11f9a387ac3dc7d22a4f2e70bb8d89169b4e9afe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.4' into stable-5.5 38/155538/1
Matthias Sohn [Thu, 9 Jan 2020 11:32:03 +0000 (12:32 +0100)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Fix API problem filters
  Fix unclosed resource warning in SmartOutputStream
  JschConfigSessionFactory: fix boxing warning
  SshSupport#runSshCommand: don't throw exception in finally block
  Don't override already managed maven-compiler-plugin version
  Remove unused import from CreateFileSnapshotBenchmark
  Remove duplicate ignore_optional_problems entry in .classpath
  Update maven-site-plugin used by benchmark module to 3.8.2
  Add dependency to enable site generation for benchmark module
  Ignore warnings for generated source code in
org.eclipse.jgit.benchmark
  Fix MBean registration
  Enhance WindowCache statistics

Change-Id: I78902d5feecb2c09134b64ec2f3b48b2c3bab37d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.3' into stable-5.4 36/155536/1
Matthias Sohn [Thu, 9 Jan 2020 10:38:28 +0000 (11:38 +0100)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Fix API problem filters
  Fix unclosed resource warning in SmartOutputStream
  JschConfigSessionFactory: fix boxing warning
  SshSupport#runSshCommand: don't throw exception in finally block
  Don't override already managed maven-compiler-plugin version
  Remove unused import from CreateFileSnapshotBenchmark
  Remove duplicate ignore_optional_problems entry in .classpath
  Update maven-site-plugin used by benchmark module to 3.8.2
  Add dependency to enable site generation for benchmark module
  Ignore warnings for generated source code in
org.eclipse.jgit.benchmark
  Fix MBean registration
  Enhance WindowCache statistics

Change-Id: I1b560b36d169cfa02cc5450ad0fa0bd85f9f42d8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.2' into stable-5.3 24/155524/1
Matthias Sohn [Thu, 9 Jan 2020 01:19:03 +0000 (02:19 +0100)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Fix API problem filters
  Fix unclosed resource warning in SmartOutputStream
  JschConfigSessionFactory: fix boxing warning
  SshSupport#runSshCommand: don't throw exception in finally block
  Don't override already managed maven-compiler-plugin version
  Remove unused import from CreateFileSnapshotBenchmark
  Remove duplicate ignore_optional_problems entry in .classpath
  Update maven-site-plugin used by benchmark module to 3.8.2
  Add dependency to enable site generation for benchmark module
  Ignore warnings for generated source code in
org.eclipse.jgit.benchmark
  Fix MBean registration
  Enhance WindowCache statistics

Change-Id: I67a07d92718188bdf7f8a13b83e9f538ecf4b22f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.1' into stable-5.2 23/155523/1
Matthias Sohn [Thu, 9 Jan 2020 01:03:45 +0000 (02:03 +0100)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Fix unclosed resource warning in SmartOutputStream
  JschConfigSessionFactory: fix boxing warning
  SshSupport#runSshCommand: don't throw exception in finally block
  Don't override already managed maven-compiler-plugin version
  Remove unused import from CreateFileSnapshotBenchmark
  Remove duplicate ignore_optional_problems entry in .classpath
  Update maven-site-plugin used by benchmark module to 3.8.2
  Add dependency to enable site generation for benchmark module
  Ignore warnings for generated source code in
org.eclipse.jgit.benchmark
  Fix MBean registration
  Enhance WindowCache statistics

Change-Id: Ic90aacf1ea40e13dc564d4d659e79535e86d0300
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoFix API problem filters 22/155522/1
Matthias Sohn [Sat, 4 Jan 2020 12:01:39 +0000 (13:01 +0100)]
Fix API problem filters

Change-Id: Icc78570f949ad64beb58caa192c829e536aa8dad
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoFix unclosed resource warning in SmartOutputStream 12/155212/2
Matthias Sohn [Sat, 4 Jan 2020 16:03:52 +0000 (17:03 +0100)]
Fix unclosed resource warning in SmartOutputStream

Change-Id: Ia4b96ae1c2cc9357802487384ee32a80ed40334b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoJschConfigSessionFactory: fix boxing warning 11/155211/2
Matthias Sohn [Sat, 4 Jan 2020 15:06:54 +0000 (16:06 +0100)]
JschConfigSessionFactory: fix boxing warning

Change-Id: I1735033c56b444a9a7160cb7df89292a228d5b34
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoSshSupport#runSshCommand: don't throw exception in finally block 10/155210/2
Matthias Sohn [Sat, 4 Jan 2020 14:44:19 +0000 (15:44 +0100)]
SshSupport#runSshCommand: don't throw exception in finally block

The CommandFailedException which was thrown in finally block is silently
discarded [1]. Refactor this method to throw the exception after the
finally block.

This fixes the warning "Null comparison always yields false: The
variable failure can only be null at this location".

[1] https://wiki.sei.cmu.edu/confluence/display/java/ERR04-J.+Do+not+complete+abruptly+from+a+finally+block
https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.20.2

Change-Id: Idbfc303d9c9046ab9a43e0d4c6d65d325bdaf0ed
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoRemove no longer used API problem filter 48/155248/1
Matthias Sohn [Sun, 5 Jan 2020 21:06:06 +0000 (22:06 +0100)]
Remove no longer used API problem filter

Change-Id: I29e7af25bad5282c6b09e4688bdcf23e22a0648f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoDon't override already managed maven-compiler-plugin version 09/155209/1
Matthias Sohn [Sat, 4 Jan 2020 12:15:37 +0000 (13:15 +0100)]
Don't override already managed maven-compiler-plugin version

Change-Id: Ie2cb178cf8d805aadc76a2096bcdde95a146d07c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoRemove unused import from CreateFileSnapshotBenchmark 08/155208/1
Matthias Sohn [Sat, 4 Jan 2020 12:11:06 +0000 (13:11 +0100)]
Remove unused import from CreateFileSnapshotBenchmark

Change-Id: Iad0bcc01ada4252e9ab4f60d4375f98f084f6a5f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoRemove duplicate ignore_optional_problems entry in .classpath 07/155207/1
Matthias Sohn [Sat, 4 Jan 2020 12:10:00 +0000 (13:10 +0100)]
Remove duplicate ignore_optional_problems entry in .classpath

Change-Id: I326377c90af59ecaada7f5185a638726a8e909b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoRemove duplicate copyright statements 91/155191/1
Matthias Sohn [Sat, 4 Jan 2020 00:34:46 +0000 (01:34 +0100)]
Remove duplicate copyright statements

Change-Id: I9a85136e1cc47693d1e475d00916c214c9aa55f4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoUpdate EDL 1.0 license headers to new short SPDX compliant format 90/155190/2
Matthias Sohn [Fri, 3 Jan 2020 23:50:50 +0000 (00:50 +0100)]
Update EDL 1.0 license headers to new short SPDX compliant format

This is the format given by the Eclipse legal doc generator [1].

[1] https://www.eclipse.org/projects/tools/documentation.php?id=technology.jgit

Bug: 548298
Change-Id: I8d8cabc998ba1b083e3f0906a8d558d391ffb6c4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoUpdate spring-boot-maven-plugin to 2.1.5.RELEASE 34/155034/3
Matthias Sohn [Wed, 25 Dec 2019 22:34:41 +0000 (23:34 +0100)]
Update spring-boot-maven-plugin to 2.1.5.RELEASE

Change-Id: If16a72a1270eb57bc1fb27b18b8c396453dbbe60
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoTLS support on IBM JDKs 30/155130/3
Thomas Wolf [Tue, 31 Dec 2019 22:08:10 +0000 (23:08 +0100)]
TLS support on IBM JDKs

SSLContext.getInstance("TLS") by default behaves differently on IBM
JDK than on Oracle or OpenJDK.[1] On IBM JDK one gets sockets that
have only TLSv1 enabled, which makes HTTPS connections fail since most
servers refuse this old protocol version. On Oracle JDK/OpenJDK, one
gets sockets with all available protocol versions enabled.

Explicitly enable all available TLS protocol versions to make
HTTPS connections work also on IBM JDK.

[1] https://www.ibm.com/support/knowledgecenter/en/SSYKE2_8.0.0/com.ibm.java.security.component.80.doc/security-component/jsse2Docs/matchsslcontext_tls.html#matchsslcontext_tls

Bug: 558709
Change-Id: I5ffc57a78e67a6239b9dad54840a49a8ed28930a
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.6' 35/155035/1
Matthias Sohn [Wed, 25 Dec 2019 23:18:45 +0000 (00:18 +0100)]
Merge branch 'stable-5.6'

* stable-5.6:
  Hooks: avoid problems with backslashes in paths

Change-Id: Ia9e4aca11de5a465b60898a37441a17133f6355b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoUpgrade maven-source-plugin to 3.2.1 26/155026/1
David Pursehouse [Wed, 25 Dec 2019 11:14:15 +0000 (11:14 +0000)]
Upgrade maven-source-plugin to 3.2.1

Change-Id: I01b0e6cc71f841680bc4116502837af2519379f9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoUpgrade ecj to 3.20.0 25/155025/1
David Pursehouse [Wed, 25 Dec 2019 11:13:23 +0000 (11:13 +0000)]
Upgrade ecj to 3.20.0

Change-Id: Ic72d05567d4c90f3d720a166afe99148fb003592
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoHooks: avoid problems with backslashes in paths 14/155014/1
Thomas Wolf [Tue, 24 Dec 2019 11:13:29 +0000 (12:13 +0100)]
Hooks: avoid problems with backslashes in paths

Calling sh -c with a script path containing backslashes may fail since
the shell may try to process them as escape characters.

Instead of calling

  sh.exe -c 'C:\path\script "$@"' 'C:\path\script' other args

call

  sh.exe -c '$0 "$@"' 'C:\path\script' other args

which avoids this escape processing.

Note that this is not specific to Windows. If the path or the script
name contain backslashes, this also occurs on Unix.

Bug: 558577
Change-Id: I47d63db6f8644f956c55c42b07dbcad7d7f305aa
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
4 years agoUpdate jetty to 9.4.24.v20191120 80/154980/1
Matthias Sohn [Sun, 22 Dec 2019 23:47:25 +0000 (00:47 +0100)]
Update jetty to 9.4.24.v20191120

Change-Id: I6b3dbdfaf344efd174c0786902170f349b1bc8ff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoUpdate maven-site-plugin used by benchmark module to 3.8.2 69/154769/1
Matthias Sohn [Wed, 18 Dec 2019 14:50:35 +0000 (15:50 +0100)]
Update maven-site-plugin used by benchmark module to 3.8.2

The benchmark module currently has no parent, adjust the version used
here to the one used by all the other jgit Maven modules.

Change-Id: I8807a694fe23f8f131d1d22a58a3e18874d756cc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoAdd dependency to enable site generation for benchmark module 68/154768/1
Matthias Sohn [Wed, 18 Dec 2019 14:49:18 +0000 (15:49 +0100)]
Add dependency to enable site generation for benchmark module

Change-Id: Iae4524ddc730d57993e9c6d6807282e4b07d1336
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoUsing StringBuilder in StringUtils#capitalize method 05/154705/2
Lars Vogel [Tue, 17 Dec 2019 22:51:00 +0000 (23:51 +0100)]
Using StringBuilder in StringUtils#capitalize method

StringBuffer is synchronized which is slower and should be replaced with
StringBuilder according to its Javadoc.

Change-Id: If4d4a5a49da289ded34bbec97132ab7636b937cc
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
4 years agoIgnore warnings for generated source code in org.eclipse.jgit.benchmark 38/154638/1
Matthias Sohn [Mon, 16 Dec 2019 14:22:08 +0000 (15:22 +0100)]
Ignore warnings for generated source code in org.eclipse.jgit.benchmark

The source code in the folder .apt_generated is generated by the JMH
code generator, so there's no point in raising any warnings as this
could only be fixed in the upstream code generator.

Change-Id: I882888e7bf924f9ae74182598fcb91671a5c9818
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoAdd resource preferences for top level jgit project 63/154563/1
Matthias Sohn [Mon, 16 Dec 2019 10:20:12 +0000 (11:20 +0100)]
Add resource preferences for top level jgit project

Define resource preferences for the root directory of the jgit
repository imported as an Eclipse project. This allows to work on files
in the root folder inside Eclipse workspace.

Change-Id: I1885841fd612a646b0b9a31f001ced5ca112e90d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agopgm: add option if reflogs should be written when converting to reftable 40/154540/3
Matthias Sohn [Sat, 14 Dec 2019 22:14:50 +0000 (23:14 +0100)]
pgm: add option if reflogs should be written when converting to reftable

Change-Id: Ie1c38121005965e63015d9a2af26a1caa88d73fa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agopgm: add option to configure if convert-ref-storage should create backup 39/154539/3
Matthias Sohn [Sat, 14 Dec 2019 22:06:47 +0000 (23:06 +0100)]
pgm: add option to configure if convert-ref-storage should create backup

Change-Id: I926f116797508a5982961dfd30c2f765d9536eee
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoSet config "extensions" option when converting ref storage format 38/154538/2
Matthias Sohn [Sat, 14 Dec 2019 21:45:09 +0000 (22:45 +0100)]
Set config "extensions" option when converting ref storage format

When converting to reftable format the option extensions.refStorage must
be set to "reftable" [1]. When converting back to refdir format this
config option needs to be removed.

Introduce constants for refStorage config options, also for the
"reftree" format.

[1] https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/master/Documentation/technical/reftable.md#Version-1

Change-Id: I190222fa5edc1ad7309daa9be17ca934ff7971e3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoExternalize error message in FileRepository#convertRefStorage 37/154537/1
Matthias Sohn [Sat, 14 Dec 2019 21:10:12 +0000 (22:10 +0100)]
Externalize error message in FileRepository#convertRefStorage

Change-Id: I5d3acaa883ee7eb8d244b55b3e708cbe018690c6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoFix indentation in ConvertRefStorage 36/154536/1
Matthias Sohn [Sat, 14 Dec 2019 21:05:16 +0000 (22:05 +0100)]
Fix indentation in ConvertRefStorage

Change-Id: Icd007b035e728f641c70cda68befa11a6197003f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoReplace chain of if statements with switch 64/140164/18
Carsten Hammer [Tue, 21 May 2019 15:04:18 +0000 (17:04 +0200)]
Replace chain of if statements with switch

and switch over strings where possible. Sometimes if statements are
chained and form a series of comparisons against constants. Using switch
statements improves readability.

Bug: 545856
Change-Id: Iacb78956ee5c20db4d793e6b668508ec67466606
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoFix MBean registration 94/154494/1
Matthias Sohn [Fri, 13 Dec 2019 16:32:51 +0000 (17:32 +0100)]
Fix MBean registration

Change-Id: I6f6b8641f6c3e8ab9f625594085014272305656a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge "Update API baseline for 5.7 to 5.6.0.201912101111-r"
David Pursehouse [Thu, 12 Dec 2019 07:55:08 +0000 (02:55 -0500)]
Merge "Update API baseline for 5.7 to 5.6.0.201912101111-r"

4 years agoMinor - Removes unnecessary whitespace in ReftableReader 17/154317/2
Lars Vogel [Wed, 11 Dec 2019 14:44:20 +0000 (15:44 +0100)]
Minor - Removes unnecessary whitespace in ReftableReader

Change-Id: Id0c3463d1b03e258d8633298828ef7cfcd44e13f
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
4 years agoUpdate API baseline for 5.7 to 5.6.0.201912101111-r 99/154299/1
Matthias Sohn [Wed, 11 Dec 2019 13:43:37 +0000 (14:43 +0100)]
Update API baseline for 5.7 to 5.6.0.201912101111-r

Change-Id: I93280812f8db8fdd91dfcd9e4faa13ed4d6e464c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.6' 98/154298/1
Matthias Sohn [Wed, 11 Dec 2019 13:41:04 +0000 (14:41 +0100)]
Merge branch 'stable-5.6'

* stable-5.6:
  Prepare 5.6.1-SNAPSHOT builds
  JGit v5.6.0.201912101111-r

Change-Id: I7824278560d828e1c6e2d540e3372e19507a39c0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoPrepare 5.6.1-SNAPSHOT builds 60/154260/1
Matthias Sohn [Wed, 11 Dec 2019 01:04:21 +0000 (02:04 +0100)]
Prepare 5.6.1-SNAPSHOT builds

Change-Id: Iaa72d2ea6764ccd4fb6a124b51d89fe6492c602d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoJGit v5.6.0.201912101111-r 22/154222/1 v5.6.0.201912101111-r
Matthias Sohn [Tue, 10 Dec 2019 16:35:05 +0000 (17:35 +0100)]
JGit v5.6.0.201912101111-r

Change-Id: Icbb3b46f9d04e45da53936860e07e69fde12971c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoChange the wildcard import to explicit ones. 57/154157/1
Yunjie Li [Mon, 9 Dec 2019 22:34:16 +0000 (14:34 -0800)]
Change the wildcard import to explicit ones.

Change-Id: Ia7bc1c4b6b82c127e1e4e0e657f69d249684e8e6
Signed-off-by: Yunjie Li <yunjieli@google.com>
4 years agoMerge branch 'stable-5.6' 96/154096/1
Matthias Sohn [Mon, 9 Dec 2019 09:14:38 +0000 (10:14 +0100)]
Merge branch 'stable-5.6'

* stable-5.6:
  Add ability to redirect stderr from git hooks
  Add possibility to get pure stderr output from AbortedByHookException

Change-Id: Ifc02675542dad6ced25fdd8b9fae80b5736db688
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoAdd ability to redirect stderr from git hooks 36/153536/2
Tim Neumann [Thu, 28 Nov 2019 14:56:50 +0000 (15:56 +0100)]
Add ability to redirect stderr from git hooks

This will change the behavior in the CLI to resemble that of C-Git more
closely by printing the stderr of the hooks to the CLI stderr
independently of the exit code of the hook.

This is also useful for the corresponding EGIT-Change, which will add
the ability to show the hook output in eclipse.
With this also the stderr can be shown even if the exit code is 0.

Bug: 553471
Change-Id: Ie7bc503fe39e270e9b93dd1108b5879f02a12b4c
Signed-off-by: Tim Neumann <Tim.Neumann@advantest.com>
4 years agoAdd possibility to get pure stderr output from AbortedByHookException 28/153528/2
Tim Neumann [Thu, 28 Nov 2019 11:56:12 +0000 (12:56 +0100)]
Add possibility to get pure stderr output from AbortedByHookException

This is a preparation for the corresponding EGit change to remove
redundant output in the aborted by commit hook popup.

Bug: 553469
Change-Id: Id5f39a4df659fafc9d951668e6f53fed4380de9d
Signed-off-by: Tim Neumann <Tim.Neumann@advantest.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoEnhance WindowCache statistics 01/153601/6
Matthias Sohn [Sat, 30 Nov 2019 02:38:13 +0000 (03:38 +0100)]
Enhance WindowCache statistics

Add the following statistics
- cache hit count and hit ratio
- cache miss count and miss ratio
- count of successful and failed loads
- rate of failed loads
- load, eviction and request count
- average and total load time

Use LongAdder instead of AtomicLong to implement counters in order to
improve scalability.

Optionally expose these metrics via JMX, they are registered with the
platform MBean server if the config option jmx.WindowCacheStats = true
in the user or system level git config.

Bug: 553573
Change-Id: Ia2d5246ef69b9c2bd594a23934424bc5800774aa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.6' 58/153958/1
David Pursehouse [Fri, 6 Dec 2019 01:19:58 +0000 (10:19 +0900)]
Merge branch 'stable-5.6'

* stable-5.6:
  Cleanup CommitAndLogCommandTest
  CLI: Add support for excluding paths from Git log command

Change-Id: I2f48e16640ab1b13f0c32779422add3162260c50
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoFix API check errors introduced in ReceivePack in 945d43d5 54/153954/1
Matthias Sohn [Thu, 5 Dec 2019 22:34:40 +0000 (23:34 +0100)]
Fix API check errors introduced in ReceivePack in 945d43d5

- add missing @since tag on new field connectivityChecker
- suppress warning for this added field which may affect subclasses
which is ok

Change-Id: Id6c22258efd10fa3847290f3dcfa42893b6ae882
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoCleanup CommitAndLogCommandTest 49/153949/1
Matthias Sohn [Thu, 5 Dec 2019 21:48:55 +0000 (22:48 +0100)]
Cleanup CommitAndLogCommandTest

- if a test can throw different exceptions declare it throws Exception
- fix code formatting

Change-Id: I55d63918f3163b31f2297d6217d5855108dd43b5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoCLI: Add support for excluding paths from Git log command 73/153673/5
John Tipper [Mon, 2 Dec 2019 23:00:19 +0000 (23:00 +0000)]
CLI: Add support for excluding paths from Git log command

Git log supports the exclude pathspec, which allows for excluding paths
from the log command. JGit only supports adding paths to the log
command. See the following StackOverflow question for details:
https://stackoverflow.com/questions/59143934/java-jgit-how-to-get-git-
commits-not-affecting-certain-directories
This commit adds an excludePath() method to the log command. It does not
yet support regex or glob wildcards.

Change-Id: I8cd59950b87850b55a15c7e2ea5470145c9aae28
Signed-off-by: John Tipper <john_tipper@hotmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoReceivePack: Moves connectivity check to separate class 97/152097/11
Demetr Starshov [Tue, 8 Oct 2019 23:53:22 +0000 (16:53 -0700)]
ReceivePack: Moves connectivity check to separate class

Move all connectivity check to separate classes. Set default to be
FullConnectivityChecker i.e. checker which will check connectivity
from all advertised refs. Add ability to set other connectivity
checker which can use different approach.

Signed-off-by: Demetr Starshov <dstarshov@google.com>
Change-Id: Ibb107dbfbdde8ad109be25b5ecf42be7660ef736

4 years agoUpgrade error_prone_core to 2.3.4 55/153755/3
David Pursehouse [Wed, 4 Dec 2019 03:57:40 +0000 (12:57 +0900)]
Upgrade error_prone_core to 2.3.4

Change-Id: I7e91acc4d094d92cac41d5044268dfc2208bb663
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoMerge branch 'stable-5.6' 72/153872/1
David Pursehouse [Thu, 5 Dec 2019 01:46:40 +0000 (10:46 +0900)]
Merge branch 'stable-5.6'

* stable-5.6:
  ReftableTest: Clean up boxing warnings on usage of String.format
  MergedReftable: Remove unnecessary semicolon

Change-Id: Id35406acfdd91c3ddf17ce4e1023395f774774f2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoSuppress API error for RefDatabase.hasFastTipsWithSha1() 66/153866/1
Matthias Sohn [Thu, 5 Dec 2019 00:56:31 +0000 (01:56 +0100)]
Suppress API error for RefDatabase.hasFastTipsWithSha1()

This method was added in stable-5.6 after 5.6 RC1 was tagged. It's shown
as an API error when using 5.6.0 RC1 as the API baseline for master.
This suppression can be removed when 5.6 is released which will serve as
the API baseline for 5.7.

Change-Id: Ic6359fe59ed2d2a9431583b0854ec86bbac76880
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoRemove API filters which became obsolete after bumping version to 5.7.0 65/153865/1
Matthias Sohn [Thu, 5 Dec 2019 00:55:04 +0000 (01:55 +0100)]
Remove API filters which became obsolete after bumping version to 5.7.0

Change-Id: I00b8d3e2e1023794f24d9447e3b0214c50353838
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoReftableTest: Clean up boxing warnings on usage of String.format 67/153867/1
David Pursehouse [Thu, 5 Dec 2019 00:54:14 +0000 (09:54 +0900)]
ReftableTest: Clean up boxing warnings on usage of String.format

Passing int as an argument to String.format causes a warning:

  The expression of type int is boxed into Integer

Most of these are already suppressed, but there are a couple that are
not. Add suppressions for those.

For the existing ones, move the suppression scope from the method to
the actual usage. Where necessary extract the usage out to a local
variable.

Change-Id: I7a7ff6dec49467e4b5c58d27a231c74e6e1c5437
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoAdd missing @since tag for ReceivePack#receiveWithExceptionPropagation 64/153864/1
Matthias Sohn [Thu, 5 Dec 2019 00:51:29 +0000 (01:51 +0100)]
Add missing @since tag for ReceivePack#receiveWithExceptionPropagation

Change-Id: Ie64abc3e5bcf6dbaecfa8f2cb50796703ebd1f39
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMergedReftable: Remove unnecessary semicolon 61/153861/1
David Pursehouse [Thu, 5 Dec 2019 00:42:52 +0000 (09:42 +0900)]
MergedReftable: Remove unnecessary semicolon

Change-Id: I67d2b8ba3cd8f94363cea864918c8ed6026f2d18
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoPrepare 5.7.0-SNAPSHOT builds 63/153863/1
Matthias Sohn [Thu, 5 Dec 2019 00:32:59 +0000 (01:32 +0100)]
Prepare 5.7.0-SNAPSHOT builds

Change-Id: I7efa0cd08dee711d6fefc3e6bb478a3cb11fe85c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.6' 62/153862/1
Matthias Sohn [Thu, 5 Dec 2019 00:31:32 +0000 (01:31 +0100)]
Merge branch 'stable-5.6'

* stable-5.6:
  Introduce RefDatabase#hasFastTipsWithSha1
  Update Orbit to R20191126223242 for 2019-12
  Prepare 5.6.0-SNAPSHOT builds
  JGit v5.6.0.201912041214-rc1
  Prepare 5.6.0-SNAPSHOT builds
  JGit v5.6.0.201911271000-m3

Change-Id: Id33b054131bbcd27a0ae7200f564775049698d2c

4 years agoIntroduce RefDatabase#hasFastTipsWithSha1 43/152843/13
Han-Wen Nienhuys [Mon, 18 Nov 2019 00:29:16 +0000 (16:29 -0800)]
Introduce RefDatabase#hasFastTipsWithSha1

The reftable format supports fast inverse (SHA1 => ref) queries.

If the ref database does not support fast inverse queries, it may be
advantageous to build a complete SHA1 to ref map in advance for
multiple uses. To let applications decide, this function indicates
whether the inverse map is available.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: Idaf7e01075906972ec21332cade285289619c2b3

4 years agoUpdate Orbit to R20191126223242 for 2019-12 50/153850/1
Matthias Sohn [Wed, 4 Dec 2019 21:41:13 +0000 (22:41 +0100)]
Update Orbit to R20191126223242 for 2019-12

Change-Id: I205d4f4a529f34c15a1afb4c791088a8e22986f0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoPrepare 5.6.0-SNAPSHOT builds 43/153843/1
Matthias Sohn [Wed, 4 Dec 2019 21:13:56 +0000 (22:13 +0100)]
Prepare 5.6.0-SNAPSHOT builds

Change-Id: I5e737ff7f262fdd43fc975a0b3594c8b33919663
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoJGit v5.6.0.201912041214-rc1 24/153824/1 v5.6.0.201912041214-rc1
Matthias Sohn [Wed, 4 Dec 2019 17:14:43 +0000 (18:14 +0100)]
JGit v5.6.0.201912041214-rc1

Change-Id: I5ed21fbc5f83096bf0b79f2aa751db415cbcc7e8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge changes I1f968649,Ied678797
Terry Parker [Mon, 2 Dec 2019 23:21:33 +0000 (18:21 -0500)]
Merge changes I1f968649,Ied678797

* changes:
  UploadPackServlet: Use uploadWithExceptionPropagation
  GitSmartHttpTools: Do not use sideband when sending an error

4 years agoserver: Add a custom error handler 62/152362/3
Masaya Suzuki [Fri, 8 Nov 2019 18:48:03 +0000 (10:48 -0800)]
server: Add a custom error handler

Same as UploadPack, add a custom error handler.

Change-Id: I9c708aa5a22e01214c1d997fa6f72f4b8bf814f0
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
4 years agotransport: Add methods that do not handle exceptions 61/152361/2
Masaya Suzuki [Fri, 8 Nov 2019 18:31:16 +0000 (10:31 -0800)]
transport: Add methods that do not handle exceptions

Same as UploadPack. These methods do not handle exceptions and the
caller can handle them. This makes it possible to customize the error
handling.

Change-Id: Ia5203f80133cb5b3e5d754859b4167ac920eaf14
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
4 years agotransport: Let users specify an error handler for unpacking a pack file 60/152360/2
Masaya Suzuki [Fri, 8 Nov 2019 18:12:20 +0000 (10:12 -0800)]
transport: Let users specify an error handler for unpacking a pack file

Currently, there's no way for a user to customize the error handler for
the exception happened during unpacking an incoming pack file. Create an
error handler class and let them specify one.

Change-Id: Id07638ee58c88e1365181c3ddd17ee0266f3934d
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
4 years agoReceivePack: Use try-with-resources for PostReceiveHook 59/152359/2
Masaya Suzuki [Fri, 8 Nov 2019 03:07:57 +0000 (19:07 -0800)]
ReceivePack: Use try-with-resources for PostReceiveHook

Instead of dropping a second exception, use try-with-resources so that
exception thrown by a hook is attached as a suppressed exception.

This removes a need of holding an exception that is thrown while
unpacking an incoming packfile.

Change-Id: I74d8b944931abbf53d9d1ae5db2e889639fba027
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
4 years agotransport: Consolidate status reporting code 58/152358/2
Masaya Suzuki [Fri, 8 Nov 2019 02:52:17 +0000 (18:52 -0800)]
transport: Consolidate status reporting code

BaseReceivePack#sendStatusReport anyway needs to know
CAPABILITY_REPORT_STATUS. By moving this flag to BaseReceivePack,
simplify the status reporting code.

Change-Id: Iaa0878b1fc13057b687a7f01d25c85fd78c0423e
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
4 years agotransport: Add ReceiveCommandErrorHandler 57/152357/2
Masaya Suzuki [Fri, 8 Nov 2019 02:22:17 +0000 (18:22 -0800)]
transport: Add ReceiveCommandErrorHandler

This gives a chance to handle an exception for a user. For example, when
an IOException is thrown while executing
`walk.parseAny(cmd.getNewId())`, it's always handled as
REJECTED_MISSING_OBJECT. However, IOException can mean a Git storage IO
error. By introducing an error handler class, a user can add a custom
error handler for these cases.

Change-Id: I3e03a536e1d8e137cb0f6e596d71642e72adde9e
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
4 years agotransport: Move exception handler to the caller 56/152356/2
Masaya Suzuki [Fri, 8 Nov 2019 01:40:25 +0000 (17:40 -0800)]
transport: Move exception handler to the caller

Move exception handling code to the caller side. This is a preparation
for adding a custom error handler that is similar to UploadPack.

Note that `catch (Throwable t)` will not affect the exception spec since
Java will do an analysis of rethrown exceptions. See
https://docs.oracle.com/javase/8/docs/technotes/guides/language/catch-multiple.html.

Change-Id: I973a63d4b079c2cd1402afb3f2956e18b7d5a00c
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
4 years agotransport: Move handling code to the caller side 54/152354/2
Masaya Suzuki [Fri, 8 Nov 2019 01:15:57 +0000 (17:15 -0800)]
transport: Move handling code to the caller side

This removes a raw IOException at one level. Later we'll add a custom
exception handling mechanism like UploadPack.

Change-Id: I52a7423798c97b032d848351be8b6f144776b017
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
4 years agoUploadPackServlet: Use uploadWithExceptionPropagation 64/152364/2
Masaya Suzuki [Fri, 8 Nov 2019 22:30:29 +0000 (14:30 -0800)]
UploadPackServlet: Use uploadWithExceptionPropagation

As UploadPackErrorHandler's Javadoc says, UploadPackServlet should have
called uploadWithExceptionPropagation and let UploadPackErrorHandler to
handle the exception. Fix UploadPackServlet.

Change-Id: I1f9686495fcf3ef28598ccdff3e6f76a16c8bca3
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
4 years agoGitSmartHttpTools: Do not use sideband when sending an error 63/152363/2
Masaya Suzuki [Fri, 8 Nov 2019 22:40:19 +0000 (14:40 -0800)]
GitSmartHttpTools: Do not use sideband when sending an error

Unlike ReceivePack, the V0/V1 UploadPack response does not support
sideband except for the packfile parts. By sending an error in a
sideband packet, the JGit client says "Expected ACK/NACK, got: ...".

Use an error packet always. The recent Git clients will understand it
better than out-of-context sideband packets.

Change-Id: Ied6787973d3b6860c0b95c7910d4e4312bb7a184
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
4 years agoPrepare 5.6.0-SNAPSHOT builds 08/153508/1
Matthias Sohn [Wed, 27 Nov 2019 20:25:38 +0000 (21:25 +0100)]
Prepare 5.6.0-SNAPSHOT builds

Change-Id: I1e52d2dfb202b87ecb9d0273deaa2c8d8ce1864e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoJGit v5.6.0.201911271000-m3 91/153491/1 v5.6.0.201911271000-m3
Matthias Sohn [Wed, 27 Nov 2019 15:01:20 +0000 (16:01 +0100)]
JGit v5.6.0.201911271000-m3

Change-Id: I3810892c2bed947e4dfaa615a7b4d93eeb46abb9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge "ReceivePack: Open visibility for some methods"
Jonathan Nieder [Wed, 27 Nov 2019 04:56:40 +0000 (23:56 -0500)]
Merge "ReceivePack: Open visibility for some methods"

4 years agoReceivePack: Open visibility for some methods 24/152924/5
Ivan Frade [Tue, 19 Nov 2019 06:45:19 +0000 (22:45 -0800)]
ReceivePack: Open visibility for some methods

This partially reverts Ic6bb5e66. It made private some methods in
ReceivePack that were protected before. At least two of those methods
(#init and #receivePackAndCheckConnectivity) are used by out-of-tree
subclasses for tracing and testing.

Make ReceivePack#init() and ReceivePack#receivePackAndCheckConnectivity
protected again to allow tracing and testing.

Change-Id: I7ff22c091fbfc2d94009c449d58e7c5ac9f4f759
Signed-off-by: Ivan Frade <ifrade@google.com>
4 years agoJGit pgm: Format blame output to match canonical git 31/147131/13
Thomas Wolf [Tue, 6 Aug 2019 16:32:35 +0000 (18:32 +0200)]
JGit pgm: Format blame output to match canonical git

Canonical git shows the zero-Id for lines without commit, and
uses the current time stamp for such lines.

Also consider lines without commit when calculating the field
widths.

Change-Id: If0bee9b3e7f90861ad0f387f68e52ecc4a53dfd7
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
4 years agoMake blame work correctly on merge conflicts 30/147130/13
Thomas Wolf [Tue, 6 Aug 2019 16:31:35 +0000 (18:31 +0200)]
Make blame work correctly on merge conflicts

When a conflicting file was blamed, JGit would not identify lines
coming from the merge parents. The main cause for this was that
Blame and BlameCommand simply added the first DirCacheEntry found
for a file to its queue of candidates (blobs or commits) to consider.
In case of a conflict this typically is the merge base commit, and
comparing a auto-merged contents against that base would yield
incorrect results.

Such cases have to be handled specially. The candidate to be
considered by the blame must use the working tree contents, but
at the same time behave like a merge commit/candidate with HEAD
and the MERGE_HEADs as parents. Canonical git does something very
similar, see [1].

Implement that and add tests.

I first did this for the JGit pgm Blame command. When I then tried
to do the same in BlameCommand, I noticed that the latter also
included some fancy but incomplete CR-LF handling. In order to
be able to use the new BlameGenerator.prepareHead() also in
BlameCommand this CR-LF handling was also moved into BlameGenerator
and corrected in doing so.

(Just considering the git config settings was not good enough,
CR-LF behavior can also be influenced by .gitattributes, and even
by whether the file in the index has CR-LF. To correctly determine
CR-LF handling for check-in one needs to do a TreeWalk with at
least a FileTreeIterator and a DirCacheIterator.)

[1] https://github.com/git/git/blob/v2.22.0/blame.c#L174

Bug: 434330
Change-Id: I9d763dd6ba478b0b6ebf9456049d6301f478ef7c
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
4 years agoMerge branch 'stable-5.5' 83/153383/1
David Pursehouse [Tue, 26 Nov 2019 08:44:48 +0000 (17:44 +0900)]
Merge branch 'stable-5.5'

* stable-5.5:
  Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl
  Bazel: Add missing newlines at end of BUILD files

Change-Id: Ie32c3bae056fb0745892e6c20ad37d4994542d96
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>