Commit Graph

9572 Commits

Author SHA1 Message Date
Thomas Wolf e3798df6e8 OSGi: move plugin localization to subdirectory
OSGi can have its plugin localization at an arbitrary place; there is
no need to have it in a top-level plugin.properties file. In non-OSGi
environments having the files at the root level may mean that these
files clash with each other, or, as in the referenced bug, with some
third-party plug-in's plugin.properties, which may not even have
anything to do with localization.

Move our OSGi localization to a subfolder OSGI-INF/l10n. For OSGi
environments, that's just as good, and for non-OSGi environments it
avoid clashes with other root level items on the classpath or in a fat
JAR.

For fragments, use neither plugin.properties (which would clash with the
host plug-in's plugin.properties) nor fragment.properties (which might
clash with other fragments for the same fragment host bundle). Instead
use names "relative" to the host bundle.

Bug: 582394
Change-Id: Ifbcd046d912e2cfe86c0f7259c5ca8de599d9aa1
Signed-off-by: Thomas Wolf <twolf@apache.org>
2023-09-12 20:27:59 +02:00
Thomas Wolf 82c6638c72 RevertCommand: support for inserting a Gerrit change ID
Add a setter for the flag to be passed through to the CommitCommand.

Bug: 342790
Change-Id: I87548d7c2742af8af5ef6105115e3ab9c58d1d9f
Signed-off-by: Thomas Wolf <twolf@apache.org>
2023-09-08 22:58:02 +02:00
Thomas Wolf 7e502953c1 [releng] Bump japicmp base version to 6.7.0.202309050840-r
Change-Id: I8ccf8472a8bf06669ebdcd3d59d24f7d5567d89e
Signed-off-by: Thomas Wolf <twolf@apache.org>
2023-09-08 21:37:15 +02:00
Ivan Frade 7baa5a157b DfsPackFile: Record index loads only in one place
Each index can be set in the reader from two locations: the dfs cache
callback or the code afterwards. The pack is emitting the load event
in both cases, when the reference is set. This is brittle (right now
it is missing events for BITMAP_INDEX and COMMIT_GRAPH).

Emit the index loaded event only once, after going through the cache
code. The fact that the reference was set in the callback or the main
code is irrelevant. Also, the reader is per-thread, so there shouldn't
be any concurrency involved triggering double counts.

Change-Id: I7f3d078a53741ecc1e81b96353ed8faa8fef3a49
2023-09-08 11:03:38 -07:00
Ivan Frade 30427485dd DfsPackfile: Emit the index load with the index object
The DfsReader#emitIndexLoad expects a reference to the loaded object,
not to its identity hash. This makes listeneres recalculate an
identity hash over an Int object.

Pass the expected reference to the method.

Change-Id: Iee982fdd0169c93c5c7cd9cfe4260a7a82d23f6a
2023-09-08 08:29:04 -07:00
Matthias Sohn 3a3b72cf90 Prepare 6.8.0-SNAPSHOT builds
Change-Id: Ifc81f0a96c2ced0b25926b9daa539d9cfc951925
2023-09-07 02:24:53 +02:00
Matthias Sohn 6416de9563 Merge branch 'stable-6.7'
* stable-6.7:
  Prepare 6.7.1-SNAPSHOT builds
  Switch back to wagon-ssh-external
  Fix generation of maven site
  JGit v6.7.0.202309050840-r
  Remove unused API problem filters
  [releng] Bump japicmp base version to 6.6.0.202305301015-r
  Fix list of 3rd party bundles in p2 repo
  Add missing source bundle org.osgi.service.cm.source to target platform
  Prepare 6.6.2-SNAPSHOT builds
  JGit v6.6.1.202309021850-r
  Checkout: better directory handling
  Document commit-graph options supported by JGit
  Fix warning raised for local variable hiding DfsPackFile#index
  Suppress boxing warnings in DfsPackFile
  Remove unused API problem filters
  Suppress boxing warnings in tests
  Fix warning about empty block
  Update mockito to 5.5.0
  Update byte-buddy to 1.14.7
  Prepare 6.7.0-SNAPSHOT builds
  JGit v6.7.0.202308301100-rc1

Change-Id: Ib2a1000ead5ca6cf3816e9e9496ad5d92f4dc963
2023-09-07 02:24:08 +02:00
Matthias Sohn bb12dd4cbd Prepare 6.7.1-SNAPSHOT builds
Change-Id: I96097ef8c6f198220f513bbc6d5f8881834a1491
2023-09-07 02:03:54 +02:00
Matthias Sohn 09f6383f55 Switch back to wagon-ssh-external
Bug: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/2818
Change-Id: Ic283e5229b1a8a0b1ae349555ac7cfb7b046d7be
2023-09-07 01:07:04 +02:00
Matthias Sohn b438804847 Fix generation of maven site
- update maven-site-plugin to 4.0.0-M9
- use wagon-ssh extension for deployment
- disable doclint
- don't fail the build for javadoc warnings

