Commit Graph

8748 Commits

Author SHA1 Message Date
Matthias Sohn f1547eec05 Update maven plugins
- build-helper-maven-plugin to 3.2.0
- jacoco-maven-plugin to 0.8.7
- maven-antrun-plugin to 3.0.0
- maven-dependency-plugin to 3.2.0
- maven-enforcer-plugin to 3.0.0
- maven-jar-plugin to 3.2.0
- maven-javadoc-plugin to 3.3.1
- maven-jxr-plugin to 3.1.1
- maven-pmd-plugin to 3.15.0
- maven-project-info-reports-plugin to 3.1.2
- maven-resources-plugin to 3.2.0
- maven-shade-plugin to 3.2.4
- maven-site-plugin to 3.9.1
- maven-source-plugin to 3.2.1
- maven-surefire-plugin to 3.0.0-M5
- spotbugs-maven-plugin to 4.3.0
- tycho and tycho-extras to 1.7.0

Change-Id: I7738fbfd7db60ddbeb372efcb4c72c71112ac231
2021-12-03 23:16:55 +01:00
Matthias Sohn fe3071f0e5 Ignore missing javadoc in test bundles
Change-Id: I83ed20823dc6b22ff48c2a554acb2f7d3b6067b7
(cherry picked from commit 12f39c26b0)
2021-12-03 22:14:25 +01:00
Nasser Grainawi 38db89142d storage: file: De-duplicate File.exists()+File.isFile()
File.isFile() [1] checks if the file exists and is a normal file.

[1] https://docs.oracle.com/javase/8/docs/api/java/io/File.html#isFile--

Change-Id: I0a883f2482ecc5ac58b270351b416742b568eb68
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
2021-12-03 22:09:50 +01:00
Kaushik Lingarkar f829f5f838 RefDirectory.scanRef: Re-use file existence check done in snapshot creation
Return immediately in scanRef if the loose ref was identified as
missing when a snapshot was attempted for the ref. This will help
performance of scanRef when the ref is packed but has a corresponding
empty dir in 'refs/'.

For example, consider the case where we create 50k sharded refs in
a new namespace called 'new-refs' using an atomic 'BatchRefUpdate'.
The refs are named like 'refs/new-refs/01/1/1', 'refs/new-refs/01/1/2',
'refs/new-refs/01/1/3' and so on. After the refs are created, the
'new-refs' namespace looks like below:

$ find refs/new-refs -type f | wc -l
0

$ find refs/new-refs -type d | wc -l
5101

At this point, an 'exactRef' call on each of the 50k refs without
this change takes ~2.5s, where as with this change it takes ~1.5s.

Change-Id: I926bc41b9ae89a1a792b1b5ec9a17b05271c906b
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
2021-12-03 22:06:46 +01:00
Kaushik Lingarkar 5606a53151 FileSnapshot: Lazy load file store attributes cache
Doing a getFileStoreAttributes call even when the file doesn't
exist is unnecessary. This call is particularly slow on some
filesystems. Instead, do it only when the file exists and load
the appropriate cache.

This update can help speed up RefDirectory.exactRef when the ref
is packed, but has a corresponding empty dir for it under 'refs/'.
This scenario can happen when an atomic 'BatchRefUpdate' creates
new sharded refs.

For example, consider the case where we create 50k sharded refs in
a new namespace called 'new-refs' using an atomic 'BatchRefUpdate'.
The refs are named like 'refs/new-refs/01/1/1', 'refs/new-refs/01/1/2',
'refs/new-refs/01/1/3' and so on. After the refs are created, the
'new-refs' namespace looks like below:

$ find refs/new-refs -type f | wc -l
0

$ find refs/new-refs -type d | wc -l
5101

At this point, an 'exactRef' call on each of the 50k refs without
this change takes ~30s, where as with this change it takes ~2.5s.

