Commit Graph

7763 Commits

Author SHA1 Message Date
Matthias Sohn ffb0a64464 Merge branch 'stable-5.6'
* stable-5.6:
  Prepare 5.3.8-SNAPSHOT builds
  JGit v5.3.7.202002110540-r
  Prepare 5.1.14-SNAPSHOT builds
  JGit v5.1.13.202002110435-r

Change-Id: I39c936b951870b0cc845e4ab54afdfb45ee65b20
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-12 00:14:02 +01:00
Matthias Sohn 44ad668d93 Merge branch 'stable-5.5' into stable-5.6
* stable-5.5:
  Prepare 5.3.8-SNAPSHOT builds
  JGit v5.3.7.202002110540-r
  Prepare 5.1.14-SNAPSHOT builds
  JGit v5.1.13.202002110435-r

Change-Id: I67e7b9994aff40b05792bee2306476cf749723e0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 23:53:43 +01:00
Matthias Sohn ffe4616b5f Merge branch 'stable-5.4' into stable-5.5
* stable-5.4:
  Prepare 5.3.8-SNAPSHOT builds
  JGit v5.3.7.202002110540-r
  Prepare 5.1.14-SNAPSHOT builds
  JGit v5.1.13.202002110435-r

Change-Id: I44b39161f775a52795f6bff312a27227e893651e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 23:52:50 +01:00
Matthias Sohn 044e70511a Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Prepare 5.3.8-SNAPSHOT builds
  JGit v5.3.7.202002110540-r
  Prepare 5.1.14-SNAPSHOT builds
  JGit v5.1.13.202002110435-r

Change-Id: I075f8b8f97a5e97602c058770fe12164af2ce66a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 23:51:38 +01:00
Matthias Sohn 003e4cfc23 Prepare 5.3.8-SNAPSHOT builds
Change-Id: I64ef3b4cf30e87d058001c2c6f1458f4b0c1df00
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 11:54:11 +01:00
Han-Wen Nienhuys c217d33ff8 Documentation/technical/reftable: improve repo layout
Previously, the list of tables was in .git/refs. This makes
repo detection fail in older clients, which is undesirable.

This is proposal was discussed and approved on the git@vger list at

  https://lore.kernel.org/git/CAFQ2z_PvKiz==GyS6J1H1uG0FRPL86JvDj+LjX1We4-yCSVQ+g@mail.gmail.com/

For backward compatibility, JGit could detect a file under .git/refs and
use it as a reftable list.

Change-Id: Ic0b974fa250cfa905463b811957e2a4fdd7bbc6b
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2020-02-11 11:52:35 +01:00
Matthias Sohn 0c3b425099 JGit v5.3.7.202002110540-r
Change-Id: I3ba41af516b9d3b74ac580b3e170ad0e6e0663d4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 11:37:34 +01:00
Matthias Sohn a3986d944f Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Prepare 5.1.14-SNAPSHOT builds
  JGit v5.1.13.202002110435-r

Change-Id: I78cbed22c0f0f5872fa44b9a564f6d31dcace582
2020-02-11 11:26:03 +01:00
Matthias Sohn 7c932a557e Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  Prepare 5.1.14-SNAPSHOT builds
  JGit v5.1.13.202002110435-r

Change-Id: I57fc818e719bc94f90ab1aeb34016eea74d84719
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 11:18:12 +01:00
Matthias Sohn 425e2607fe Prepare 5.1.14-SNAPSHOT builds
Change-Id: Ic7d6f1a6c3123af1a1fa782f052b0cea3b6f28c6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 11:12:20 +01:00
Matthias Sohn e0abe9e2a7 JGit v5.1.13.202002110435-r
Change-Id: Iedc8699ad1a24efe7ddb47ae919c75b9d36141d4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 10:30:36 +01:00
Matthias Sohn e68e0e7f03 Merge branch 'stable-5.6'
* stable-5.6:
  reftable: don't check deadline on the first try
  reftable: clarify comment
  reftable: clear cache on full compaction
  reftable: remove outdated comment
  reftable: clarify that LogCursor may return a null ReflogEntry

Change-Id: I9458a746311984fa687b3da964805e2568ed37f3
2020-02-11 01:39:27 +01:00
Han-Wen Nienhuys 79266a1fe5 reftable: don't check deadline on the first try
This helps debug stepping.

Change-Id: I020dafab4ffac75e6df0dbcde0ed4805c7867f72
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2020-02-11 00:03:33 +01:00
Han-Wen Nienhuys 936a031ca3 reftable: clarify comment
Change-Id: I16e32aeb325b604eb31f84db18a214f792395941
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 00:03:12 +01:00
Han-Wen Nienhuys 8c9f7656c3 reftable: clear cache on full compaction
The merged table contains handles to open files. A full compaction
causes those files to be closed, and so further lookups would fail
with EBADF.

