Commit Graph

9044 Commits

Author SHA1 Message Date
Ivan Frade b58ea5c6c9 ObjectReader: New #isNotLargerThan method
Partial clones filter the objects to send by size calling
ObjectReader#getObjectSize per object. This method reads the object from
storage to get the size, which can be expensive.

Offer a #isNotLargerThan method. The default implementation reads the
object, but subclasses can override it with more efficient lookups (e.g.
adding an index).

isNotLargerThan gives implementors more options to optimize than
getObjectIndex (e.g. can be implemented storing only object over certain
size).

Change-Id: Iefd4b1370cb9144f15cc0391286aeeb365e6ea87
2022-10-18 11:18:46 -07:00
Matthias Sohn b398bb91ab Fail build if there are license issues with dependencies
Configure the dash license-tool-plugin to fail the build if there are
license issues with build dependencies. This plugin will generate a list
of all build dependencies and their license to target/dash/summary.

Delete the checked-in dependency list DEPENDENCIES since the build now
always generates it to target/dash/summary.

See https://github.com/eclipse/dash-licenses#example-maven-plugin

Change-Id: I0c2bf8eb166d85b840d42afc61750b4a083b7659
2022-10-13 00:01:38 +02:00
Matthias Sohn 490c586dee Update org.apache.httpcomponents:httpcore to 4.4.15
In target platform we updated to this version already earlier.

Change-Id: Iefa06bac2c007810936a5675482addd99f8f9cd3
2022-10-10 17:54:18 +02:00
Matthias Sohn f319c93584 Update Orbit to S20220927175816
and
- com.google.code.gson:gson to 2.9.1

Change-Id: Ia9e4fdc557478d3ca37b0169be93711791952068
2022-10-10 01:20:07 +02:00
Matthias Sohn 48d257382c Update JMH to 1.35
Update
- org.openjdk.jmh:jmh-core to 1.35
- org.openjdk.jmh:jmh-generator-annprocess to 1.35

Change-Id: Iaebae71a9b49b2116da9d2614e6ae1ddbd692aab
2022-10-10 01:10:31 +02:00
Matthias Sohn 0a02adc02f Update org.eclipse.jdt:ecj to 3.31.0
Change-Id: I410f762de37e5273916d4850157744f0a9be1564
2022-10-10 00:47:15 +02:00
Matthias Sohn 4aada1285a Update plexus compiler to 2.12.1
Change-Id: Id55b46b7546c830a90cbdf794bb237abf2afbbe4
2022-10-10 00:45:13 +02:00
Matthias Sohn 5bb275e75b Update org.apache.maven.wagon:wagon-ssh to 3.5.2
Change-Id: If80cb8e81a5ff8888812626d0658106dec5303ab
2022-10-10 00:43:35 +02:00
Ivan Frade ca1c70ff5f pgm/BUILD: Add dependencty to java EWAH
A fetch to a locally run daemon triggers a runtime exception:

Listening on localhost/127.0.0.1:9418
java.lang.NoClassDefFoundError:
com/googlecode/javaewah/EWAHCompressedBitmap

Add javaEWAH in the deps of the PGM library.

To reproduce:

0. Assume a git repo in <dir-with-repos>/a-repo
1. Run daemon e.g.:
  $ bazel run //org.eclipse.jgit.pgm:jgit -- daemon --export-all=true
  --listen localhost --enable upload-pack <dir-with-repos>

2. Fetch:
  $ git clone git://0.0.0.0:9418/a-repo

Change-Id: I503f9fe45347a5891c3f3de0452b7f300b1e8206
2022-10-05 19:12:45 -04:00
Thomas Wolf cbf0d9a76c [sshd] Guard against numerical overflow
Check the key length before adding; the addition might overflow.

Change-Id: Icde7c92a5bb267fdd869d5a1c0842967ab1a7fd9
Signed-off-by: Thomas Wolf <twolf@apache.org>
2022-10-01 20:45:34 +02:00
Matthias Sohn e8d5914aa6 Merge branch 'stable-6.3'
* stable-6.3:
  Remove unused imports

Change-Id: I4a92c5afb8f179798234eb772eb34879d41808af
2022-09-28 18:16:47 +02:00
Matthias Sohn 6beb2f3766 Remove unused imports
Change-Id: Ib6f80a5f013d30a9b7a59cb05e3ee13aa46b28c8
2022-09-28 17:58:50 +02:00
Matthias Sohn 656e32e9f2 Remove unused API filters
Change-Id: Ief32f935c701842f03b173ee48465d7dcf7dfabd
2022-09-22 16:34:36 +02:00
Jörg Kubitz 2021ce3423 ObjectDirectory: avoid using File.getCanonicalPath()
On java 17 + Windows OS java.io.File.getCanonicalPath is a very slow
system call which uses most time during clone.