Change-Id: I4a5d4c6a652dbeed1f4bc3b4f2b2f1416f7ca0e7
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
2021-12-02 10:45:37 +01:00
Matthias Sohn 09c923073a Update eclipse-jarsigner-plugin to 1.3.2
Change-Id: Id5d05d96c392913de7b4451421c2ffb7b63ab83f
(cherry picked from commit c70c0acb47)
2021-12-02 10:45:36 +01:00
Matthias Sohn c213a6628e Fix p2 repository URLs
- the old jetty releases were moved to the archive server
- use https
- use eclipse 4.9 release repository

Change-Id: I2ca20dd828a9272a383e166e6ad82390415891cf
2021-12-02 09:56:27 +01:00
Matthias Sohn 256442943d Merge branch 'stable-6.0'
* stable-6.0:
  Add o.e.j.ssh.apache.agent to maven central deployment scripts

Change-Id: I5685d6b3260c269fdcc0625fd0506a1ccd71d4b4
2021-11-29 23:39:48 +01:00
Matthias Sohn fb684a3821 Add o.e.j.ssh.apache.agent to maven central deployment scripts
Change-Id: I3310eacafa83482191021beddd376d50c0a72775
2021-11-29 21:14:25 +01:00
Matthias Sohn ea4480d7e1 Merge branch 'stable-6.0'
* stable-6.0:
  Prepare 6.0.1-SNAPSHOT builds
  JGit v6.0.0.202111291000-r
  Don't block in GC#gc until garbage collection finished

Change-Id: Ibdbcea607000621bf974b56a7399383d1372ce21
2021-11-29 20:17:12 +01:00
Matthias Sohn 30b79cd0e8 Prepare 6.0.1-SNAPSHOT builds
Change-Id: Iddb67ed9578293b83b8147aa18dd8319426f83d1
2021-11-29 17:37:27 +01:00
Matthias Sohn 9492e84fe5 JGit v6.0.0.202111291000-r
Change-Id: I6441d9226e8131552bfafe1fb2c353f2e07e42ac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-11-29 16:10:14 +01:00
Matthias Sohn 26fb2b7f08 Don't block in GC#gc until garbage collection finished
Let GC#gc return collection of newly created packs as CompletableFuture
to enable using gc() asynchronously.

Change-Id: I3627014fd458c738cfe54225e631d6f7d9cfb1a7
2021-11-28 12:09:24 +01:00
Matthias Sohn 3cb02ccfdf Merge branch 'stable-6.0'
* stable-6.0:
  FS: debug logging only if system config file cannot be found
  FS: debug logging only if system config file cannot be found
  Update .factorypath used by annotation processor for benchmarks
  Use  maven-compiler-plugin's release tag instead of source and target
  Don't use deprecated Repository#getAllRefs in Repository
  Don't use deprecated Repository#getAllRefs in FileRepository
  RevListTest: fix warning that method parameter hides field 'git'
  Implement RecordingLogger based on org.slf4j.Logger
  Let ObjectDatabase implement AutoClosable

Change-Id: Ie6b3cfa66b319033d4448dcf20362b753c0e9d7c
2021-11-28 12:07:48 +01:00
Matthias Sohn 06db8e2ad4 Merge branch 'stable-5.13' into stable-6.0
* stable-5.13:
  FS: debug logging only if system config file cannot be found

Change-Id: I4759e8ce2c26db74959a16b4129534e419ba988e
2021-11-28 12:05:46 +01:00
Matthias Sohn 7ca091a526 Merge branch 'stable-5.12' into stable-5.13
* stable-5.12:
  FS: debug logging only if system config file cannot be found

Change-Id: I4f6fd422e15361118134c4d1534507e0bd81a172
2021-11-28 12:04:55 +01:00
Matthias Sohn b868f91013 Merge branch 'stable-5.11' into stable-5.12
* stable-5.11:
  FS: debug logging only if system config file cannot be found

Change-Id: Ib32079d58900328f9fc7c91648a1eee9c2bccba5
2021-11-28 12:04:15 +01:00
Matthias Sohn 91233eea56 Merge branch 'stable-5.10' into stable-5.11
* stable-5.10:
  FS: debug logging only if system config file cannot be found