Change-Id: I7bb74f7228ecc7fec9535b00e56a617a9c18e00e
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 00:03:09 +01:00
Han-Wen Nienhuys dd203f03c2 reftable: remove outdated comment
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I41a7d9934d53553b5f81f40ff9d663378676ac5d
2020-02-10 12:43:36 +01:00
Han-Wen Nienhuys 0bf2564433 reftable: clarify that LogCursor may return a null ReflogEntry
Change-Id: I1a4d5c262cd196dca37876aec00bb974a45e9fcd
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2020-02-10 12:43:36 +01:00
Matthias Sohn 009674e99f Merge branch 'stable-5.6'
* stable-5.6:
  Restore behavior of CloneCommand

Change-Id: I3092bf214c41436b57e0ede9d2202f8aabf15471
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-10 10:48:39 +01:00
Lars Vogel 9d1e477417 Use lambdas where possible
Using the batch cleanup operation via Source -> Cleanup -> "Use lambdas
where possible" from standard JDT.

Change-Id: I5452bd94fdccc920ade071228aeed3a8b9fdbe62
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
2020-02-05 06:11:06 -05:00
David Pursehouse 4e0a409f07 Merge "Include org.apache.commons.codec 1.13 in the JGit http.apache.feature" 2020-02-04 19:34:42 -05:00
David Pursehouse 614d8a15b9 Upgrade maven-pmd-plugin to 3.13.0
Change-Id: I6e20b77db743cd8578aa1f8688f893b746e861d1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2020-02-04 18:54:39 +09:00
Thomas Wolf 75a80c5d3c Restore behavior of CloneCommand
Commit 6216b0de changed the behavior of the setMirror(),
setCloneAllBranches(), and setBranchesToClone() operations. Before
that commit, these could be set and reset independently and only in
call() it would be determined what exactly to do. Since that commit,
the last of these calls would determine the operation. This means
that the sequence

  cloneCommand.setCloneAllBranches(true);
  cloneCommand.setBranchesToClone(/* some list of refs */);