That is since JDK 12 the result of File.getCanonicalPath is not cached
anymore by default:
https://bugs.openjdk.java.net/browse/JDK-8207005

* Use toRealPath() to follow symbolic links also on windows.
* Cache the result.

Bug: 580568
Change-Id: I95f4f5b2babefd7210ee4740646230225ebf3788
2022-09-22 10:48:50 +02:00
Jörg Kubitz eb5124c74f AutoCRLFOutputStream: use BufferedOutputStream
This should improve performance of autocrlf checkout.

Bug: 580651
Change-Id: I2e2fe0273ac3c71fad50a575278234804ee28306
2022-09-20 10:00:17 +02:00
Thomas Wolf f71fcbf36b CloneCommand: set HEAD also when not checking out
CloneCommand, when setNoCheckout(true) was set, did not set HEAD.
With C git, "git clone --no-checkout" does.

Change-Id: Ief3df7e904ce90829a6345a6c3e9ee6a68486ab0
Signed-off-by: Thomas Wolf <twolf@apache.org>
2022-09-18 19:43:40 +02:00
Thomas Wolf 4f4204914c Pass on shallowSince only if not null
FetchCommand.setShallowSince() and Transport.setDeepenSince() require
a non-null argument.

Change-Id: I1c3a20be518374e380a4e90787ed834438da40ee
Signed-off-by: Thomas Wolf <twolf@apache.org>
2022-09-18 19:32:31 +02:00
Thomas Wolf ccad49a28c Fix wrong @since tag
PatchApplier was merged only in JGit 6.4.

Change-Id: Ica84d8184c1d3a1acce8beba9b076f6c32e749d7
Signed-off-by: Thomas Wolf <twolf@apache.org>
2022-09-18 17:02:51 +02:00
Han-Wen NIenhuys 21a497843c Merge "Split out ApplyCommand logic to PatchApplier class" 2022-09-15 04:16:48 -04:00
Nitzan Gur-Furman acde6c8f5b Split out ApplyCommand logic to PatchApplier class
PatchApplier now routes updates through the index. This has two
results:

* we can now execute patches in-memory.

* the JGit apply command will now always update the
index to match the working tree.

Change-Id: Id60a88232f05d0367787d038d2518c670cdb543f
Co-authored-by: Han-Wen Nienhuys <hanwen@google.com>
Co-authored-by: Nitzan Gur-Furman <nitzan@google.com>
2022-09-15 09:15:55 +02:00
Matthias Sohn 85182df267 Prepare 6.4.0-SNAPSHOT builds
Change-Id: I47ca5f1d0263caa0bfc7c303042360c6c5ac4dec
2022-09-14 13:56:40 +02:00
kylezhao ac3bf7896e Fix typo in FetchV2Request javadoc
Change-Id: I905dda15e1b7f5e431816d3fbb01a1672e5fc786
Signed-off-by: kylezhao <kylezhao@tencent.com>
2022-09-14 15:49:39 +08:00
Matthias Sohn c7df1addf6 Merge branch 'stable-6.3'
* stable-6.3:
  Prepare 6.3.1-SNAPSHOT builds
  JGit v6.3.0.202209071007-r
  JGit v6.3.0.2022009070944-r
  [merge] Fix merge conflicts with symlinks
  Update DEPENDENCIES for 6.3.0
  Update tycho to 2.7.5
  Revert "Adds FilteredRevCommit that can overwrites its parents in the DAG."
  Revert "Option to pass start RevCommit to be blamed on to the BlameGenerator."
  Prepare 6.3.0-SNAPSHOT builds
  JGit v6.3.0.202208161710-m3

Change-Id: Ia9430fb516dca795e25064a190704b70689af364
2022-09-12 10:51:37 +02:00
Matthias Sohn fb377b09eb Prepare 6.3.1-SNAPSHOT builds
Change-Id: I44e159eca4131880d74d3078060e7e20f9b5ce76
2022-09-12 10:09:10 +02:00
Ivan Frade 834016c3e4 Merge "DfsBundleWriter: Add test case about GC_REST pack." 2022-09-07 16:43:19 -04:00
yunjieli e7bffdfc48 DfsBundleWriter: Add test case about GC_REST pack.
Add a test case to make sure that the bundle writer writes objects in
GC_REST packs as well.