Change-Id: Icd52afc3a74e0d2618181f62515d7e2a8d6c9739
2021-11-28 12:02:45 +01:00
Matthias Sohn 684ec2c316 Merge branch 'stable-5.9' into stable-5.10
* stable-5.9:
  FS: debug logging only if system config file cannot be found

Change-Id: Ib9eb4f4cc44ecc1958c9b6455ab7865913f8b247
2021-11-28 12:02:03 +01:00
Thomas Wolf 122237439d FS: debug logging only if system config file cannot be found
The command 'git config --system --show-origin --list -z' fails if
the system config doesn't exist. Use debug logging instead of a
warning for failures of that command. Typically the user cannot do
anything about it anyway, and JGit will just work without system
config.

Bug: 577492
Change-Id: If628ab376182183aea57a385c169e144d371bbb2
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-28 12:01:04 +01:00
Thomas Wolf cce547d6d1 FS: debug logging only if system config file cannot be found
The command 'git config --system --show-origin --list -z' fails if
the system config doesn't exist. Use debug logging instead of a
warning for failures of that command. Typically the user cannot do
anything about it anyway, and JGit will just work without system
config.

Bug: 577492
Change-Id: If628ab376182183aea57a385c169e144d371bbb2
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-28 11:42:20 +01:00
Matthias Sohn a26618f861 Update .factorypath used by annotation processor for benchmarks
Change-Id: Idd2c4760d81aa61643ef15292f1736a649be30b5
2021-11-26 22:17:01 +01:00
Matthias Sohn 81482008c1 Use maven-compiler-plugin's release tag instead of source and target
Change-Id: I090c8d074ae391a0721036bdc44e43c292a80963
2021-11-26 10:19:50 +01:00
Simeon Andreev 8d26507737 Fix MANIFEST.MF of org.eclipse.jgit to correctly export packages:
org.eclipse.jgit.internal.diffmergetool
org.eclipse.jgit.internal.fsck

This was broken with changes for bug 356832.

Bug: 356832
Change-Id: Id008d058769b4923d545a9373b45ceb3a3d27a08
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
2021-11-26 09:55:06 +01:00
Andre Bossert 48f4d97a22 Add command line support for "git difftool"
see: http://git-scm.com/docs/git-difftool

* add command line support for "jgit difftool"
* show supported commands with "jgit difftool --help"
* added "git difftool --tool-help" to show the tools (empty now)
* prepare for all other commands

Bug: 356832
Change-Id: Ice0c13ef7953a20feaf25e7746d62b94ff4e89e5
Signed-off-by: Andre Bossert <andre.bossert@siemens.com>
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
2021-11-25 18:17:16 +01:00
Matthias Sohn 0a3aaac33e Don't use deprecated Repository#getAllRefs in Repository
Also expose the potentially IOException thrown by RefDatabase#getRefs.
Hence the following methods now potentially throw IOException:
- Repository#getAllRefsByPeeledObjectId

Bug: 534731
Change-Id: Id6956ff112560e6314d4335238494708346f2338
2021-11-25 12:06:29 +01:00
Matthias Sohn 403338e116 Don't use deprecated Repository#getAllRefs in FileRepository
Also expose the potentially IOException thrown by RefDatabase#getRefs.
Hence the following methods now potentially throw IOException:
- AdvertiseRefsHook#advertiseRefs
- ReceivePack#setAdvertisedRefs
- Repository#getAdditionalHaves

Bug: 534731
Change-Id: I85bc6ce5815d40be5f80042c53f4663072d96be5
2021-11-25 12:02:44 +01:00
Matthias Sohn c20dd8206e RevListTest: fix warning that method parameter hides field 'git'
Change-Id: I12bd44e8bf75010ada2dff60f519fea61c7459de
2021-11-24 23:23:03 +01:00
Matthias Sohn 75c716f5d7 Implement RecordingLogger based on org.slf4j.Logger
Jetty 10 uses slf4j for logging and deprecated its own Logger interface
org.eclipse.jetty.util.log.Logger.