Change-Id: I81f7229deaf6892416ce4cebd6c122f00a857d51
2023-09-07 00:06:52 +02:00
Ivan Frade 9607ee02a1 Merge "CommitGraphWriter: Make the list of chunks immutable" 2023-09-06 17:19:21 -04:00
Minh Thai ba1653162c Ensure home directory not null before using in Sshdsessionfactory
Home directory might not be set in DFS.

Change-Id: I3528685838065dc291826fc73a37126af7bf47ce
2023-09-06 07:13:05 -07:00
Ivan Frade 4f5afe9d7c CommitGraphWriter: Make the list of chunks immutable
The chunk list is calculated before start writing and it is
immutable afterwards.

Make this explicit using an unmodifiable list for the chunks.

Change-Id: I4a5cfb1f3d06a9393d8d93a3fac3c128cf3faec0
2023-09-05 11:25:54 -07:00
Ivan Frade f90f0717a0 CommitGraphWriter: Assert written bytes
The final size of the commit-graph is known before-hand. As a
safety-net, assert the written size matches the expected value.

Change-Id: Ib0828a7cce5bacb33f6325ee3910f4eebd95eb8c
2023-09-05 10:30:23 -07:00
Matthias Sohn ea02caf1e7 JGit v6.7.0.202309050840-r
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: Ibe952d97bc178adb909cdd40f48957f5b68af699
2023-09-05 14:41:09 +02:00
Matthias Sohn c024cb23d8 Remove unused API problem filters
Change-Id: If37ac92711cef94a835cfd303997a3d129d212ac
2023-09-05 14:10:30 +02:00
Thomas Wolf a5ffa44d50 [releng] Bump japicmp base version to 6.6.0.202305301015-r
Change-Id: I5392537713d4909d4fc2fee6e2b21502e0674b43
Signed-off-by: Thomas Wolf <twolf@apache.org>
2023-09-04 17:12:25 -04:00
Matthias Sohn 43681ee744 Fix list of 3rd party bundles in p2 repo
The jgit p2 repo should contain all 3rd party dependencies needed at
runtime but not dependencies only used in tests.

- remove assertj-core since it's only used in tests
- add org.eclipse.osgi and org.osgi.service.cm which are runtime
  dependencies

Change-Id: Ie789cb8feab0905e7e23aae1d5378e82a0088992
2023-09-04 16:59:52 +02:00
Matthias Sohn ee0b20c641 Add missing source bundle org.osgi.service.cm.source to target platform
Change-Id: I6e61278467ad11d28c08ee6b49e04dac0593f3e6
2023-09-04 16:57:24 +02:00
Matthias Sohn 7a6e852745 Merge branch 'stable-6.6' into stable-6.7
* stable-6.6:
  Prepare 6.6.2-SNAPSHOT builds
  JGit v6.6.1.202309021850-r
  Checkout: better directory handling

Change-Id: Ice82d68b2d343a5fac214807cdb369e486481aab
2023-09-03 02:16:04 +02:00
Matthias Sohn 43d6bc5ef1 Prepare 6.6.2-SNAPSHOT builds
Change-Id: Id4e2fbefc49115c7e3de26a34cfbe01ba6de25b2
2023-09-03 01:57:43 +02:00
Matthias Sohn ff08cbfe07 JGit v6.6.1.202309021850-r
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I4f173dc9d634e0c9f31305961400b6b35a0a332f
2023-09-03 00:50:37 +02:00
Thomas Wolf 9072103f3b Checkout: better directory handling
When checking out a file into the working tree ensure that all parent
directories of the file below the working tree root are actually
directories and do exist before we try to create the file.

When multiple files are to be checked out (or even a whole tree), this
may check the same directories over and over again. Asking the file
system every time for file attributes is a potentially expensive
operation. As a remedy, introduce an in-memory cache of directory
states for a particular check-out operation.

Apply the same fix also in the ResolveMerger, which may also check out
files, and also in the PatchApplier. In PatchApplier, also validate
paths.

Change-Id: Ie12864c54c9f901a2ccee7caddec73027f353111
Signed-off-by: Thomas Wolf <twolf@apache.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2023-09-03 00:16:26 +02:00
Matthias Sohn 96934c9a80 Merge branch 'master' into stable-6.7
* master:
  CommitGraphWriter: throw exception on unknown chunk

