aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Silence API error for new method in ReachabilityCheckerMatthias Sohn2019-11-251-0/+8
| | | | | | | Following OSGi semantic versioning which tolerates breaking implementers in a minor release. Change-Id: I4600c5ee9cd4ae209b69870a5d1367f83678617e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* BitmappedReachabilityChecker: Use only one bitmap for the whole checkIvan Frade2019-11-213-339/+95
| | | | | | | | | | | | | | | The checker is creating a new bitmap per branch leading to excessive memory consumption. For the reachability check one bitmap with the reachability of all branches aggregated is enough. Build the reachability bitmap with a filter. The filter itself uses it to emit only commits not reached before and the caller to check what targets have been reached already. BitmapCalculator is not required anymore. Change-Id: Ic5c62f77fe0f188913215b7eaa51d849a9aae6a5 Signed-off-by: Ivan Frade <ifrade@google.com>
* checkNotAdvertisedWants: Be lazy converting Ref to RevCommitIvan Frade2019-11-212-40/+69
| | | | | | | | | | | | | | | | The ref points to an ObjectId that then is translated into a RevCommit. This translation can be costly and with the incremental reachability check is probably not needed for most of the elements. Delay the translation from ObjectId to RevCommit to when it is needed. Use Streams, that have the laziness built-in, all the way from Ref to RevCommit. This should reduce the latency for reachability checks over big sets of references. Change-Id: I28693087321b2beff3eaa1f3d2e7840ab0eedc6d Signed-off-by: Ivan Frade <ifrade@google.com>
* ReachabilityChecker: Receive a Stream instead of a CollectionIvan Frade2019-11-215-18/+59
| | | | | | | | | | | | | | Preparatory change. Converting ObjectIds to RevCommits is potentially expensive and in the incremental reachability check, it is probably not required for all elements in the collection. Pass a Stream to the reachability checker. In the follow up we make the conversion from ObjectId to RevCommit in the stream (i.e. on demand). This should reduce the latency of reachability checks over big sets of references. Change-Id: I9f310e331de5b0bf8de34143bd7dcd34316d2fba Signed-off-by: Ivan Frade <ifrade@google.com>
* UploadPack: Prioritize references for non-advertised wants checksIvan Frade2019-11-211-7/+44
| | | | | | | | | | | | | | UploadPack needs to check if object ids that weren't advertised before are reachable from the references visible to the user. In the bitmap-based reachability check, this is done incrementally: checking against one reference, if anything remaining adding a second and so on. It is more efficient to check first more common references (e.g. refs/heads/*) Sort the references for the reachability checker. This should solve the connectivity earlier and require less bitmap creation and less memory. Change-Id: I48ac10d71e29fab2d346479802401eaea4aacb5c Signed-off-by: Ivan Frade <ifrade@google.com>
* ReceivePack: Fix name hiding of 'atomic' memberDavid Pursehouse2019-11-171-2/+1
| | | | | Change-Id: Ia357d49ca793ff1cb86e7130bc1a5f59590496a9 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* ReceivePack: Remove unnecessarily nested else-clauseDavid Pursehouse2019-11-171-3/+3
| | | | | Change-Id: I604ea76e03503300a381eca9c213f73677b5e21f Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Simplify comparator codeMichael Keppler2019-11-171-6/+2
| | | | | | | Use lambda style comparators where possible. They are easier to read. Change-Id: I5b80cfcd90909c94286742fa83af71015532809f Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
* Fix typo in JavadocMichael Keppler2019-11-171-2/+2
| | | | | | | No functional changes. Change-Id: Ic7f9bb85806eca2788303c2f808d003cdfc7cc7c Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
* pgm: add write stats to BenchmarkReftableHan-Wen Nienhuys2019-11-161-1/+36
| | | | | | | | | | | | | | | Usage: git ls-remote https://gerrit.googlesource.com/gerrit > lsr bazel build org.eclipse.jgit.pgm:jgit && rm -rf /tmp/reftable* && \ ./bazel-bin/org.eclipse.jgit.pgm/jgit debug-benchmark-reftable \ --test write_stack lsr /tmp/reftable On my Lenovo x250 laptop, this yields about 1ms per ref write. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: I31c74a08026ba188a3256ef6862dae9d85e6d5ef
* pgm: add command to convert repo to reftableHan-Wen Nienhuys2019-11-163-0/+63
| | | | | | Change-Id: I2f870699995da164a3e7adec430301ac7a53c425 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* file: implement FileReftableDatabaseHan-Wen Nienhuys2019-11-1612-51/+2551
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reftable is a binary, block-based storage format for the ref-database. It provides several advantages over the traditional packed + loose storage format: * O(1) write performance, even for deletions and transactions. * atomic updates to the ref database. * O(log N) lookup and prefix scans * free from restrictions imposed by the file system: it is case-sensitive even on case-insensitive file systems, and has no inherent limitations for directory/file conflicts * prefix compression reduces space usage for repetitive ref names, such as gerrit's refs/changes/xx/xxxxx format. FileReftableDatabase is based on FileReftableStack, which does compactions inline. This is simple, and has good median performance, but every so often it will rewrite the entire ref database. For testing, a FileReftableTest (mirroring RefUpdateTest) is added to check for Reftable specific behavior. This must be done separately, as reflogs have different semantics. Add a reftable flavor of BatchRefUpdateTest. Add a FileReftableStackTest to exercise compaction. Add FileRepository#convertToReftable so existing testdata can be reused. CQ: 21007 Change-Id: I1837f268e91c6b446cb0155061727dbaccb714b8 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix Maven missing version warningMichael Keppler2019-11-161-0/+1
| | | | | | | | | | | [WARNING] Some problems were encountered while building the effective model for org.eclipse.jgit:org.eclipse.jgit.benchmarks:jar:5.6.0-SNAPSHOT [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-shade-plugin is missing. @ line 131, column 15 Change-Id: Id25916c460bc4a10d0f797779d24f53292df2b77 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
* Use Java 8 source and target in MavenMichael Keppler2019-11-161-0/+2
| | | | | | | | | | | Building the jgit aggregator with Maven leads to a compiler level 1.6 for me, thereby failing the build. Multiple profiles specify source/target level separately, but there seems no global setting. Adding the global properties makes the jgit aggregator compile on my system. Change-Id: Ia5613cc0fcf6085265a9e48f940e5a7d3f998608 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
* ReceivePack: Reduce visibility of methodsDavid Pursehouse2019-11-162-23/+26
| | | | | | | | | Several methods were protected when they were defined in BaseReceivePack which has since been squashed into ReceivePack. Those methods no longer need to be protected, and can now be private instead. Change-Id: Ic6bb5e66f353fcbdc7919847423234af398c88b4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Suppress API error raised for constant added in 345e2648Matthias Sohn2019-11-161-0/+8
| | | | Change-Id: I29fb091f27f38c74843d50c2602164fc63ab8a16 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* TopoSortGenerator: simplify first-parent handlingThomas Wolf2019-11-151-8/+7
| | | | Change-Id: I74b40f1a2f81911c1d5ac5ae93b4a160fccf8f73 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* RewriteGenerator: avoid adding null parentThomas Wolf2019-11-152-3/+43
| | | | | | | | Prevent adding a null parent to a commit's parent array. Doing so can cause NPEs later on. Bug: 552160 Change-Id: Ib24b7b9b7b08e0b6f246006b4a4cade7eeb830b9 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* DiffFormatter: support core.quotePath = falseThomas Wolf2019-11-154-19/+144
| | | | | | | | | | | | | | | | | | | | | | core.quotePath = false means that "bytes higher than 0x80 are not considered "unusal" anymore"[1], i.e., they are not escaped. In essence this preserves non-ASCII characters in path names in output. Note that control characters and other special characters in the ASCII range will still be escaped. Add a new QuotedString.GIT_PATH_MINIMAL singleton implementing this. Change the normal GIT_PATH algorithm to use bytes instead of characters so it can be re-used. Provide a setter in DiffFormatter for the quoting style so that an application can override the default, which is the setting from the git config (and by default "true"). Use the new QuotedString.GIT_PATH_MINIMAL when core.quotePath == false. [1] https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath Bug: 552467 Change-Id: Ifcb233e7d10676333bf42011e32d01a4e1138059 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* IndexDiff/SubmoduleWalk: make the RepositoryBuilder configurableThomas Wolf2019-11-153-8/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | Some applications using JGit use their own repository caching. In such applications, it may be needlessly inefficient to create new submodule repositories from a SubmoduleWalk or in an IndexDiff. It can be much more efficient to use an already cached repository instance. Provide a way to configure a SubmoduleWalk with a factory to create BaseRepositoryBuilders to use to create repositories, and use it in IndexDiff. Provide new IndexDiff.diff() operations that take such an additional factory as parameter. An application that caches Repository instances (for instance EGit) can use a factory that provides builders that don't create a new Repository instance but that return the already cached instance, if one is available. Note that in such a case, the application may need to be prepared to deal with IndexDiff.diff() also _closing_ the obtained repository; if the application expects its cached Repository instances to remain open while being cached, it'll have to use Repository.incrementOpen() to prevent that the repository instance gets closed. Bug: 550878 Change-Id: Icc1b34dfc4cebd8ed4739dd09d37744d41adf711 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* IndexDiff/SubmoduleWalk: handle submodule.<name>.ignore correctlyThomas Wolf2019-11-153-3/+87
| | | | | | | | | | | | | | IndexDiff would apply ignore mode ALL from .gitmodules to all remaining submodules, and would ignore other settings from .gitignore and always apply the setting defined on the IndexDiff instead. Correct that. In canonical git the ignore setting from .gitmodules can also be overridden by .git/config.[1] Implement that override in SubmoduleWalk. [1] https://git-scm.com/docs/gitmodules#Documentation/gitmodules.txt-submoduleltnamegtignore Bug: 521613 Change-Id: I9199fd447e41c7838924856dce40678370b66395 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Merge changes I583491f6,Idd44e3bbJonathan Nieder2019-11-144-202/+175
|\ | | | | | | | | | | * changes: Run Eclipse formatter on BatchRefUpdateTest Move KetchSystem.delay to FileUtils.
| * Run Eclipse formatter on BatchRefUpdateTestHan-Wen Nienhuys2019-11-141-178/+145
| | | | | | | | | | Change-Id: I583491f621e54401c60150efb285fcc7243a9355 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
| * Move KetchSystem.delay to FileUtils.Han-Wen Nienhuys2019-11-133-24/+30
| | | | | | | | | | | | | | | | This will provide exponential backoff with jitter to other JGit components too. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: Idd44e3bbaef6d71134ce2e3f7d405f35e7397cbd
* | Suppress the API errors introduced by 3e9a5f99Matthias Sohn2019-11-144-1/+63
| | | | | | | | | | | | | | | | I1ce92869435d5eebb7d671be44561e69c6233134 merged BaseReceivePack into ReceivePack which breaks API but is only affecting the few jgit based servers out in the wild. Change-Id: Iad856a2afaf3cad95d01ad81a0116cebcd9de2d9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | ReceivePack: Remove unused getLockMessageProcessName methodDavid Pursehouse2019-11-131-9/+0
| | | | | | | | | | Change-Id: I85a0c3e3a53f87ad6f6eda41c7c6cb41b403b3bb Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | ReceivePack: Remove unnecessary ReceivePack. prefix on static callDavid Pursehouse2019-11-131-1/+1
| | | | | | | | | | Change-Id: I2d9a95266f5baa5a2298451adbd9ca0259b26c4b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | transport: Merge BaseReceivePack into ReceivePackMasaya Suzuki2019-11-1310-2053/+1890
| | | | | | | | | | | | | | | | | | | | | | | | | | Move the BaseReceivePack implementation back into ReceivePack. This is a backward-incompatible change. For example, BaseReceivePack.FirstLine no longer exists and cannot be referenced. However, most of the code should just work by replacing BaseReceivePack with ReceivePack. Although this is an API change, it only affects callers using JGit as a server, and there are very few of those in the wild. Change-Id: I1ce92869435d5eebb7d671be44561e69c6233134 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | BaseReceivePack: Add hasReceivedPack methodDavid Pursehouse2019-11-131-0/+14
|/ | | | | | | | | | | | | | | | The getPackSize method will throw IllegalStateException if it is called when the pack size is not set. This is the case for example when the received commands are all DELETE and there is no pack. Add a new method hasReceivedPack that can be called prior to calling getPackSize, to avoid causing the IllegalStateException. See [1] for context. [1] https://bugs.chromium.org/p/gerrit/issues/detail?id=11918 Change-Id: I56397256a05e92c8398e65c07a859cee59b46317 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Silence API errors for new API introduced in 5.5.2Matthias Sohn2019-11-121-0/+36
| | | | Change-Id: I9fee5138ea8f407d9d34cad4659c3a2d4f3ebf35 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Upgrade wagon-ssh to 3.3.4David Pursehouse2019-11-121-1/+1
| | | | | Change-Id: I6162b72fc06376f33fe34b9fef1c106800e3a920 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Merge branch 'stable-5.5'Thomas Wolf2019-11-121-3/+0
|\ | | | | | | | | | | | | | | * stable-5.5: Fix NPE in SystemReader in tests Change-Id: I8500caeca99fe05ce9a80b54330b72e23670a46b Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| * Fix NPE in SystemReader in testsThomas Wolf2019-11-121-3/+0
| | | | | | | | | | | | | | | | SystemReader.updateAll() must _not_ test whether the file exists. In tests at least there are FileBasedConfigs with a null file. Test configs should (and do) override isOutdated() to deal with this case. Change-Id: I56303fe0d56afeb9f2203ee807a92c5dcf3809e9 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | Merge branch 'stable-5.5'Matthias Sohn2019-11-1110-39/+197
|\| | | | | | | | | | | | | | | | | | | | | * stable-5.5: BaseReceivePack: Fix the format Prepend hostname to subsection used to store file timestamp resolution Store filesystem timestamp resolution in extra jgit config SystemReader: extract updating config and its parents if outdated Change-Id: Iecfddce8081303af29badcdcd3d72a0da50c964f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * BaseReceivePack: Fix the formatMasaya Suzuki2019-11-101-1/+1
| | | | | | | | | | Change-Id: I6136ef5318f81a6feb1267338ca76e60122fd15b Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
| * Prepend hostname to subsection used to store file timestamp resolutionMatthias Sohn2019-11-091-2/+3
| | | | | | | | | | | | | | | | | | This ensures the measured filesystem timestamp resolution will be only used on the machine where it was measured and avoid errors in case the ~/.jgitconfig file is copied to another machine. Bug: 551850 Change-Id: Iff2a11be62ca94c3bbe4a955182988dc50852f9f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Store filesystem timestamp resolution in extra jgit configMatthias Sohn2019-11-099-23/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids polluting hand-crafted user level config with auto-configured options which might disturb in environments where the user level config is replicated between different machines. Add a jgit config as parent of the system level config. Persist measured timestamp resolutions always in this jgit config and read it via the user global config. This has the effect that auto-configured timestamp resolution will be used by default and can be overridden in either the system level or user level config. Store the jgit config under the XDG_CONFIG_HOME directory following the XDG base directory specification [1] in order to ensure that we have write permissions to persist the file. This has the effect that each OS user will use its jgit config since they typically use different XDG_CONFIG_HOME directories. If the environment variable XDG_CONFIG_HOME is defined the jgit config file is located at $XDG_CONFIG_HOME/jgit/config otherwise the default is ~/.config/jgit/config. If you want to avoid redundant measurement for different OS users manually copy the values measured and auto-configured for one OS user to the system level git config. [1] https://wiki.archlinux.org/index.php/XDG_Base_Directory Bug: 551850 Change-Id: I0022bd40ae62f82e5b964c2ea25822eb55d94687 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * SystemReader: extract updating config and its parents if outdatedThomas Wolf2019-11-083-14/+55
| | | | | | | | | | Change-Id: Ia77f442e47c5670c2d6d279ba862044016aabd86 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Update bouncycastle version to 1.64 and Orbit to I20191106190530David Ostrovsky2019-11-0921-89/+154
| | | | | | | | | | | | | | | | | | | | The recent versions fixed number of defects and added new features: [1]. Use Orbit I20191106190530 until a S-build is available. [1] https://www.bouncycastle.org/releasenotes.html Change-Id: I0f2fd3a218ea31f6f6b58b1816af9361e4de54e4 Signed-off-by: David Ostrovsky <d.ostrovsky@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Upgrade maven-jar-plugin to 3.2.0David Pursehouse2019-11-061-1/+1
| | | | | | | | | | Change-Id: I74fc2a6b1a79f1433914b909e92e524668817081 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Upgrade maven-source-plugin to 3.2.0David Pursehouse2019-11-061-1/+1
| | | | | | | | | | Change-Id: I0c683e100b64f6d66e2598cb06970a547aaeaed6 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Merge branch 'stable-5.5'Matthias Sohn2019-11-061-146/+164
|\| | | | | | | | | | | | | * stable-5.5: Fix benchmark pom.xml to include distribution managment config Change-Id: Ife566e83777e3282892d6f7a90400b00e9065292
| * Merge branch 'stable-5.4' into stable-5.5Matthias Sohn2019-11-061-146/+164
| |\ | | | | | | | | | | | | | | | | | | * stable-5.4: Fix benchmark pom.xml to include distribution managment config Change-Id: I1863f641880e8d9fbd26c02ede6bf5d773e8c8a0
| | * Merge branch 'stable-5.3' into stable-5.4Matthias Sohn2019-11-061-146/+164
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.3: Fix benchmark pom.xml to include distribution managment config Change-Id: Ib4eed75cc8c5146884ce1461e98564de1c759bba
| | | * Merge branch 'stable-5.2' into stable-5.3Matthias Sohn2019-11-061-146/+164
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.2: Fix benchmark pom.xml to include distribution managment config Change-Id: Icda57b0045ba87d9424615713d7d706697e5c236
| | | | * Merge branch 'stable-5.1' into stable-5.2Matthias Sohn2019-11-061-146/+164
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.1: Fix benchmark pom.xml to include distribution managment config Change-Id: I20e8b7155397771b1bc77e628f535f27458a24bb
| | | | | * Fix benchmark pom.xml to include distribution managment configMatthias Sohn2019-11-061-146/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also fix indentation. Change-Id: I6d223c493d537bb8aac23c7ddf0a602aff22a3c2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | Merge branch 'stable-5.5'Matthias Sohn2019-11-0523-1/+1322
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.5: Run JMH benchmarks using bazel Benchmark for creating files and FileSnapshots Implement benchmark for looking up FileStore of a given Path JMH benchmark for SimpleLruCache Update API problem filters Remove unused API problem filters Silence API errors for new API added since 5.1.0 Change-Id: If87a13d0f809d9968ad2921b786f4b18e1b494d0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | | Merge branch 'stable-5.4' into stable-5.5Matthias Sohn2019-11-0523-1/+1322
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.4: Run JMH benchmarks using bazel Benchmark for creating files and FileSnapshots Implement benchmark for looking up FileStore of a given Path JMH benchmark for SimpleLruCache Update API problem filters Remove unused API problem filters Silence API errors for new API added since 5.1.0 Change-Id: I071536d630a95e89f5bbbf965a1571b9f5eb81ee Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | | | Merge branch 'stable-5.3' into stable-5.4Matthias Sohn2019-11-0523-1/+1322
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.3: Run JMH benchmarks using bazel Benchmark for creating files and FileSnapshots Implement benchmark for looking up FileStore of a given Path JMH benchmark for SimpleLruCache Update API problem filters Remove unused API problem filters Silence API errors for new API added since 5.1.0 Change-Id: Ib735c4039e24ec8b045ae2cc81df1e9e5c9fa996 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>