Change-Id: I1b0c3a23e43190a50987175973725c3ad6e32f5f
2021-11-24 23:12:08 +01:00
Matthias Sohn c05d711bb7 Let ObjectDatabase implement AutoClosable
Bug: 549777
Change-Id: I09846a0e063aafa77de7e76dbc16c6a67d13b5e5
2021-11-24 22:21:10 +01:00
Matthias Sohn 4453a6e042 Prepare 6.1.0-SNAPSHOT builds
Change-Id: Ied07b1298bd32672a5025cec5079440ab9b9a100
2021-11-24 19:42:27 +01:00
Matthias Sohn 06eb6d0b73 Merge branch 'stable-6.0'
* stable-6.0:
  Prepare 6.0.0-SNAPSHOT builds
  JGit v6.0.0.202111241155-rc1

Change-Id: Icb4caf0809ac0c629cb4a05be293c61c669411db
2021-11-24 19:41:40 +01:00
Matthias Sohn e3707a6cea Prepare 6.0.0-SNAPSHOT builds
Change-Id: I4e06186cf62681767962e391331cc65bafddc205
2021-11-24 18:18:12 +01:00
Matthias Sohn ad8d89b9c0 JGit v6.0.0.202111241155-rc1
Change-Id: I35dc089a00ee12f83f506fb320d23762fa030063
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-11-24 17:54:51 +01:00
Matthias Sohn 751e3ad5d1 Merge branch 'master' into stable-6.0
* master:
  Add 4.22 target platform for 2021-12
  Update Orbit to R20211122181901 for 2021-12
  AppServer: fix keystore used to setup test SSL context factory
  [6.0 API cleanup] Public interface for PackLock
  [6.0 API cleanup] StoredObjectRepresentationNotAvailableException
  RepoCommand: Do not wrap GitApiExceptions in GitApiExceptions
  Set JSch global config values only if not set already
  Better git system config finding
  [6.0 API cleanup] CancelledException vs. CanceledException
  Javadoc fixes
  Better git system config finding
  HttpClientConnectionTest: organize imports
  Update Jetty to 10.0.6
  Fix missing @since 6.0 tag
  Support commit.template config property
  DFS block cache: harden against race over ref locks.

Change-Id: Id9814d92eb40b2ba63c5e753a86a4809826e7c81
2021-11-24 17:49:02 +01:00
Matthias Sohn fc60efff0d Add 4.22 target platform for 2021-12
Change-Id: Ie003dee8390cb609bd3352c23e88aeb0bf1bc68b
2021-11-24 10:52:26 +01:00
Matthias Sohn 009c043b02 Update Orbit to R20211122181901 for 2021-12
Change-Id: Ieddfe7938d0743ffbe74fa7bb366030e93fa010c
2021-11-24 10:36:56 +01:00
Matthias Sohn 791d3b0eb4 AppServer: fix keystore used to setup test SSL context factory
- configure dName
- add SANs ip:127.0.0.1, ip:[::1]

See jetty's own test setup in
1cd15e8d85/jetty-client/src/test/resources/readme_keystores.txt (L6)

and the fixes done in
1cd15e8d85

Change-Id: Ie3260db7a7090dfa92b43eb32bf247640ebf8482
2021-11-24 09:17:07 +01:00
Ivan Frade 32b1a1b3a3 Merge "RepoCommand: Do not wrap GitApiExceptions in GitApiExceptions" 2021-11-23 18:05:37 -05:00
Thomas Wolf 5154585439 [6.0 API cleanup] Public interface for PackLock
Provide a public interface PackLock exposing only the unlock() method.
Rename the internal PackLock class to PackLockImpl and have it implement
the new interface.

This way PackParser doesn't expose an internal class via its API
anymore, and client can still unlock pack locks that were created.

