summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Fix concurrent creation of fan-out object directoriesRoberto Tyley2013-01-132-1/+78
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If multiple threads attempted to insert loose objects into the same new fan-out directory, the creation of that directory was subject to a race condition that could lead to an unnecessary IOException being thrown - because an inserter could not 'create' a directory that had just been generated by a different thread. All we require is that the directory does indeed *exist*, so not being able to _create_ it is not actually a fatal problem. Setting 'skipExisting' to 'true' on the call to mkdir() fixes the issue. I found this issue as a real world occurrence while working on The BFG Repo Cleaner (https://github.com/rtyley/bfg-repo-cleaner), a tool which concurrently performs a lot of object creation. In order to demonstrate the problem here I've added a small test case which reliably reproduces the issue on the few different hardware systems I've tried. The error thrown when the race-condition arises is this: java.io.IOException: Creating directory /home/roberto/repo.git/objects/e6 failed at org.eclipse.jgit.util.FileUtils.mkdir(FileUtils.java:182) at org.eclipse.jgit.storage.file.ObjectDirectory.insertUnpackedObject(ObjectDirectory.java:590) at org.eclipse.jgit.storage.file.ObjectDirectoryInserter.insertOneObject(ObjectDirectoryInserter.java:113) at org.eclipse.jgit.storage.file.ObjectDirectoryInserter.insert(ObjectDirectoryInserter.java:91) at org.eclipse.jgit.lib.ObjectInserter.insert(ObjectInserter.java:329) Change-Id: I88eac49bc600c56ba9ad290e6133d8a7113125ab
* | Accept '-' instead of space in enum config valuesShawn Pearce2013-01-112-1/+7
| | | | | | | | | | | | | | | | | | This is necessary because some versions of JGit containing the flawed c98abc9c0586c73ef7df4172644b7dd21c979e9d were used in the wild and wrote bad configuration files. We now must accept this value in addition to the preferred case. Change-Id: I3ed5451735658df6381532499130e5186805024a
* | Revert "Add additional FastForwardMode enums for different config contexts"Shawn Pearce2013-01-114-198/+4
| | | | | | | | | | | | This reverts commit c98abc9c0586c73ef7df4172644b7dd21c979e9d. Change-Id: I1d2a0de81eb17860ee36b6d3d3c00959b880fb85
* | Fix enum parsing from Config filesShawn Pearce2013-01-112-1/+4
| | | | | | | | Change-Id: Ib0b86ceab070d46903de7b55f2fd441714855141
* | Merge changes Ifc8fc3e5,I7c403b50Colby Ranger2013-01-1021-139/+156
|\ \ | | | | | | | | | | | | | | | * changes: Remove packIndex field from FileObjDatabase openPack method. Update DfsObjDatabase API to open/write by pack extension.
| * | Remove packIndex field from FileObjDatabase openPack method.Colby Ranger2013-01-1010-34/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the FileObjDatabase required both the pack file path and index file path to be passed to openPack(). A future change to add a bitmap index will add a .bitmap file parallel to the pack file (similar to the .idx file). Update the PackFile to support automatically loading pack index extensions based on the pack file path. Change-Id: Ifc8fc3e57f4afa177ba5a88df87334dbfa799f01
| * | Update DfsObjDatabase API to open/write by pack extension.Colby Ranger2013-01-1011-105/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the DfsObjDatabase had a hardcoded getPackFile() and getPackIndex() methods which opens a .pack and .idx file, respectively. A future change to add a bitmap index will need to be stored in a parallel .bitmap file. Update the DfsObjDatabase to support opening and writing of files for any pack extension. Change-Id: I7c403b501e242096a2d435f6865d6025a9f86108
* | | Peel tags during resolve of foo^Dave Borowitz2013-01-102-1/+3
|/ / | | | | | | | | | | | | | | | | Once we start talking about parents of tags, we are in the commit graph, so treat all objects from this point as commits. This fixes spurious IncorrectObjectTypeExceptions on resolving expressions like tag^^. Change-Id: I29ece1fdb49c9c5b9ca415efcd1876bc72e97120
* | Merge "Revert "Speed up PathFilterGroup.include for large set of paths""Robin Rosenberg2013-01-091-55/+15
|\ \
| * | Revert "Speed up PathFilterGroup.include for large set of paths"Robin Rosenberg2013-01-091-55/+15
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 576e5acdd054e2dcd8cde3fe4d822bc3609850c1 The comparator is broken. Change-Id: Ic59110b154613f3ff4a215a6c1293a4c15cd3885
* | | Delete the iplog generator, cont'dRobin Rosenberg2013-01-091-1/+0
| | | | | | | | | | | | Change-Id: I1f5e8dad3f61fde0d0573817d10e25a7384885d2
* | | Delete the iplog generatorMatthias Sohn2013-01-0943-3390/+0
| |/ |/| | | | | | | | | | | | | | | | | | | It stopped working when we moved to the Eclipse foundation's Gerrit server since it doesn't use the Gerrit internal user store but LDAP. Instead, since 2.0, we use the Eclipse foundation's automatic IP log generator [1] to generate IP logs for releasing jgit and egit. [1] http://www.eclipse.org/projects/ip_log_selector.php Change-Id: I98dc65efb62909bc0258e6c680df0c93a57e9677 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge "Consider that some Java version on Linux only return integral timestamps"Robin Rosenberg2013-01-081-1/+4
|\ \
| * | Consider that some Java version on Linux only return integral timestampsRobin Rosenberg2013-01-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | This logic is similar to what we do on Windows, but in this case it's Java that truncates the timestamps, not Git. Bug: 395410 Change-Id: Ie55dcb9fa583f5c3dd10d7a1b582e5b04b45858d
* | | Merge changes I3e9735c7,I76a16594Robin Rosenberg2013-01-082-27/+66
|\ \ \ | | |/ | |/| | | | | | | | | | * changes: Speed up PathFilterGroup.include for large set of paths Speed up handling of "only" paths in the CommitCommand
| * | Speed up PathFilterGroup.include for large set of pathsRobin Rosenberg2013-01-071-15/+55
| | | | | | | | | | | | | | | | | | | | | | | | This requires that we internally sort all paths so content of directories follow the directory immediately. Bug: 397185 Change-Id: I3e9735c7bdd99437929da8f9c9d4960a1273054b
| * | Speed up handling of "only" paths in the CommitCommandRobin Rosenberg2013-01-071-12/+11
| | | | | | | | | | | | | | | | | | | | | Use binary search to reduce the number of lookups for very large number of paths. Change-Id: I76a16594b756bffd95298897414485a9cd637819
* | | Return info about config subsection when trying to get an invalid enumTomasz Zarna2013-01-082-4/+25
| | | | | | | | | | | | Change-Id: Id4a72a68bdbd485619f4801683d38ad98f9841a2
* | | Merge "Add additional FastForwardMode enums for different config contexts"Robin Rosenberg2013-01-084-4/+198
|\ \ \
| * | | Add additional FastForwardMode enums for different config contextsTomasz Zarna2013-01-064-4/+198
| |/ / | | | | | | | | | | | | | | | | | | FastForwardMode should be represented by different enums depending on context it is set or get from. E.g. FastForwardMode.FF_ONLY for branch.<name>.mergeoptions is "--ff-only" but for merge.ff it is "only". Change-Id: I3ecc16d48e715b81320b73ffae4caf3558f965f2
* / / pgm: Attempt to detect a broken pipe and exit silentlyRobin Rosenberg2013-01-071-0/+12
|/ / | | | | | | | | | | | | | | | | | | | | | | | | When piping output to another program, the other pipe may exit before we are done. An example is "jgit log|head". The result is that errno get set to EPIPE. Unfortunately Java does not have specific exception for this so we have to look at the exception message and hope that the number of variants are small. The detection here seem to work on Windows, Linux and OS X and it seems the message is usually not localized. Change-Id: Id6968ea7a53ae27ba5496303f1a479e41e41fdcc
* | Merge "Do not install unnecessary Orbit bundles"Matthias Sohn2013-01-0515-480/+19
|\ \ | |/ |/|
| * Do not install unnecessary Orbit bundlesMatthias Sohn2013-01-0515-480/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | The org.eclipse.jgit.orbit.feature introduced recently in order to install 3rd party Orbit dependencies is a too coarse grained approach and has the effect to install some dependencies only needed for org.eclipse.jgit.pgm when installing org.eclipse.jgit.feature. Hence include the required 3rd party bundles into the respective jgit features directly in order to avoid this problem. Bug: 397356 Change-Id: I3a4a07de42808e787515a6865875d9513542d3f8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Ignore removed files with an assume-valid index entryRobin Rosenberg2013-01-032-8/+21
|/ | | | | | Bug: 347067 Change-Id: I5472e69dc77e26b5f248a4a04295775cf5051215 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Merge "Revert "Stop PathFilter after walking all matching paths""Robin Rosenberg2013-01-011-5/+1
|\
| * Revert "Stop PathFilter after walking all matching paths"Shawn Pearce2013-01-011-5/+1
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 75eb6a147ffa8089e48d409f0215a16c755305e7. Applications that want a PathFilter to abort the walk early should be using PathFilterGroup. When a PathFilterGroup is created with exactly one path its implementation is the same that 75eb6 tried to perform, but has been long documented as having the behavior of breaking a higher level OR filter graph node. Change-Id: I6c85d75c474784471c32e866eef3402b9f193c08
* | Update the revert command and things relating to revertRobin Rosenberg2012-12-288-8/+367
|/ | | | | | | | | | | | | | | | | Cherry-pick has been fixed, but even though revert does basically the same thing, the fixes were not carried over here. - Recognize the revert-states, analogous to the cherry picking states - Make reset handle a revert-in-progress - Update REVERT_HEAD and MERGE_MSG when revert fails due to conflicts - Clear revert state on commit and reset - Format the message similarily to how cherry-pick does. This is not exactly how C Git does it. The interface is still not the same as for cherry-picking. Change-Id: I8ea956fcbc9526d62a2365360feea23a9280eba3 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Stop PathFilter after walking all matching pathsDave Borowitz2012-12-271-1/+5
| | | | | | | | | | | After the current path of the TreeWalk is no longer a prefix of the PathFilter's path, there can be no more matching entries, but TreeWalk will happily keep walking the rest of a (potentially very large and recursive) tree unless StopWalkException is thrown. So, throw StopWalkException from PathFilter.include() at the earliest opportunity. Change-Id: If6c4f395a3d5ed5b71bf68de23be9f2b0620e7f1
* Do not enforce DeltaWindow maxMemory when zero.Colby Ranger2012-12-271-0/+3
| | | | | | | | The maxMemory for a DeltaWindow can be optionally disabled when it is less than or equal to zero. Respect this configuration when enforcing the limits on object load. Change-Id: Ic0f4ffcabf82105f8e690bd0eb5e6be485a313b3
* Merge "Enforce max memory for DeltaWindow."Colby Ranger2012-12-271-0/+24
|\
| * Enforce max memory for DeltaWindow.Colby Ranger2012-12-271-0/+24
| | | | | | | | | | | | | | | | | | | | | | Previously, memory limits were enforced at the start of each iteration of the delta search, based on objects that were currently loaded in memory. However, new objects added to the window may be expanded in a future iteration of the search and thus were not accounted for correctly at the start of the search. To fix this, memory limits are now enforced before each object is loaded. Change-Id: I898ab43e7bf5ee7189831f3a68bb9385ae694b8f
* | Make jgit diff obey core.autocrlfRobin Rosenberg2012-12-271-57/+1
| | | | | | | | Change-Id: I0a756943d95ee20f189c154b27cd2972a116f550
* | Hide deprecation warnings in some test classesRobin Rosenberg2012-12-274-0/+4
| | | | | | | | | | | | | | | | These test classes heavily rely on Tree and associated classes. They are convenient for building test cases and hence not yet replaced, but there is a deprecation warning at about every line, which is not helpful. Change-Id: Ia7cc8f3bb980dc03055b94748b6c7529a82ea5a5
* | Declare essentially static methods as staticRobin Rosenberg2012-12-2754-98/+116
| | | | | | | | Change-Id: I83ca25fb569c0dbc36eb374d5437fcf2b65a6f68
* | Add type argumente to some raw reclarationRobin Rosenberg2012-12-2713-33/+51
| | | | | | | | Change-Id: Ief195fb5c55f75172f0428fdac8c8874292ae566
* | Do not perform character translation on copies in patchesRobin Rosenberg2012-12-271-3/+8
| | | | | | | | | | | | | | Translation is unnecessary and risks damaging the file. Also ensure that we close the file if an I/O error occurs. Change-Id: Ieae6eb941fdeaa61f2611f4cd14dd39117aa12f9
* | Mark non-externalizable strings as suchRobin Rosenberg2012-12-27259-1329/+1404
|/ | | | | | | | | | A few classes such as Constanrs are marked with @SuppressWarnings, as are toString() methods with many liternal, but otherwise $NLS-n$ is used for string containing text that should not be translated. A few literals may fall into the gray zone, but mostly I've tried to only tag the obvious ones. Change-Id: I22e50a77e2bf9e0b842a66bdf674e8fa1692f590
* Add org.eclipse.jgit.pgm.Reset to commands catalogTomasz Zarna2012-12-221-0/+1
| | | | | Change-Id: I7acfd051a07be889b27cfcfc1f396d86a9f86ab2 Signed-off-by: Tomasz Zarna <tzarna@gmail.com>
* Prepare 2.3.0 buildsMatthias Sohn2012-12-2143-238/+238
| | | | | Change-Id: I0ca539e8cfe444f96c64dc56d1f0ef33b66e0cff Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-2.2'Matthias Sohn2012-12-211-1/+1
|\ | | | | | | | | | | | | | | * stable-2.2: Prepare post 2.2.0.201212191850-r builds JGit v2.2.0.201212191850-r Change-Id: Iebe7c45eacb8abee21d1900e27143ccaa2724e28 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Merge remote-tracking branch 'gerrit/stable-2.2'Robin Rosenberg2012-12-1615-13/+498
| |\ | | | | | | | | | | | | | | | | | | | | | | | | * gerrit/stable-2.2: Ensure that jgit p2 repository is self-contained Fix hidden field warning Fix empty control block warnings Change-Id: Ifa0751be7db9401081a1a5c28a0102a2d0c692f9
| * \ Merge branch 'stable-2.2'Robin Rosenberg2012-12-154-6/+150
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-2.2: DirCacheIterator: Fix reset() and back() Cleanup unused import and Java 6 syntax in Archive Change-Id: Icc59b28a4066c4781ea8d6270dfe20eb63b4185e
| * | | Disable response compression on /git-receive-pack URLsShawn Pearce2012-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compressing the response with gzip causes the stream to delay flushing until gzip has seen the entire response message, or buffers fill up and the compressed data has to be sent. This hides the resolving progress monitor from the client, as well as any other progress messages the server might be trying to send. Disable compression in receive, matching what /git-upload-pack has. Change-Id: Ic8d8abe1f43c3f540d1ee7c43a8947a555307d94
* | | | Prepare post 2.2.0.201212191850-r buildsstable-2.2Matthias Sohn2012-12-2143-53/+53
| | | | | | | | | | | | | | | | Change-Id: I1a0fe51c71551fcfc98f5dd435eb283fd661b77a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | JGit v2.2.0.201212191850-rv2.2.0.201212191850-rMatthias Sohn2012-12-2043-53/+53
| |_|/ |/| | | | | | | | | | | Change-Id: Idc49f17d03886b6a1e61a94ff81e32625c8675d9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Ensure that jgit p2 repository is self-containedMatthias Sohn2012-12-1614-3/+487
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new feature for the 3rd party dependencies jgit needs and include this in org.eclipse.jgit.feature. This ensures that the jgit p2 repository is self-contained and downstream consumers don't need to find the dependencies elsewhere. We don't add the jetty dependencies needed to install the test feature org.eclipse.jgit.junit since this is only used by egit tests. Change-Id: I60425c746cd50f1875ef8597a8bbefb598b8c982 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge "Fix hidden field warning" into stable-2.2Robin Rosenberg2012-12-151-3/+3
|\ \ \
| * | | Fix hidden field warningMatthias Sohn2012-12-121-3/+3
| | | | | | | | | | | | | | | | Change-Id: Ic52527c32f8167db3c7bb7fa0297c86fee21da27 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Merge "Fix empty control block warnings" into stable-2.2Robin Rosenberg2012-12-151-7/+8
|\| | | | |_|/ |/| |
| * | Fix empty control block warningsMatthias Sohn2012-12-121-7/+8
| | | | | | | | | | | | Change-Id: I7c546fa89f5e1933cff6648b2e03e07db61273e8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>