summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* UntrackedFilesHandler: Fix non-localized stringDavid Pursehouse2017-09-063-2/+7
| | | | | Change-Id: Ida7b9ddc991515ab233763f2cb985853c9143a3c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Main: Replace deprecated ExampleMode with OptionHandlerFilterDavid Pursehouse2017-09-061-2/+3
| | | | | Change-Id: I1161a82269b7f093c00c9533ed8b99b7cca0a322 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* ObjectCheckerTest: Factor duplicate instances out to constantsDavid Pursehouse2017-09-061-72/+42
| | | | | | | | | | | | | | | | | | | | | | | | | The tests: - testCheckBlobNotCorrupt - testCheckBlobCorrupt create instances of ObjectChecker that are the same. The tests: - testCheckBlobWithBlobObjectCheckerNotCorrupt - testCheckBlobWithBlobObjectCheckerCorrupt also create instances of ObjectChecker that are the same. Factor these instances out to constants instead of creating them in the tests. The `checker` member is still created anew in each test, since some of the tests change its state. Change-Id: I2d90263829d01d208632185b1ec2f678ae1a3f4c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* SubmoduleConfigTest: Add additional tests in fetchRecurseToConfigValueDavid Pursehouse2017-09-051-0/+2
| | | | | | | Add tests for "true" and "false" matching to "YES" and "NO". Change-Id: I58223855022871ac4b21bd34ff6a9cd00fce30a1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* SubmoduleConfig: Simplify #toConfigValueDavid Pursehouse2017-09-051-3/+1
| | | | | | | Just return configValue instead of transforming name(). Change-Id: I7f94ab2e206e93d1370467e187c5e68e8f6a8836 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Merge changes from topic 'dfs-reftable'Shawn Pearce2017-09-054-76/+542
|\ | | | | | | | | | | * changes: dfs: write reftable from DfsGarbageCollector dfs: compact reftables during DfsPackCompactor
| * dfs: write reftable from DfsGarbageCollectorShawn Pearce2017-09-052-14/+339
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a ReftableConfig has been supplied by the caller, write out a reftable as a sibling of the the GC pack, alongside the heads. To bootstrap from a non-reftable system, the refs are read from the DfsRefDatabase if no GC reftables are present. Its assumed the references are fully current, and do not need to be merged with any other reftables. Any non-GC reftables will be pruned at the end of the GC cycle, just like any packs that were replaced. If a GC reftable is present, all existing reftables are compacted, and references from DfsRefDatabase are only used to seed the packer. Its assumed these are consistent with each other. Change-Id: Ie397eb58aaaefb6865c816d9b39de3ac12998019
| * dfs: compact reftables during DfsPackCompactorShawn Pearce2017-09-052-62/+203
| | | | | | | | | | | | | | Combine intermediate, non-GC reftables when combining pack files. This shrinks the reftable stack, improving lookup times. Change-Id: I5dbba41806f99af5ecaff3a3119f6630e9404256
* | Remove final modifier on args4j option or argument fieldsMatthias Sohn2017-09-054-8/+8
| | | | | | | | | | | | | | | | | | Remove final field modifier since args4j does no longer allow use of final fields [1]. [1] https://github.com/kohsuke/args4j/commit/6e11f89d40dcc518c0e5eb9eef5d74f05d58e6af Change-Id: Ib3dee10828d87d6b558c2e90387eadd9aa2ce260 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Fix Daemon.stop() to actually stop the listener threadThomas Wolf2017-09-042-39/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ServerSocket.accept() is not interruptible: a thread busy in accept() may not react to Thread.interrupt() and may not return from accept() via an InterruptedException. Close the socket instead to make the daemon's listener thread terminate. * Close the listening socket to get the listening thread to exit instead of interrupting it. * Add a stopAndWait() method that stops the listening thread and then waits until it has indeed finished. * Set SO_REUSE_ADDRESS on the listening socket. Bug: 376369 Change-Id: I9d6014103e6dcb0173daea134feb44dc52c5c69a Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | Merge "Remove workaround for bug in Java's ReferenceQueue"Shawn Pearce2017-09-041-33/+9
|\ \
| * | Remove workaround for bug in Java's ReferenceQueueMatthias Sohn2017-09-041-33/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sun's Java 5, 6, 7 implementation had a bug [1] where a Reference can be enqueued and dequeued twice on the same reference queue due to a race condition within ReferenceQueue.enqueue(Reference). This bug was fixed for Java 8 [2] hence remove the workaround. [1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6837858 [2] http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/858c75eb83b5 Change-Id: I2deeb607e3d237f9f825a207533acdee305c7e73 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Use Config.getEnum() to read the IgnoreSubmoduleModeThomas Wolf2017-09-041-7/+2
| | | | | | | | | | | | | | | | | | | | | Doing so goes through the TypedConfigGetter and thus allows library clients (for instance EGit) to warn about invalid configurations. Change-Id: If1080ad90b8aff54a903d4d75637614faad6469b Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | Don't assume name = path in .gitmodulesThomas Wolf2017-09-042-11/+83
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | While parsing .gitmodules, the name of the submodule subsection is purely arbitrary: it frequently is the path of the submodule, but there's no requirement for it to be. By building a map of paths to the section name in .gitmodules, we can more accurately return the submodule URL. Bug: 508801 Change-Id: I8399ccada1834d4cc5d023344b97dcf8d5869b16 Also-by: Doug Kelly <dougk.ff7@gmail.com> Signed-off-by: Doug Kelly <dougk.ff7@gmail.com> Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Upgrade Maven compiler pluginsDavid Pursehouse2017-09-021-4/+4
| | | | | | | | | | | | | | | | | | - error_prone_core to 2.1.1 - maven-compiler-plugin to 3.6.2 - plexus-compiler-javac{-error-prone} to 2.8.2 Change-Id: I20d864c869f2d03f623ea054b6d08e7ee0eb262a Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Upgrade args4j to 2.33 in the bazel buildDavid Pursehouse2017-09-011-2/+2
| | | | | | | | Change-Id: Ic440657e3da53b643f79fbcdde45d4e659bc166d
* | Add org.apache.commons.codec 1.9.0 to target platformMatthias Sohn2017-09-015-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | This is needed to run tests in org.eclipse.jgit.http.test from Eclipse. The change 7ac1bfc8 which added this dependency to org.eclipse.jgit.http.test was already merged. Restrict dependency to org.apache.commons.codec to the version range [1.6.0,2.0.0). CQ: 14048 Change-Id: I461a5f6bfc114757061d68992f9bc7ab38622328 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge "Fix some tests for running in bazel"David Pursehouse2017-08-313-7/+13
|\ \
| * | Fix some tests for running in bazelThomas Wolf2017-08-313-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests call out to external cgit. Those tests all failed for me locally on Mac. Turned out that the reason was that the system git config used by the git in the bazel run contained paths with ~/ but somehow $HOME was not set. As a result the external git returned with exit code 128. Fix this by passing along $HOME explicitly. Also improve assertions to make sure we do get the stderr of the external command in the test log. I hadn't noticed that until now because apparently the maven build does pass along $HOME. Change-Id: I7069676d5cc7b23a71e79a4866fe8acab5a405f4 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | Merge "Update args4j to 2.33"David Pursehouse2017-08-3114-45/+28
|\ \ \
| * | | Update args4j to 2.33Matthias Sohn2017-08-3014-45/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | CQ: 11068 Change-Id: I7d52cddacff05477f646fda5f7b9f2de844922f6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | FsckPackParser: Fix warning about int being boxed to IntegerDavid Pursehouse2017-09-011-1/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I525164090e3990ce353bbb1627aaafaad2c903b6 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | FsckPackParser: Fix "Empty block should be documented" warningsDavid Pursehouse2017-08-311-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add "Do nothing" comments, consistent with other empty methods in the same class. Change-Id: I27a13a402e94104af617be0e14d8982e75fa73bd Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | FsckPackParser: Fix warnings about variable hidingDavid Pursehouse2017-08-311-9/+9
| | | | | | | | | | | | | | | | | | | | Change-Id: Id1ada1cedfad5671e79df303c6dbcb6017b777ce Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | Silence API errors caused by adding enum constants in 1baf86d4d2David Pursehouse2017-08-311-0/+12
| |/ / |/| | | | | | | | | | | Change-Id: I23338c04567f95aedd909ab310e01277e8f7db69 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | Add dependency to jsch for OpenSshConfigTest to bazel buildThomas Wolf2017-08-312-1/+8
| |/ |/| | | | | | | | | Make jsch visible to the test bundle and add the dependency. Change-Id: I0c49ee9b8f64fe8a8c74d2f08865917eb33069b4 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | Merge changes from topic 'dfs-reftable'Shawn Pearce2017-08-308-64/+456
|\ \ | | | | | | | | | | | | | | | | | | * changes: dfs: helper to open multiple reftables dfs: expose DfsReftable from DfsObjDatabase dfs: support reading reftables through DfsBlockCache
| * | dfs: helper to open multiple reftablesShawn Pearce2017-08-281-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | ReftableStack maintains multiple open reftables in an AutoCloseable format, making it easier for higher level code to handle multiple files. Change-Id: I7ac35c18e67b7e771fb3de29169d1ee50fab62ca
| * | dfs: expose DfsReftable from DfsObjDatabaseShawn Pearce2017-08-283-47/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | Reftable storage in DFS is related to pack storage. Reftables are stored in the same namespace, but with PackExt.REFTABLE. Include the set of DfsReftable instances in the PackList and export some helpers to access the tables. Change-Id: I6a4f5f953ed6b0ff80a7780f4c6cbcc5eda0da3e
| * | dfs: support reading reftables through DfsBlockCacheShawn Pearce2017-08-285-17/+199
| | | | | | | | | | | | | | | | | | | | | | | | DfsBlockCache directly shares its internal byte[] with ReftableReader, avoding copying between the DfsBlockCache and the BlockReader instances used by ReftableReader. Change-Id: Icaa4f40052b26f952681414653a8b5314b7c2c23
* | | Merge changes from topic 'fsck'Shawn Pearce2017-08-302-51/+71
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | * changes: DfsFsck: reduce memory usage during verifyIndex DfsFsck: refactor pack verify into its own method DfsFsck: run connectivity check pass exactly once
| * | DfsFsck: reduce memory usage during verifyIndexShawn Pearce2017-08-302-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't convert a lot of ObjectId to String stored in generic java.util.HashSet. This is a very expensive way to store objects. Instead rely on "this" from the FsckPackParser to lookup information about the objects in this pack file, which lets the verify code avoid sorting the object list. Use ObjectIdOwnerMap, which is the most efficient format JGit has for storing lots of objects. Change-Id: Ib68f93acb4d91b96d0a44c0612f704500d332ac1
| * | DfsFsck: refactor pack verify into its own methodShawn Pearce2017-08-301-30/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies the logic about allocation of the DfsReader, and clarifies the code considerably by using smaller scopes with less indentation. A few static imports from PackExt and slightly shorter variable names make for a more understandable-at-glance implementation. Change-Id: Iaf5a0e14fe0349215d9e44446f68d1129ad3bb3d
| * | DfsFsck: run connectivity check pass exactly onceShawn Pearce2017-08-291-19/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The simpler algorithm is to load all branch tips into an ObjectWalk and run that walk exactly once. This avoids redoing work related to parsing and considering trees reused across side branches. Move the connectivity check into its own helper method. This moves it left one level of identation, and makes it easier to fit the method's logic with less line wrapping. Add a "Counting objects..." progress monitor around this phase. Its what is used when a server receives a push and is also trying to verify the client sent all required objects. Change-Id: I4d53d75d0cdd1a13fff7d513a6ae0b2d14ea4090
* | | Fix compilation errors with args4j 2.0.23 and laterRobin Stocker2017-08-3011-18/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The multiValued attribute on @Option was removed. When the field is a List, it's not actually needed (even with earlier versions of args4j), see RmTest. In other cases, we have a custom handler, where it's also not needed. Bug: 413163 Change-Id: I4bb951e9fab5f4ae4271bd7e11be799dc234ab80
* | | Cleanup: Remove redundant type argumentsMatthias Sohn2017-08-301-1/+1
| | | | | | | | | | | | Change-Id: I81ce2e25666f5acfce4d3ada6b71ae8c81a97a4d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Cleanup: Remove unnecessary $NON-NLS$ tagsMatthias Sohn2017-08-301-1/+1
| | | | | | | | | | | | Change-Id: I143c9d62b89322509123d4e06a221dd4dc158c55 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Cleanup: Organize importsMatthias Sohn2017-08-3010-23/+23
| | | | | | | | | | | | Change-Id: I6065e59519bc42bd18f5cc5ee3ec5210764ab03c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Partially revert c0ad77d8 "Enhance Eclipse save actions"Matthias Sohn2017-08-3017-17/+17
|/ / | | | | | | | | | | | | | | Do not automatically organize imports using a save action since this seems to be buggy and removed some annotations org.eclipse.jgit.pgm needs to use args4j. Change-Id: I5a91292c3b9241ce2dde3e4ecce14ad460097129 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Cleanup: Remove trailing whitespaceMatthias Sohn2017-08-306-11/+11
| | | | | | | | Change-Id: I7c08b60fb6afafd1874210320da3da7519632e08 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Partially revert c0ad77d8 "Enhance Eclipse save actions"Matthias Sohn2017-08-3017-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert the following save actions which were introduced in c0ad77d8: - always use braces around blocks - remove unused imports Other than I expected save actions are run globally on edited files - and not only on edited code lines only. Hence revert the save action "Convert control statement bodies to blocks" which would affect a large number of code lines not affected by the change editing some small part of a class. This would generate a large number of changes which may lead to many unnecessary conflicts. Total number of affected lines across jgit would be around 10k lines. Also revert "Remove unused imports" since it erroneously removes imports of some annotations needed by pgm classes using args4j. Change-Id: I879a47f68e664129e6124cf25c1ae1f6a2d7a5aa Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Pass along the original exception when an ssh connection failsThomas Wolf2017-08-291-4/+7
|/ | | | | | | | | Otherwise, the stack trace doesn't really tell anything. See for instance [1]. [1] https://www.eclipse.org/forums/index.php/t/1088535/ Change-Id: If22f2c63c36fec6b32818d2c2acecf20531b4185 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Merge "reftable: explicitly store update_index per ref"Shawn Pearce2017-08-2810-39/+134
|\
| * reftable: explicitly store update_index per refShawn Pearce2017-08-2110-39/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an update_index to every reference in a reftable, storing the exact transaction that last modified the reference. This is necessary to fix some merge race conditions. Consider updates at T1, T3 are present in two reftables. Compacting these will create a table with range [T1,T3]. If T2 arrives during or after the compaction its impossible for readers to know how to merge the [T1,T3] table with the T2 table. With an explicit update_index per reference, MergedReftable is able to individually sort each reference, merging individual entries at T3 from [T1,T3] ahead of identically named entries appearing in T2. Change-Id: Ie4065d4176a5a0207dcab9696ae05d086e042140
* | Merge "Enhance Eclipse save actions"David Pursehouse2017-08-2817-119/+204
|\ \
| * | Enhance Eclipse save actionsMatthias Sohn2017-08-2817-119/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the following Eclipse save actions executed when saving modified lines. This should help to reduce manual work needed to maintain a clean and consistent code style: - organize imports - always use braces around blocks - add missing annotations - @Override including implementation of interface methods - @Deprecated - remove - unused imports - unnecessary $NON-NLS$ tags - redundant type arguments Also add default values for new settings that were introduced in recent Eclipse versions up to Neon since we updated save rules the last time. Change-Id: Idc90b249df044d0552f04edf01a5f607c4846f50 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge "Add BlobObjectChecker"Terry Parker2017-08-284-1/+221
|\ \ \
| * | | Add BlobObjectCheckerMasaya Suzuki2017-08-284-1/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some repositories can have a policy that do not accept certain blobs. To check if the incoming pack file contains such blobs, ObjectChecker can be used. However, this ObjectChecker is not called by PackParser if the blob is stored as a whole. This is because the object can be so large that it doesn't fit in memory. This change introduces BlobObjectChecker. This interface takes chunks of a blob instead of the entire object. ObjectChecker can optionally return a BlobObjectChecker. This won't change existing ObjectChecker implementation; existing implementation continues to receive deltified blob objects only. Change-Id: Ic33a92c2de42bd7a89786a4da26b7a648b25218d Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | | | FetchCommand: pass on CredentialsProvider to submodule fetchesThomas Wolf2017-08-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a JGit API command is implemented in terms of other API commands, the child command must "inherit" all relevant settings. Calling configure() ensures that the CredentialsProvider and the connection timeout are propagated correctly. Bug: 515325 Change-Id: I948e306693a9edb7b199a735877413b6eddcfba4 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | Exclude file matching: fix backtracking on match failures after **Thomas Wolf2017-08-274-1/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ** matching always tries the empty match first. If a mismatch occurs later, the ** must be extended by exactly one segment and matching must resume with the matcher following the ** matcher. Bug: 520920 Change-Id: Id019ad1c773bd645ae92e398021952f8e961f45c Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>