Bug: 576340
Change-Id: I976739f4ab28fe1f9ba7f35653a69a913aa68841
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-23 23:37:19 +01:00
Thomas Wolf 1e37438cb7 [6.0 API cleanup] StoredObjectRepresentationNotAvailableException
Remove the unused parameter, which had a non-API type anyway.

Bug: 576340
Change-Id: Id71c01a643e1f31a8ff61ff69f7915c373db3263
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-23 23:37:19 +01:00
Matthias Sohn 912a34fb7b Merge branch 'stable-5.13'
* stable-5.13:
  Set JSch global config values only if not set already
  Better git system config finding

Change-Id: I79848eeb3cda795ecb80ad845aa1027e2e231d18
2021-11-23 23:25:07 +01:00
Ivan Frade cde3ed9ecf RepoCommand: Do not wrap GitApiExceptions in GitApiExceptions
While building the commit for the destination project, RepoCommand
catches GitApiExceptions and wraps them into ManifestErrorException
(a subclass of GitApiException). This hides the real exception from the
caller and prevent them to do a fine-grained catch.

Specifically this is problematic for gerrit's supermanifest plugin, that
won't see ConcurrentRefUpdate exceptions to detect lock-failures.

Use ManifestErrorException to wrap non-GitApiExceptions, let
GitApiExceptions pass through as they are.

Change-Id: Ia2cda244e65993bb07c89cd6435507d5d0754dd4
2021-11-23 11:30:25 -08:00
Thomas Wolf 9e4fe739c7 Merge branch 'stable-5.12' into stable-5.13
* stable-5.12:
  Better git system config finding

Change-Id: Iebbae08b6bb6ef510ca07329df77223bc2128ec1
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-23 19:52:01 +01:00
Thomas Wolf 6fe66b7382 Set JSch global config values only if not set already
Bug: 576604
Change-Id: I04415f07bf2023bc8435c097d1d3c65221d563f1
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
(cherry picked from commit f8b0c00e6a)
2021-11-23 19:52:01 +01:00
Thomas Wolf 6e0ac5840c Merge branch 'stable-5.11' into stable-5.12
* stable-5.11:
  Better git system config finding

Change-Id: I47946b91658cb2e38709179b7a8513b1211431e4
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-23 19:46:39 +01:00
Thomas Wolf ecbe49efbd Merge branch 'stable-5.10' into stable-5.11
* stable-5.10:
  Better git system config finding

Change-Id: I460d855ea7878b279dbaffa6eb7ce5ca93f4c12c
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-23 19:45:50 +01:00
Thomas Wolf e29325f064 Merge branch 'stable-5.9' into stable-5.10
* stable-5.9:
  Better git system config finding

Change-Id: I1022d003e0d3b9d452abfed9ac49663d0a93c6e6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-23 19:44:30 +01:00
Thomas Wolf 6aa29d1166 Better git system config finding
We've used "GIT_EDITOR=edit git config --system --edit" to determine
the location of the git system config for a long time. But git 2.34.0
always expects this command to have a tty, but there isn't one when
called from Java. If there isn't one, the Java process may get a
SIGTTOU from the child process and hangs.

Arguably it's a bug in C git 2.34.0 to unconditionally assume there
was a tty. But JGit needs a fix *now*, otherwise any application using
JGit will lock up if git 2.34.0 is installed on the machine.

Therefore, use a different approach if the C git found is 2.8.0 or
newer: parse the output of

  git config --system --show-origin --list -z

"--show-origin" exists since git 2.8.0; it prefixes the values with
the file name of the config file they come from, which is the system
config file for this command. (This works even if the first item in
the system config is an include.)

Bug: 577358
Change-Id: I3ef170ed3f488f63c3501468303119319b03575d
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
(cherry picked from commit 9446e62733)
2021-11-23 19:42:34 +01:00
Thomas Wolf ce6826f506 [6.0 API cleanup] CancelledException vs. CanceledException
Use the GitAPIException CanceledException instead of IOException
CancelledException in the rename detector.

Change-Id: I5121719eb714a123ec57769fc113c84857bd3c6c
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-22 17:57:26 -05:00