Signed-off-by: Yunjie Li <yunjieli@google.com>
Change-Id: Iba4d88c573aa1cda4505afbe2b83581a09a343df
2022-09-07 10:18:16 -07:00
Matthias Sohn 68e8ecc91b JGit v6.3.0.202209071007-r
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: Iea3fae9f6f6c5fb0a79f7684334a3e0059738c4f
2022-09-07 16:07:11 +02:00
Matthias Sohn f8104e25f1 JGit v6.3.0.2022009070944-r
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I3cc78dbcf8c7970e80bf1499751611110ec2b30b
2022-09-07 15:39:48 +02:00
Thomas Wolf a8e683fef6 [merge] Fix merge conflicts with symlinks
Previous code would do a content merge on symlinks, and write the merge
result to the working tree as a file. C git doesn't do this; it leaves
a symlink in the working tree unchanged, or in a delete-modify conflict
it would check out "theirs".

Moreover, previous code would write the merge result to the link target,
not to the link. This would overwrite an existing link target, or fail
if the link pointed to a directory.

In link/file conflicts or file/link conflicts, C git always puts the
file into the working tree.

Change conflict handling accordingly. Add tests for all the conflict
cases.

Bug: 580347
Change-Id: I3cffcb4bcf8e336a85186031fff23f0c4b6ee19d
Signed-off-by: Thomas Wolf <twolf@apache.org>
2022-09-07 15:02:02 +02:00
Matthias Sohn 583bf00233 Update DEPENDENCIES for 6.3.0
Change-Id: Ie057e4c94a102113fc9026d9773657984530c9c6
2022-09-06 17:13:52 +02:00
Matthias Sohn 1e28d49eb9 Update tycho to 2.7.5
Change-Id: I5ef981cf9f01cc8493dc6178938819f5e086f26a
2022-09-06 16:14:48 +02:00
Matthias Sohn 370d1170e8 Merge branch 'master' into stable-6.3
* master:
  Move WorkTreeUpdater to merge package
  WorkTreeUpdater: use DirCacheCheckout#StreamSupplier
  DirCacheCheckout#getContent: also take InputStream supplier
  WorkTreeUpdater: remove safeWrite option

Change-Id: I8be570dbc4ad0d0b46046b85cbda24c3adcba170
2022-09-06 15:58:47 +02:00
Matthias Sohn 57087e2b92 Merge changes I888f313f,I98de155c,I2efa9a6d,Ifa79dac2
* changes:
  Move WorkTreeUpdater to merge package
  WorkTreeUpdater: use DirCacheCheckout#StreamSupplier
  DirCacheCheckout#getContent: also take InputStream supplier
  WorkTreeUpdater: remove safeWrite option
2022-09-06 09:42:14 -04:00
Han-Wen Nienhuys 448052dc2e Move WorkTreeUpdater to merge package
This avoids making it public with the associated costs for backward
compatibility guarantees.

Change-Id: I888f313f3854deace8d4cd92f354a6ef0d3b5460
2022-09-06 14:48:13 +02:00
Han-Wen Nienhuys 6ed4c074ca WorkTreeUpdater: use DirCacheCheckout#StreamSupplier
This avoids having to introduce the StreamLoader bridging class.

Change-Id: I98de155c458745236df24d6323eabed5061e7f8c
2022-09-06 14:48:13 +02:00
Han-Wen Nienhuys 6d2bcb6043 DirCacheCheckout#getContent: also take InputStream supplier
This lets us use DirCacheCheckout for routines that want to write
files in the worktree that aren't available as a git object.

DirCacheCheckout#getContent takes a InputStream supplier rather than
InputStream: if filtering fails with IOException, the data is placed
unfiltered in the checkout. This means that the stream has to be read
again, from the start.

Use it in this way in ApplyCommand. This use is incorrect, though: the
same InputStream is returned twice, so if the read to be retried, the
stream will return 0 bytes. It doesn't really matter, because in
either case, the SHA1 will not match up, and the patch fails.

Change-Id: I2efa9a6da06806ff79b155032fe4b34be8fec09e
2022-09-06 14:38:41 +02:00
Matthias Sohn 7c4a5421cc Revert "Adds FilteredRevCommit that can overwrites its parents in the
DAG."

This reverts commit 6297491e8a.

This is done as a quick fix for the failure of egit tests caused by  the
introduction of FilteredRevCommit.

Bug: 580690
Change-Id: Ia6b651dd11b0a4b02d5e52247eb4bf13adf94e27
2022-09-06 10:40:26 +02:00
Matthias Sohn ee6334bccf Revert "Option to pass start RevCommit to be blamed on to the
BlameGenerator."

This reverts commit 5747bba48b.

