summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Prepare 5.10.0-SNAPSHOT buildsMatthias Sohn2020-11-0488-121/+121
| | | | | Change-Id: Ie13f90948669c8cdebd14e74a91df9daf0387ccf Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v5.10.0.202011041322-m2v5.10.0.202011041322-m2Matthias Sohn2020-11-0488-121/+121
| | | | | Change-Id: Ia2709321f61f61208350eaa8aa48e56b88455146 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Revert "Client-side protocol V2 support for fetching"Thomas Wolf2020-11-0325-1301/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f802f06e7fd5a98f256b7b7727598491f563bf2f. I had misunderstood how protocol V2 works. This implementation only works if the negotiation during fetch is done in one round. Fixing this is substantial work in BasePackFetchConnection. Basically I think I'd have to change back negotiate to the V0 version, and have a doFetch() that does if protocol V2 doFetchV2() else doFetchV0() with doFetchV0 the old code, and doFetchV2 completely new. Plus there would need to be a HTTP test case requiring several negotiation rounds. This is a couple of days work at least, and I don't know when I will have the time to revisit this. So although the rest of the code is fine I prefer to back this out completely and not leave a only half working implementation in the code for an indeterminate time. Bug: 553083 Change-Id: Icbbbb09882b3b83f9897deac4a06d5f8dc99d84e Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Close Repository to fix tests failing on WindowsNail Samatov2020-11-011-0/+8
| | | | | | | | Fix tests failing on Windows because Repository instance is created but not closed on tear down. Change-Id: I72488ba5efeec95110926b1fbd56b7d96fca0d37 Signed-off-by: Nail Samatov <sanail@yandex.ru> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Client-side protocol V2 support for fetchingThomas Wolf2020-10-2925-220/+1301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make all transports request protocol V2 when fetching. Depending on the transport, set the GIT_PROTOCOL environment variable (file and ssh), pass the Git-Protocol header (http), or set the hidden "\0version=2\0" (git anon). We'll fall back to V0 if the server doesn't reply with a version 2 answer. A user can control which protocol the client requests via the git config protocol.version; if not set, JGit requests protocol V2 for fetching. Pushing always uses protocol V0 still. In the API, there is only a new Transport.openFetch() version that takes a collection of RefSpecs plus additional patterns to construct the Ref prefixes for the "ls-refs" command in protocol V2. If none are given, the server will still advertise all refs, even in protocol V2. BasePackConnection.readAdvertisedRefs() handles falling back to protocol V0. It newly returns true if V0 was used and the advertised refs were read, and false if V2 is used and an explicit "ls-refs" is needed. (This can't be done transparently inside readAdvertisedRefs() because a "stateless RPC" transport like TransportHttp may need to open a new connection for writing.) BasePackFetchConnection implements the changes needed for the protocol V2 "fetch" command (simplified ACK handling, delimiters, section headers). In TransportHttp, change readSmartHeaders() to also recognize the "version 2" packet line as a valid smart server indication. Adapt tests, and run all the HTTP tests not only with both HTTP connection factories (JDK and Apache HttpClient) but also with both protocol V0 and V2. Do the same for the SSH transport tests. Bug: 553083 Change-Id: Ice9866aa78020f5ca8f397cde84dc224bf5d41b4 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Update slf4j to 1.7.30Matthias Sohn2020-10-2816-70/+70
| | | | | Bug: 566475 Change-Id: Ia3e5b72d53ead435e4677e46c73a3ff45a606b41 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Update Orbit to S20201027182932 (2020-12 M2)Matthias Sohn2020-10-2825-36/+102
| | | | Change-Id: I24add2e8133f5c83675ab3ade58d7d6db29771ec Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix formatting of config option valuesMatthias Sohn2020-10-261-4/+4
| | | | Change-Id: If9a4bb44c4b348cbb94127207566471105267a53
* Document options in core section supported by JGitMatthias Sohn2020-10-261-2/+34
| | | | Change-Id: I25af04112cf219405718b5c3e8e103156fb30fa5
* Ensure .gitmodules is loaded when accessing submodule nameJohn Dallaway2020-10-253-1/+9
| | | | | | | | | | | | This problem occurred when calling SubmoduleWalk#getModuleName if the first submodule processed has a name and a path which do not match SubmoduleWalk#getModuleName returned the module path instead of the module name. In order to fix this SubmoduleWalk#getModuleName needs to ensure that the modules config is loaded. Bug: 565776 Change-Id: I36ce1fbc64c4849f9d8e39864b825c6e28d344f8 Signed-off-by: John Dallaway <john@dallaway.org.uk> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Export new package org.eclipse.jgit.logging and import it where usedMatthias Sohn2020-10-252-0/+2
| | | | | Change-Id: Ib81b8733e184e75c2cba21ab27c4bbe8dbe0b04d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Ensure GC.deleteOrphans() can delete read-only orphaned files on WindowsMatthias Sohn2020-10-221-1/+2
| | | | | | Reported in https://www.eclipse.org/lists/jgit-dev/msg04005.html Change-Id: I140a49a7f65a76aa2b67ec8d286a3d2506ae499a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Add new performance logging"Terry Parker2020-10-213-0/+188
|\
| * Add new performance loggingAlexa Panfil2020-10-213-0/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new performance logging to register events of type duration. The proposed logging is similar to the performance logging in OS Gerrit https://gerrit-review.googlesource.com/c/gerrit/+/225628: a global Singleton (LoggingContext in Gerrit) is collecting the performance logs in a thread-safe events list, and at the end of the monitored command the list of events is retrieved and written to a log, after which it is cleared. What this patch does: The main component is the Singleton (PerformanceLogContext), which is used to collect the records (PerformanceLogRecord) in one place (ThreadLocal eventsList) from anywhere using PerformanceLogContext.getInstance().addEvent(). Reason why this change is needed: The current monitoring in JGit has several issues: 1. git fetch and git push events are handled separately (PackStatistics and ReceivedPackStatistics), with no unified way of writing or reading the statistics. 2. PostUploadHook is only invoked on the event of sending the pack, which means that the PackStatistics is not available for the fetch requests that did not end with sending the pack (negotiation requests). 3. The way the logs are created is different from the performance log approach, so the long-running operations need to be collected from both performance log (for JGit DFS overridden operations and Gerrit operations) and gitlog (for JGit ones). The proposed performance logging is going to solve the above mentioned issues: it collects all of the performance logs in one place, thus accounting for the commands that do not result in sending a pack. The logs are compatible with the ones on Gerrit. Moreover, the Singleton is accessible anywhere in the call stack, which proved to be successful in other projects like Dapper (https://research.google/pubs/pub36356/). Signed-off-by: Alexa Panfil <alexapizza@google.com> Change-Id: Iabfe667a3412d8a9db94aabb0f39b57f43469c41
* | Merge "Compute time differences with Duration"Jonathan Tan2020-10-191-9/+12
|\|
| * Compute time differences with DurationAlexa Panfil2020-10-091-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reason why this change is needed: Currently the durations of fetch events are computed by registering time instants with System.currentTimeMillis() and calculating the differences with simple minus operation, but multiple sources suggest that the best practice is to use the Java 8 Duration and Instant objects. What this patch does: Get time measurements with Instant.now() instead of System.currentTimeMillis() and calculate the duration of fetch events (Reachability checks and Negotiation) using Duration.between().toMillis(). Signed-off-by: Alexa Panfil <alexapizza@google.com> Change-Id: I573a0a0562070083cf5a5a196d9710f69a7fa587
* | Merge "Implement git describe --all"Christian Halstrick2020-10-134-7/+88
|\ \
| * | Implement git describe --allJason Yeo2020-10-134-7/+88
| | | | | | | | | | | | | | | | | | | | | | | | This enables jgit to use any refs in the refs/ namespace when describing commits. Signed-off-by: Jason Yeo <jasonyeo88@gmail.com> Change-Id: I1fa22d1c39c0e2f5e4c2938c9751d8556494ac26
* | | Override config http.userAgent from environment GIT_HTTP_USER_AGENTThomas Wolf2020-10-062-2/+38
| |/ |/| | | | | | | | | | | | | | | According to [1], environment variable GIT_HTTP_USER_AGENT can override a git config http.userAgent. [1] https://git-scm.com/docs/git-config#Documentation/git-config.txt-httpuserAgent Change-Id: I996789dc49faf96339cd7b4e0a682b9bcafb6f70 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | Upgrade spotbugs-maven-plugin to 4.1.3Marco Miller2020-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | Since 4.0.4, aligns with spotbugs 4.1.3 [1]. Also, "fixes copy of repo being put until target" and "reduces logging output below threshold". [1] https://github.com/spotbugs/spotbugs-maven-plugin/releases Change-Id: Idb7127ba7b5fc40bf85a13bb193760bbf6ec0f7c Signed-off-by: Marco Miller <marco.miller@ericsson.com>
* | Fix OperatorPrecedence warning flagged by error proneDavid Ostrovsky2020-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Building with Bazel is failing with this error message: HttpSupport.java:480: error: [OperatorPrecedence] Use grouping parenthesis to make the operator precedence explicit if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z') { ^ (see https://errorprone.info/bugpattern/OperatorPrecedence) Did you mean 'if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {'? Change-Id: I96089d3158d06ba981cfdf2b03865261b328de23
* | UploadPackTest#testUploadRedundantBytes: ensure test repo is closedMatthias Sohn2020-10-021-7/+10
| | | | | | | | | | | | This fixes a resource leak warning. Change-Id: I65166eeefc719ea577963c84ce2059e2d7e6c1d7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | ObjectDirectory#selectObjectRepresentation: fix formattingMatthias Sohn2020-10-021-1/+1
|/ | | | Change-Id: I3872f3001bb11e29a526ed90184ccb0c991b8567 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Upgrade ecj to 3.23.0Marco Miller2020-09-271-1/+1
| | | | | Change-Id: Ifca682c4aff0cfcd827986a02580e70dcfcad5c0 Signed-off-by: Marco Miller <marco.miller@ericsson.com>
* Support "http.userAgent" and "http.extraHeader" from the git configJames Wynn2020-09-2610-48/+327
| | | | | | | | | | | | | | | | Validate the extra headers and log but otherwise ignore invalid headers. An empty http.extraHeader starts the list afresh. The http.userAgent is restricted to printable 7-bit ASCII, other characters are replaced by '.'. Moves a support method from the ssh.apache bundle to HttpSupport in the main JGit bundle. Bug:541500 Change-Id: Id2d8df12914e2cdbd936ff00dc824d8f871bd580 Signed-off-by: James Wynn <james@jameswynn.com> Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* sshd: better error report when user cancels authenticationThomas Wolf2020-09-265-17/+103
| | | | | | | | Use a dedicated exception class to be able to detect this case in the SshdSessionFactory and skip the generic SshException in that case. Change-Id: I2a0bacf47bae82f154a0f4e79efbb2af2a17d0cf Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* API filters for PackStatistics.AccumulatorThomas Wolf2020-09-261-0/+14
| | | | Change-Id: Iaafb766aa76f0e8f837bd37c0729b1262e7ac1f6 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Add TypedConfigGetter.getPath()Thomas Wolf2020-09-254-19/+107
| | | | | | | | | | | | | | | | | | This enables EGit to override with a lenient variant that logs the problem and continues with the default value. EGit needs this because otherwise a corrupt core.excludesFile entry can render the whole UI unusable (until the git config is fixed) because any use of the WorkingTreeIterator will throw an InvalidPathException. This is not a problem on OS X, where all characters are allowed in file names. But on Windows some characters are forbidden... see bug 567296. The message of the InvalidPathException is not helpful since it doesn't point to the origin of the problem. EGit can log a much better message indicating the offending config file and entry in the Eclipse error log, where the user can see it. Bug: 567309 Change-Id: I4e57afa715ff3aaa52cd04b5733f69e53af5b1e0 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Make Javadoc consistent for PackStatistics fieldsAlexa Panfil2020-09-241-1/+4
| | | | Change-Id: I53d4072174e9fec92bff7c0225aa7470d8d39d05
* Measure time taken for reachability checksAlexa Panfil2020-09-243-19/+175
| | | | | | | | | | | | | Reason why this change is needed: Getting this metric will help estimate how much time will be saved once the reachability checks get optimized What this patch does: Measure time spent by requestValidator.checkWants() in parseWants() and save it in an instance of PackStatistics.Accumulator. Signed-off-by: Alexa Panfil <alexapizza@google.com> Change-Id: Id7fe4016f96549d9511a2c24052dad93cfbb31a4
* Merge "Measure time taken for negotiation in protocol V2"Terry Parker2020-09-221-1/+8
|\
| * Measure time taken for negotiation in protocol V2Alexa Panfil2020-09-221-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reason why this change is needed: Getting this metric will help estimate how much time is spent on negotiation in fetch V2. What this patch does: Measure time spent on negotiation rounds in UploadPack.fetchV2() and save it in an instance of PackStatistics.Accumulator. This is the same way the statistics are already gathered for protocol V0/V1. Change-Id: I14e55dd6ff743cb0b21b4953b533269ef069abb1
* | IndexDiffFilter: handle path prefixes correctlyThomas Wolf2020-09-212-5/+27
| | | | | | | | | | | | | | | | | | | | | | When comparing git directory paths to check whether one is a prefix of another, one must add a slash to avoid false prefix matches when one directory name is a prefix of another. The path "audio" is not a prefix of the path "audio-new", but would be a prefix of a path "audio/new". Bug: 566799 Change-Id: I6f671ca043c7c2c6044eb05a71dc8cca8d0ee040 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | sshd: support the ProxyJump ssh configThomas Wolf2020-09-1910-37/+663
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful to access git repositories behind a bastion server (jump host). Add a constant for the config; rewrite the whole connection initiation to parse the value and (recursively) set up the chain of hops. Add tests for a single hop and two different ways to configure a two-hop chain. The connection timeout applies to each hop in the chain individually. Change-Id: Idd25af95aa2ec5367404587e4e530b0663c03665 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | Upgrade jacoco-maven-plugin to 0.8.6Marco Miller2020-09-161-1/+1
|/ | | | | Change-Id: Ifd4e8fc60844690d144a0872db4f740f45226ff9 Signed-off-by: Marco Miller <marco.miller@ericsson.com>
* Merge "ReceivePackStats: Add size and count of unnecessary pushed objects"Terry Parker2020-09-144-5/+137
|\
| * ReceivePackStats: Add size and count of unnecessary pushed objectsYunjie Li2020-09-114-5/+137
| | | | | | | | | | | | | | | | | | | | | | | | Since there is no negotiation for a push, the client is probably sending redundant objects and bytes which already exist in the server. Add more metrics in the stats to quantify it. Duplicated size and number to measure the size and the number of duplicated objects which should not be pushed. Change-Id: Iaacd4761ee9366a0a7ec4e26c508eff45c8744de Signed-off-by: Yunjie Li <yunjieli@google.com>
* | Merge branch 'stable-5.9' into masterMatthias Sohn2020-09-096-87/+36
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.9: Prepare 5.9.1-SNAPSHOT builds JGit v5.9.0.202009080501-r [releng] Enable japicmp for the fragments added in 5.8.0 GitlinkMergeTest: fix boxing warnings Remove unused API problem filters Add missing since tag on BundleWriter#addObjectsAsIs GPG: include signer's user ID in the signature Change-Id: Iaa96f9228752540f446fc232a49f31a738fd8d30 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare 5.9.1-SNAPSHOT buildsMatthias Sohn2020-09-0888-504/+504
| | | | | | | | | | | | | | | Change-Id: I9006e7961111982943ffef496d15bd525959b3e4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v5.9.0.202009080501-rv5.9.0.202009080501-rMatthias Sohn2020-09-0888-121/+121
| | | | | | | | | | | | | | | Change-Id: Ic98ae61b3f327ef72256fd9b2e28510e3a481de7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | [releng] Enable japicmp for the fragments added in 5.8.0Thomas Wolf2020-09-072-8/+0
| | | | | | | | | | | | | | | | | | | | | Uncomment the japicmp configurations in the pom.xmls of the fragments org.eclipse.jgit.gpg.bc and org.eclipse.jgit.ssh.jsch. Change-Id: I7c884be014cb48387f97a300043b04aeb712fbba Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| * | GitlinkMergeTest: fix boxing warningsMatthias Sohn2020-09-051-1/+1
| | | | | | | | | | | | Change-Id: I4bdf1ab3e7d7e9d96318e2b16b792aa98ebd2ecd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Remove unused API problem filtersMatthias Sohn2020-09-051-73/+0
| | | | | | | | | | | | Change-Id: Ice154340e3377e89dc51d40587c8a4c5caec2bcf Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Add missing since tag on BundleWriter#addObjectsAsIsMatthias Sohn2020-09-051-0/+1
| | | | | | | | | | | | | | | Change-Id: Ia07c0ede31e280831869db77b70b43874d8ba3ac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Merge branch 'master' into stable-5.9Matthias Sohn2020-09-058-59/+649
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: SshdSession: close channel gracefully jgit: Add DfsBundleWriter Prepare 5.10.0-SNAPSHOT builds ResolveMerger: do not content-merge gitlinks on del/mod conflicts ResolveMerger: Adding test cases for GITLINK deletion ResolveMerger: choose OURS on gitlink when ignoreConflicts ResolveMerger: improving content merge readability ResolveMerger: extracting createGitLinksMergeResult method ResolveMerger: Adding test cases for GITLINK merge Back out the version change to 5.10.0-SNAPSHOT which was done on master already. Change-Id: I1a6b1f0b8f5773be47823d74f593d13b16a601d5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | GPG: include signer's user ID in the signatureThomas Wolf2020-09-051-5/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signing a commit with command line git and gpg 2.2.20 includes the e-mail part of the key's user ID as a "Signer's User ID" subpacket on the signature. Implement this for signing via Bouncy Castle. Bug: 564386 Change-Id: I68906b895349359596cf3451d65f2840c60df856 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | Upgrade maven-project-info-reports-plugin to 3.1.1Marco Miller2020-09-082-2/+2
| |/ / |/| | | | | | | | | | | Change-Id: I1a3c68e8ebab79e1a23616d1f56f75981c56a7f3 Signed-off-by: Marco Miller <marco.miller@ericsson.com>
* | | SshdSession: close channel gracefullyThomas Wolf2020-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Close the channel gracefully to give the server a chance to clean up properly on its side. Bug: 565854 Change-Id: Iedda5af3b97c8321f08f7ce854274cbb30e401de Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | Merge branch 'stable-5.9'Marco Miller2020-09-041-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | * stable-5.9: Bump Bazel version to 3.5.0 Change-Id: Ic96a2918c34696d31af5104305201e8426989a9d Signed-off-by: Marco Miller <marco.miller@ericsson.com>
| * | Bump Bazel version to 3.5.0Marco Miller2020-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This latest release includes cherry picks, a new feature and some important changes [1]. [1] https://github.com/bazelbuild/bazel/releases/tag/3.5.0 Change-Id: Ie6966b0b56a351f98cb20b25daf3412740e68562 Signed-off-by: Marco Miller <marco.miller@ericsson.com>