would formerly do a "clone all" giving a fetch refspec with wildcards

  +refs/heads/*:refs/remotes/origin/*

which picks up new upstream branches, whereas since commit 6216b0de
individual non-wildcard fetch refspecs would be generated and new
upstream branches would not be fetched anymore.

Undo this behavioral change. Make the operations independently settable
and resettable again, and determine the exact operation only in call():
mirror=true > cloneAll=true > specific refs, where ">" means "takes
precedence over", and if none is set assume cloneAll=true.

Note that mirror=true implies setBare(true).

Bug: 559796
Change-Id: I7162b60e99de5e3e512bf27ff4113f554c94f5a6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2020-02-04 08:49:07 +01:00
Thomas Wolf 708525c67e Include org.apache.commons.codec 1.13 in the JGit http.apache.feature
We do include httpcomponents.httpclient, but that depends on
commons.codec. By including it here we can ensure that the version
needed is indeed available.

Bug: 559735
Change-Id: I16ef830cfe4f8e3b8a8ca08476fd655f41eee51b
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2020-02-02 22:44:56 +01:00
Matthias Sohn 730b7a5ebf Update Maven plugins
- maven-surefire-plugin to 3.0.0-M4
- japicmp-maven-plugin to 0.14.3

Change-Id: I9191620825e15b03a58c41cf3d3e64c6a58faf0f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-02 16:30:57 -05:00
Joshua Redstone 2a134e1541 AmazonS3: Speed up fetch, try recent packs first
When fetching remote objects, WalkFetchConnection searches remote
packs in the order provided by WalkRemoteObjectDatabase:getPackNames.
Previously, for TransportAmazonS3, the packs were in no particular
order. This resulted in potential many extra calls to get pack idx
files.

This change modifies TransportAmazonS3 and AmazonS3 so that
getPackNames returns a list sorted with the most recently modified
packs first.  In the case of fetching recent changes to a repo,
this dramatically reduces the number of packs searched and speeds
up fetch.

Note: WalkRemoteObjectDatabase::getPackNames does not specify
the order of the returned names.

Testing: did "mvn clean install" in root dir and all tests passed.
And manually constructed some S3 repos and using jgit.sh
confirmed that the freshest pack was checked first.

Change-Id: I3b968fee825e793be55566e28c2d69d0cbe53807
Signed-off-by: Joshua Redstone <redstone@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-02 14:44:22 +01:00
Matthias Sohn eaff0a2eba Merge branch 'stable-5.7'
* stable-5.7:
  Fix string format parameter for invalidRefAdvertisementLine
  WindowCache: add metric for cached bytes per repository
  pgm daemon: fallback to user and system config if no config specified
  WindowCache: add option to use strong refs to reference ByteWindows
  Replace usage of ArrayIndexOutOfBoundsException in treewalk
  Add config constants for WindowCache configuration options

Change-Id: I0538bcba259f7229790a602ac9de120464a1260d
2020-02-01 02:17:49 +01:00
Matthias Sohn 7e3e740cc7 Merge branch 'stable-5.6' into stable-5.7
* stable-5.6:
  Fix string format parameter for invalidRefAdvertisementLine
  WindowCache: add metric for cached bytes per repository
  pgm daemon: fallback to user and system config if no config specified
  WindowCache: add option to use strong refs to reference ByteWindows
  Replace usage of ArrayIndexOutOfBoundsException in treewalk
  Add config constants for WindowCache configuration options

Change-Id: I79d615dff66493b60d3a4bcbdc57b9455e8d6673
2020-02-01 02:09:37 +01:00
Matthias Sohn 3d59d1b80c Merge branch 'stable-5.5' into stable-5.6
* stable-5.5:
  Fix string format parameter for invalidRefAdvertisementLine
  WindowCache: add metric for cached bytes per repository
  pgm daemon: fallback to user and system config if no config specified
  WindowCache: add option to use strong refs to reference ByteWindows
  Replace usage of ArrayIndexOutOfBoundsException in treewalk
  Add config constants for WindowCache configuration options

Change-Id: I73d16b53df02bf735c2431588143efe225a4b5b4
2020-02-01 02:06:47 +01:00
Matthias Sohn 68b0645a2e Merge branch 'stable-5.4' into stable-5.5
* stable-5.4:
  Fix string format parameter for invalidRefAdvertisementLine
  WindowCache: add metric for cached bytes per repository
  pgm daemon: fallback to user and system config if no config specified
  WindowCache: add option to use strong refs to reference ByteWindows
  Replace usage of ArrayIndexOutOfBoundsException in treewalk
  Add config constants for WindowCache configuration options

Change-Id: I76a62da98182f0c504b1ea8b7d37cecdf4eea7e0
2020-02-01 01:53:27 +01:00
Matthias Sohn 195b8fc94c Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Fix string format parameter for invalidRefAdvertisementLine
  WindowCache: add metric for cached bytes per repository
  pgm daemon: fallback to user and system config if no config specified
  WindowCache: add option to use strong refs to reference ByteWindows
  Replace usage of ArrayIndexOutOfBoundsException in treewalk
  Add config constants for WindowCache configuration options

Change-Id: I12002dbfed9dff14fc6d2df9787d92eab5b1fa78
2020-02-01 01:28:40 +01:00
Matthias Sohn 48dd3385ab Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Fix string format parameter for invalidRefAdvertisementLine
  WindowCache: add metric for cached bytes per repository
  pgm daemon: fallback to user and system config if no config specified
  WindowCache: add option to use strong refs to reference ByteWindows
  Replace usage of ArrayIndexOutOfBoundsException in treewalk
  Add config constants for WindowCache configuration options

Change-Id: I790098be00ff3f9b8278d54ae4fb7c11311816e9
2020-02-01 01:14:01 +01:00
David Pursehouse f57a7bd230 Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  Fix string format parameter for invalidRefAdvertisementLine
  WindowCache: add metric for cached bytes per repository
  pgm daemon: fallback to user and system config if no config specified
  WindowCache: add option to use strong refs to reference ByteWindows

Change-Id: I741059a1d0d5950ab5bc16ec70352655ee926a24
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-01 01:09:46 +01:00
David Pursehouse 7d5300023e Fix string format parameter for invalidRefAdvertisementLine
The externalized error message added in f4fc640 ("BasePackConnection:
Check for expected length of ref advertisement", Dec 18, 2019) uses a
malformed string format. Since there is only one formatting argument,
it should be referenced with '{0}' rather than '{1}'.

Change-Id: Ibda864dfb0bb902fe07ae4bba73117b212046e8a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2020-01-31 08:38:49 +09:00
Matthias Sohn 0babfaad8c Update orbit to S20200128200239 for 2020-03 M2
- update org.junit to 4.13.0.v20200128-1312

Change-Id: Iaf4010f1d33635e5c69688874669d540e056b287
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-01-29 10:19:25 +01:00
Matthias Sohn 1f9c717ff7 WindowCache: add metric for cached bytes per repository
Since ObjectDatabase and PackFile don't know their repository use the
packfile's grand-grand-parent directory as an identifier for the
repository the packfile resides in.

Remove metric for a repository if the number of cached bytes for the
repository drops to 0 in order to ensure the map of cached bytes per
repository doesn't contain repositories which have no data cached in the
WindowCache.

Change-Id: I969ab8029db0a292e7585cbb36ca0baa797da20b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-01-28 11:24:06 +01:00
Matthias Sohn 187b7ad72e pgm daemon: fallback to user and system config if no config specified
If a config file is passed via option --config-file then use only the
options defined in that file. This helps to concisely configure the
daemon without side effects from global and system level git configs.

Otherwise fallback to user and system level configs.

Change-Id: I242de248f257579874ad0bfe4882a22502353b1f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-01-28 11:24:04 +01:00
Thomas Wolf af05850485 FS: re-order fields and use all uppercase for true constants
Change-Id: I49fb77d6a12ae9083b5bf5779dc74a3dc49d7594
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2020-01-28 09:52:14 +01:00
Alex Jitianu 64715a189f FS: Don't use innocuous threads for CompletableFuture
The default threads from the ForkJoinPool run without any privileges
when a SecurityManager is installed, leading to SecurityExceptions
when trying to create the probe file even if the application otherwise
has write privileges in the directory.

Use a dedicated ThreadPoolExecutor using daemon threads instead.

Bug: 551690
Change-Id: Id5376f09f0d7da5ceea367e1f0dfc70f823d62d3
Signed-off-by: Alex Jitianu <alex_jitianu@sync.ro>
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2020-01-28 09:52:14 +01:00
David Pursehouse 4cc13297cc ErrorProne: Enable and fix UnusedException check
Enable UnusedException at ERROR level which causes the build to fail
in many places with:

  [UnusedException] This catch block catches an symbol and re-throws
  another, but swallows the caught symbol rather than setting it as a
  cause. This can make debugging harder.

Fix it by setting the caught exception as cause on the subsequently
thrown exception.

Note: The grammatically incorrect error message is copy-pasted as-is
from the version of ErrorProne currently used in Bazel; it has been
fixed by [1] in the latest version.

[1] https://github.com/google/error-prone/commit/d57a39c

Change-Id: I11ed38243091fc12f64f1b2db404ba3f1d2e98b5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-01-27 14:40:08 +01:00
Matthias Sohn 0e4a717870 Update Orbit to I20200126235943 and org.junit to 4.13.0.v20200126-2018
Change-Id: I2eb4d34512d169aa7ec9b6437b49c6a43b4a8e38
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-01-27 09:52:52 +01:00
Matthias Sohn 7a23fc1250 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>
2020-01-27 09:52:51 +01:00
Emmanuel Hugonnet 54b1c7cc6a 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>
2020-01-25 15:58:47 +01:00
David Pursehouse 8fa3594565 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>
2020-01-24 16:49:14 +09:00
Matthias Sohn fc7b003163 ReceivePack: enable overriding filterCommands and executeCommands
Change-Id: Ib923e137f0fadd876434bcc49ebd0c9a4d90b45c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-01-24 15:46:08 +09:00
Matthias Sohn 8ada9048c5 Replace ExpectedException which was deprecated in junit 4.13
Change-Id: I64b0c057dd0a12aef2f3d56fa0c8a10e3b23fffd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-01-24 15:46:08 +09:00
Matthias Sohn b5cabfbff2 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>
2020-01-24 15:46:03 +09:00
Matthias Sohn c49c0f9912 Replace deprecated junit assertion methods with hamcrest
Change-Id: Icebe8071eeefbc13d3bdbc231c568209cdc26195
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-01-22 18:16:17 +01:00
David Pursehouse c02a57f4fa 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>
2020-01-22 18:16:14 +01:00
Michael Keppler 926d392ea5 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>
2020-01-20 20:20:55 +01:00
Matthias Sohn 709f83d489 WindowCache: add option to use strong refs to reference ByteWindows
Java GC evicts all SoftReferences when the used heap size comes close to
the maximum heap size. This means peaks in heap memory consumption can
flush the complete WindowCache which was observed to have negative
impact on performance of upload-pack in Gerrit.

Hence add a boolean option core.packedGitUseStrongRefs to allow using
strong references to reference packfile pages cached in the WindowCache.

If this option is set to true Java gc can no longer flush the
WindowCache to free memory if the used heap comes close to the maximum
heap size. On the other hand this provides more predictable performance.

Bug: 553573
Change-Id: I9de406293087ab0fa61130c8e0829775762ece8d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-01-20 17:53:08 +01:00