Change-Id: Iaa0c563917c4195fccd57f5e6839a37008c9b808
2023-09-02 09:40:19 +02:00
Ivan Frade 13c8dacae5 CommitGraphWriter: throw exception on unknown chunk
CommitGraphWriter first defines the chunks and then writes them. If at
write time a chunk is unknown, it is ignored. This is brittle: if
somebody adds a chunk to the header but not to the actual writing, the
commit-graph is broken and there is no error reported anywhere.

Throw exception if at write time a chunk is unknown. This can only
happen by a coding error in the writer.

Change-Id: Iade677bb6ce368b6941b75a21c622917afa3b751
2023-09-01 11:39:40 -07:00
Matthias Sohn fb51a2234b Document commit-graph options supported by JGit
Change-Id: I0ab1b826232bbfcf28518d7a01ae5c5d82a08e04
2023-09-01 10:43:21 +02:00
Matthias Sohn a40abb0a19 Fix warning raised for local variable hiding DfsPackFile#index
Change-Id: I45cd3be942f798d51af1e024ceb3f4d26c7af324
2023-08-31 15:13:34 +02:00
Matthias Sohn 4f3db912ce Suppress boxing warnings in DfsPackFile
Change-Id: I4b5a0a7ffdeaf7d7839787aa8b98ea9c72f70850
2023-08-31 15:11:50 +02:00
Matthias Sohn 807cf678a0 Remove unused API problem filters
Change-Id: I96b73a948794ab5aaadaa558ae75b512f54d64fe
2023-08-31 14:46:38 +02:00
Matthias Sohn 02b45a844c Suppress boxing warnings in tests
Change-Id: I56731862b0955286f86b1c0699d75313eb192fdf
2023-08-31 14:45:36 +02:00
Matthias Sohn 35b5344c9e Fix warning about empty block
Change-Id: I569fb9bf39e851bca451e5a35539589766ba5c05
2023-08-31 14:43:28 +02:00
Matthias Sohn e51a0e51e5 Update mockito to 5.5.0
Change-Id: Ic62864aaf15388b8f20b2db8aa65d1dcf03465a6
2023-08-31 12:08:36 +02:00
Matthias Sohn 24c5d0120b Update byte-buddy to 1.14.7
Change-Id: Iee257eef4cdc3235db6172e19d8d271ff9988fa4
2023-08-31 10:56:32 +02:00
Matthias Sohn c5d8936c80 Prepare 6.7.0-SNAPSHOT builds
Change-Id: I49751232464e70b7d1dc3292a9f36b7a7015e44f
2023-08-30 17:46:26 +02:00
Matthias Sohn c54acc5822 JGit v6.7.0.202308301100-rc1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I712a9f6830364ed404d03f3a145c055906273544
2023-08-30 16:57:25 +02:00
Matthias Sohn 2e2e58d59f Merge branch 'master' into stable-6.7
* master:
  Remove the cbi-snapshots Maven repository
  Update Orbit to orbit-aggregation/release/4.29.0
  Add target platform for Eclipse 2023-09 (4.29)
  Use release p2 repo for Eclipse 2023-06 (4.28)
  Update tycho to 4.0.2
  Update jmh to 1.37
  Update bouncycastle to 1.76
  Fix some tests in ConfigTest
  Handle global git config $XDG_CONFIG_HOME/git/config
  IO: use JDK convenience methods
  org.eclipse.jgit.junit.ssh/.settings/.api_filters: fix unclosed tags
  ReadChangedPathFilter: fix Non-externalized string literal warning
  Introduce core.packedIndexGitUseStrongRefs config key
  DfsReader: Make PackLoadListener interface visible to subclasses
  DfsGarbageCollector: provide commit graph stats
  DfsGarbageCollector: put only GC commits into the commit graph
  DfsReader: Expose when indices are loaded

Change-Id: Idd78a0a1bc3cd3db5edb475e235c13354d9087a9
2023-08-30 16:43:08 +02:00
Matthias Sohn 2be8bf2b37 Remove the cbi-snapshots Maven repository
since it's not used anymore.

Change-Id: I884c5e5854d6a1f5b104d8d3bb0419e860fa34ca
2023-08-30 14:28:36 +02:00
Matthias Sohn 8995a64295 Update Orbit to orbit-aggregation/release/4.29.0
Switch to bundle dependencies for hamcrest 1.3 to avoid issues with
split packages in that version.

Don't allow hamcrest 2.x yet since junit 4.13.2 still requires hamcrest
1.3.

See Orbit restructuring in
https://github.com/orgs/eclipse-orbit/discussions/49