This is done as a quick fix for the failure of egit tests caused by  the
introduction of FilteredRevCommit.

Bug: 580690
Change-Id: Ia0178bc2de4fc825a81207bbd7979bf3a386c955
2022-09-06 10:40:26 +02:00
Han-Wen Nienhuys 2778bb2cc9 WorkTreeUpdater: remove safeWrite option
This was added in Ideaefd5178 to anticipate on writing files for
ApplyCommand, but we are keeping WorkTreeUpdater private to the merge
package for now.

Change-Id: Ifa79dac245e60eb7a77eaea4cc1249222e347d38
2022-09-06 10:01:44 +02:00
Matthias Sohn 6e7a158869 Merge branch 'master' into stable-6.3
* master:
  Update Orbit to R20220830213456 for 2022-09
  BaseSuperprojectWriter: report invalid paths as manifest errors
  ApplyCommand: fix ApplyResult#updatedFiles
  WorkTreeUpdater: rename metadata maps
  WorkTreeUpdater#Result: hide data members
  Add javadoc on RevCommit
  Option to pass start RevCommit to be blamed on to the BlameGenerator.
  WorkTreeUpdater: re-format and clean-up
  Adds FilteredRevCommit that can overwrites its parents in the DAG.

Change-Id: Ie92037b78b54c4ab290db80034e3192b1f90a1fc
2022-09-05 21:19:07 +02:00
Matthias Sohn 148ef4fd65 Update Orbit to R20220830213456 for 2022-09
Change-Id: Iab04fd9e72102abe3d9d927a5cae4a1df2001aa2
2022-09-05 16:48:05 +02:00
Ivan Frade ca166a0c62 BaseSuperprojectWriter: report invalid paths as manifest errors
An invalid path in the manifest (e.g. '.') is reported by DirCache in a
runtime exception. In server context this becomes a 500 instead of a user error.

Wrap the runtime invalid path exception into a checked ManifestErrorException that
caller can handle.

Change-Id: I61a2104922765506ae232334891057bb06141d97
2022-08-23 12:10:27 -07:00
Han-Wen Nienhuys 25aceffdc5 ApplyCommand: fix ApplyResult#updatedFiles
On executing a copy, mark the destination as updated.

On executing a rename, mark both source and destination as updated.

Change-Id: Ied5b9b0e5a14eac59a06cdd0961e25e143f50ff0
2022-08-23 09:23:23 -04:00
Han-Wen Nienhuys 0887111ba5 WorkTreeUpdater: rename metadata maps
Change-Id: I8ff3803da8fc13377d11c2dc5523e9e32d0650cb
2022-08-23 05:13:43 -04:00
Han-Wen Nienhuys ddb1a0c3a2 WorkTreeUpdater#Result: hide data members
This is the standard across JGit.

Change-Id: Ie52ad7000d8725657b33dd4f3adcc05ab9666875
2022-08-23 04:24:37 -04:00
Han-Wen NIenhuys d718127a7e Merge "WorkTreeUpdater: re-format and clean-up" 2022-08-18 11:22:46 -04:00
Ronald Bhuleskar 1a2aa740c8 Add javadoc on RevCommit
Change-Id: Ib413154fe52983286cb6307862a7373af4fec6e8
2022-08-17 19:16:45 -04:00
Ronald Bhuleskar 5747bba48b Option to pass start RevCommit to be blamed on to the BlameGenerator.
This can allow passing a FilteredRevCommit which is the filtered list of
commit graph making it easier for Blame to work on. This can
significantly improve blame performance since blame can skip expensive
RevWalk.

Change-Id: Ie127cb710d004079e9f53a5802130afdb49a7de1
2022-08-17 13:50:34 -04:00
Thomas Wolf aaae9ecd57 WorkTreeUpdater: re-format and clean-up
Reformat using the standard JGit formatter settings. Clean-ups:

* Try to improve javadoc.
* Remove blindly copy-pasted "@since 6.1" annotations.
* Get rid of private method nonNullNonBareRepo(); it's not needed.
* Simplify method nonNullRepo(), and annotate as @NonNull.
* Rename setInCoreFileSizeLimit() to getInCoreFileSizeLimit().

Change-Id: Ib1797e7cf925d87554307468330971e8ab2e05e9
Signed-off-by: Thomas Wolf <twolf@apache.org>
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2022-08-17 18:44:21 +02:00
Matthias Sohn 3a12709851 Prepare 6.3.0-SNAPSHOT builds
Change-Id: Ie398b651c5308ec86812bf01fcc563d3e679c828
2022-08-17 07:44:50 +02:00