Change-Id: I8faf519b8f2c4e4a6bd255d694d1aa28017acd85
2023-08-30 14:28:33 +02:00
Matthias Sohn 2a64412e94 Add target platform for Eclipse 2023-09 (4.29)
Change-Id: I62f9bacebf0a2a2cba6ffde7936572e3f05a629c
2023-08-30 14:19:54 +02:00
Matthias Sohn 9fd44e0985 Use release p2 repo for Eclipse 2023-06 (4.28)
Change-Id: I3b8794bdb43db12c2eacda1de27651686c41abf5
2023-08-30 00:11:54 +02:00
Matthias Sohn 2d0a5fa643 Update tycho to 4.0.2
Change-Id: Ib619bc09bf79c0f9e7526c0303606f314e8c1209
2023-08-29 23:22:57 +02:00
Matthias Sohn b6b0d323a7 Update jmh to 1.37
Change-Id: I39e3dda1c13268c44055295398eab36c5ff7eb3e
2023-08-29 23:17:50 +02:00
Matthias Sohn 46264ba489 Update bouncycastle to 1.76
Change-Id: Ic569f348106e917001fbaa25a302fc20cca56244
2023-08-29 22:12:53 +02:00
Matthias Sohn e29834a77d Fix some tests in ConfigTest
Some of the ConfigTest tests created a FileRepositoryBuilder but didn't
use it to actually create a FileRepository.

Change-Id: I1a4b27891daee1b235a71e7bbf2a7588b9d11a53
2023-08-29 21:26:34 +02:00
Thomas Wolf a2f326b762 Handle global git config $XDG_CONFIG_HOME/git/config
C git uses this alternate fallback location if the file exists and
~/.gitconfig does not. Implement this also for JGit.

If both files exist, reading behavior is as if the XDG config was
inserted between the HOME config and the system config. Writing
behaviour is different: all changes will be applied only in the HOME
config. Updates will occur in the XDG config only if the HOME config
does not exist.

This is consistent with the behavior of C git; compare [1], especially
the sections on FILES and SCOPES, and the description of the --global
option.

[1] https://git-scm.com/docs/git-config

Bug: 581875
Change-Id: I2460b9aa963fd2811ed8a5b77b05107d916f2b44
Signed-off-by: Thomas Wolf <twolf@apache.org>
2023-08-28 22:05:47 +02:00
Jörg Kubitz 0d5e017612 IO: use JDK convenience methods
The benefit is that certain InputStreams can override the default
implementation for performance reasons.

Change-Id: I4c924157ec0f0ec63b0eca7cdbdc9325af24cab6
2023-08-28 21:50:14 +02:00
Jörg Kubitz 055a7c20e0 org.eclipse.jgit.junit.ssh/.settings/.api_filters: fix unclosed tags
error was introduced with I0fb77bb9b498d48d5da88a93486b99bf8121e3bd

Change-Id: I60af78cf0213a07356cb39b5f756679c58daee56
2023-08-28 14:11:41 -04:00
Jörg Kubitz a56930723f ReadChangedPathFilter: fix Non-externalized string literal warning
Change-Id: I78161a2dbc08918267bc59a1ed267c5108f5c391
2023-08-28 14:10:08 -04:00
Martin Fick e7a09e316d Introduce core.packedIndexGitUseStrongRefs config key
Introduce a core.packedIndexGitUseStrongRefs configuration key, which
defaults to true so that the current behavior does not change. However,
setting it to false allows soft references to be used for Pack indices
instead of strong references so that they can be garbage collected when
there is memory pressure.

Pack objects can be large when associated with pack files with large
object counts, and this memory is not really accounted for or tracked by
the WindowCache and it can be very substantial at times, especially with
many large object count projects. A particularly problematic use case is
Gerrit's ls-projects command which loads very little data in the
WindowCache via ByteWindows, but ends up loading and holding many entire
indices in memory, sometimes even after the ByteWindows for their Pack
objects have already been garbage collected since they won't get cleared
until after a new ByteWindow is loaded. By using SoftReferences, single
use indices can get cleared when there is memory pressure and OOMs can
be easily avoided, drastically reducing the amount of memory required to
perform an ls-projects on large sites with many projects and large
object counts.

On one of our test sites, an ls-projects command with strong index
references requires more than 66GB of heap to complete successfully,
with soft index references it requires less than 23GB.

Change-Id: I3cb3df52f4ce1b8c554d378807218f199077d80b
Signed-off-by: Martin Fick <quic_mfick@quicinc.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2023-08-26 16:16:43 +02:00
Jonathan Tan f8f5979aa2 Merge "DfsGarbageCollector: provide commit graph stats" 2023-08-21 13:07:51 -04:00