aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit
Commit message (Collapse)AuthorAgeFilesLines
* Read .gitmodules config from the tree in SubmoduleWalkDave Borowitz2012-06-152-7/+143
| | | | | | | | | | | | | It is not always appropriate to use the .gitmodules file from the working tree, for example if reading the modules at a specific commit. And sometimes it is impossible, as in a bare repository. When using the static factory methods, automatically set up the appropriate root tree so lazy loading of the config file reads from the appropriate place. Leave the current behavior of looking in the working tree as a fallback for the case where walking the index. Change-Id: I71b7ed3ba16c80b0adb8c5fd85b5c37fd4aef8eb
* Add a release() method to SubmoduleWalkDave Borowitz2012-06-151-12/+29
| | | | | | | | We need a way to release the underlying TreeWalk. Also, use this method to release walks from the static factory methods on error or when submodules are not found. Change-Id: I6bedc2db78bcd577aef2cfe6715bb981a26dcfd7
* Add "--squash" option to MergeCommandTomasz Zarna2012-06-1510-54/+334
| | | | | | | CQ: 6570 Bug: 351806 Change-Id: I5e47810376419264ecf4247b5a333af5c8945080 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Remove unused import of ObjectInserter in ResolveMergerTomasz Zarna2012-06-151-2/+1
| | | | Change-Id: I415894418f6fbe922c61294b21e15eee64e8a806
* Merge "Add Transport URI constructor without a repository"Shawn Pearce2012-06-155-0/+90
|\
| * Add Transport URI constructor without a repositoryIan Wetherbee2012-06-145-0/+90
| | | | | | | | | | | | | | Let a Transport instance be opened with only a URI, for use in the upcoming publish-subscribe feature. Change-Id: I391c60c10d034b5c1c0ef19b1f24a9ba76b17bb5
* | Merge "Fix UnionInputStream.read to be more Java-like"Shawn Pearce2012-06-151-13/+8
|\ \
| * | Fix UnionInputStream.read to be more Java-likeIan Wetherbee2012-06-141-13/+8
| |/ | | | | | | | | | | | | | | | | Relax the read() method to not block until exactly "len" bytes have been read. Instead, return when one or more bytes have been read, up to "len", so UnionInputStream more closely resembles InputStream's read() method. Change-Id: I3f632be8eb85a4a0baf27c9f067c8d817162de2b
* | Use only a single ObjectInserter in ResolveMergerShawn O. Pearce2012-06-141-5/+3
| | | | | | | | | | | | | | | | The base class supplies an ObjectInserter to its implementations by way of the getObjectInserter method. Tracking a second inserter instance doesn't match with the expected behavior. Change-Id: I78996bd06ef9028c8aa2e4e192ff647c43da847d
* | Define ObjectInserter.Filter to wrap another ObjectInserterShawn O. Pearce2012-06-141-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | Filter supports wrapping another ObjectInserter. By default all methods are delegated to the wrapped inserter. Implementors may override methods selectively for altered behavior. The instance that is wrapped may be determined dynamically by code, supporting lazy allocation of the delegate, or other patterns like object pooling. Change-Id: I7b2613d09e73f94e675bad33afbb693f6a7f3df6
* | Allow applications to pass ObjectInserter to MergerShawn O. Pearce2012-06-141-0/+19
|/ | | | | | | | | Gerrit Code Review needs to control which inserter is used by a Merger. Allow the application to set the inserter before calling merge, giving callers more direct control over how objects will be created. Change-Id: I3c527a493db4659e95289ff3077cffb9e32336cf
* Merge branch 'stable-2.0'Matthias Sohn2012-06-141-2/+0
|\ | | | | | | | | | | | | | | | | | | | | * stable-2.0: Prepare post v2.0.0.201206130900-r builds JGit v2.0.0.201206130900-r Add org.eclipse.jgit.pgm.feature to enable consumption via p2 Do not set core.autocrlf when creating repo Change-Id: Ifdd71a6bc14d9c79f4433ebc3b53bf0042a4d4c8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Do not set core.autocrlf when creating repoRobin Rosenberg2012-06-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | core.autorlf defaults to false, but can be set in the user or "system" config files. Note that EGit/JGit may not know where the "system" config file is located. Also fix pgm's ConfigTest which depends on default repository configuration. Bug: 382067 Change-Id: I2c698a76e30d968e7f351b4f5a2195f0b124f62f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Fix GitDateFormatter javadoc.Tomasz Zarna2012-06-141-1/+3
| | | | | | | | Change-Id: I627bdc387754a626ed8b1839494c05dfd5950d11 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge branch 'stable-2.0'Shawn O. Pearce2012-06-0728-138/+232
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By Robin Rosenberg (6) and others via Gerrit Code Review @ Eclipse.org (2) and Matthias Sohn (1) * stable-2.0: Prepare next 2.0.0-SNAPSHOT builds JGit v2.0.0.201206060730-rc3 Remove Jetty p2 repository from Maven build Get rid of warnings about empty statments Removed unused parameters from private methods cleanup: Remove unused declarations Make FS OS X detection work for OpenJDK Use working tree iterator to compare file modes Further cleanup of exceptions in Git API Update build to use Tycho 0.15.0 Throw formal CheckoutConflictException on hard reset Configure maven-source-plugin execution in parent POM Support gitdir: refs in BaseRepositoryBuilder.findGitDir Relax RevisionSyntaxException to an IllegalArgumentException Change-Id: I05727693e0c9e762d4fc220ceadcd5a5bfb11d0d
| * Merge "Use working tree iterator to compare file modes" into stable-2.0Christian Halstrick2012-06-062-24/+41
| |\
| | * Use working tree iterator to compare file modesKevin Sawicki2012-06-052-24/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add isModeDifferent method to WorkingTreeIterator that compares mode with consideration of the core.filemode setting in the config. Bug: 379004 Change-Id: I07335300d787a69c3d1608242238991d5b5214ac Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
| * | Get rid of warnings about empty statmentsRobin Rosenberg2012-06-062-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | In HtttpAuthMethod there were comments, but not in a style that Eclipse recognizes. Change-Id: I64f55b27143f8badcefbb419d3951f2a26b87d5f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Removed unused parameters from private methodsRobin Rosenberg2012-06-062-8/+7
| | | | | | | | | | | | | | | Change-Id: I60bc03b9550ccd2350918e6328276ec9839748d5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | cleanup: Remove unused declarationsRobin Rosenberg2012-06-061-1/+0
| | | | | | | | | | | | Change-Id: I3b54cb9f73cb433c71a441a11ddc74cfecdaa1dc
| * | Make FS OS X detection work for OpenJDKRobin Rosenberg2012-06-062-5/+4
| |/ | | | | | | | | | | | | OpenJDK sets the os.name system.property to "Darwin", while Apple's version says "Mac OS X". Change-Id: If08f8e7b8ef94ec00023a3f78bbf502ebd9699fb
| * Further cleanup of exceptions in Git APIRobin Rosenberg2012-06-0517-65/+129
| | | | | | | | | | | | | | | | | | - Translate internal exceptions to corresponding API exception - Do not catch GitAPI exceptions internally to an internal exception. Just pass them to caller - Mention thrown exceptions in javadoc Change-Id: I9044cf86d2b0bcc8b63b7cc016e1bf0055a62053 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Throw formal CheckoutConflictException on hard resetKevin Sawicki2012-06-051-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | This will allow calling classes to have access to the conflicts that occurred during the attempted checkout. Even though setFailOnConflict(false) is called on the DirCacheCheckout a CheckoutConflictException can still be thrown if cleanup fails. Change-Id: Iea7ad3176a1b0e8606a643de8945e276718eb3ce Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Support gitdir: refs in BaseRepositoryBuilder.findGitDirKevin Sawicki2012-06-041-25/+32
| | | | | | | | | | | | | | | | | | | | This allows findGitDir to be used for repositories containing a .git file with a gitdir: ref to the repository's directory such as submodule repositories that point to a folder under the parent repository's .git/modules folder Change-Id: I2f1ec7215a2208aa90511c065cadc7e816522f62 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
| * Merge "Relax RevisionSyntaxException to an IllegalArgumentException" into ↵Christian Halstrick2012-06-041-2/+1
| |\ | | | | | | | | | stable-2.0
| | * Relax RevisionSyntaxException to an IllegalArgumentExceptionRobin Rosenberg2012-06-041-2/+1
| | | | | | | | | | | | Change-Id: Ide46eeb6cddcf3111f7c237ba8425a0854a90bfd
* | | Make DirCacheCheckout update timestamps in the index.Markus Duft2012-06-061-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | This updates the timestamp of files that are not touched during checkout. Otherwise the timestamp will always be zero, causing the IndexDiffFilter to always calculate the checksum of file contents. Change-Id: I18047f5725f22811bb4194ca1d3a3cac56074183
* | | Merge changes Iee9af8d5,I8e1674f0,If5a6fcc5,I3bb28e4dShawn O. Pearce2012-06-057-111/+604
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: Use BatchRefUpdate for tracking refs in FetchProcess Batch reference updates together for storage Expose ReceiveCommand.updateType to check for UPDATE_NONFASTFORWARD Reject non-fast-forwards earlier in BaseReceivePack
| * | | Use BatchRefUpdate for tracking refs in FetchProcessShawn O. Pearce2012-05-223-96/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there are a lot of references to modify, using BatchRefUpdate can save time if the underlying storage is able to combine these updates together. This should speed up initial clone or fetch into an empty repository, as some projects can have hundreds of release tags, or hundreds of branch heads. Change-Id: Iee9af8d5fa19080077d88357c18853540936e940
| * | | Batch reference updates together for storageShawn O. Pearce2012-05-224-8/+355
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clone, fetch and push can all update multiple references in a single command invocation. Rather than performing sequential iteration of each reference change inside of the application code, push this down into the reference database where the implementation can take advantage of the batch size and optimize itself. For the local filesystem implementation the obvious optimization is to write a packed-refs file when the repository is completely empty. The initial clone, fetch or push into the destination may have hundreds of new references. Writing all of these as loose files is not efficient. This optimization is not implemented in this commit and is left as an exercise for the reader to supply in a future commit to JGit. To make the API changes simple, define the BatchRefUpdate type and implementation using the existing sequential behavior. Change-Id: I8e1674f091e05e24e3ff56ccbc687a6d18a6a61e
| * | | Expose ReceiveCommand.updateType to check for UPDATE_NONFASTFORWARDShawn O. Pearce2012-05-222-5/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a command's type is UPDATE, JGit might not yet be sure if it is a fast-forward or not. Expose a utility method to compute the exact type by performing the merge base test, allowing the type to be switched to UPDATE_NONFASTFORWARD if old ObjectId is not contained in new ObjectId. BaseReceivePack already does this test when validating the incoming command list, so provide a package level backdoor to set the type and avoid needing to redo the merge test later. Change-Id: If5a6fcc50dc4d6f96e9bb0bb7bba15ebe8b86377
| * | | Reject non-fast-forwards earlier in BaseReceivePackShawn O. Pearce2012-05-221-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If BaseReceivePack has setAllowNonFastForwards(false) configured (such as by receive.denynonfastforwards), automatically reject any command that attempts a non-fast-forward update before it goes further in processing. This matches with other checks in validateCommands(), such as the early failure of delete attempts when isAllowDeletes() is false. Change-Id: I3bb28e4dd6d17cb31ede09eb84ceb67cdb17ea5d
* | | | fix PackWriter excluded objects handlingChristian Halstrick2012-06-041-1/+2
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PackWriter supports excluding objects from being written to the pack. You may specify a PackIndex which lists all those objects which should not go into the new pack. This feature was broken because not all commits have been checked whether they should be excluded or not. For other object types the exclude algorithm worked. This commit adds the missing check. Change-Id: Id0047098393641ccba784c58b8325175c22fcece Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge "Only increment mod count if packed-refs file changes" into stable-2.0Shawn Pearce2012-06-041-10/+20
|\ \ \
| * | | Only increment mod count if packed-refs file changesKevin Sawicki2012-05-281-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously if a packed-refs file was racily clean then there was a 2.5 second window in which each call to getPackedRefs would increment the mod count causing a RefsChangedEvent to be fired since the FileSnapshot would report the file as modified. If a RefsChangedListener called getRef/getRefs from the onRefsChanged method then a StackOverflowError could occur since the stack could be exhausted before the 2.5 second window expired and the packed-refs file would no longer report being modified. Now a SHA-1 is computed of the packed-refs file and the mod count is only incremented when the packed refs are successfully set and the id of the new packed-refs file does not match the id of the old packed-refs file. Change-Id: I8cab6e5929479ed748812b8598c7628370e79697
* | | | Add lazy loading of body for tags to PlotWalkStefan Lay2012-06-041-0/+5
| |_|/ |/| | | | | | | | | | | | | | | | | This change is required by egit's lazy loading of the body in the history view when the walk is started with setRetainBody(false). Change-Id: I9291ba8c34c8744bc009b1bd302ed28bfa4e9476 Signed-off-by: Stefan Lay <stefan.lay@sap.com>
* | | Remove obsolete GitlinksNotSupportedExceptionRobin Rosenberg2012-05-311-65/+0
| | | | | | | | | | | | Change-Id: Idddd86818858b229e68b4a46597fc67547bcce17
* | | Update ORIG_HEAD when resettingKevin Sawicki2012-05-313-2/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Write the old object id from the RefUpdate to the ORIG_HEAD file after the update completes. Add two new convenience methods to Repository to read and write the ORIG_HEAD reference similar to the methods for reading/writing CHERRY_PICK_HEAD and MERGE_HEAD. Bug: 375525 Change-Id: I120b3b2cd3b1ddae88fce435285bae15cbf96f5e
* | | Git API does not declare GitAPIException call() and related cleanupsRobin Rosenberg2012-05-3042-136/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All commands should throw a GitAPIException so new exceptions can be added without breaking the builds of old code, i.e. anyone that calls a Git API should catch GitAPIException and not just the currently known exceptions. Now the only checked exceptions on Git API calls are GitException and subclasses of it. New checked exceptions that are subclasses of GitException may be added without breaking the API. Javadoc for GitAPIException is declared on GitCommand and inherited to subclasses. JGitInternalException is not explicitly documented anymore. Unfortunately this change itself breaks the API. The intention is that it shall be possible to add new checked subclasses of GitAPIException without breaking the API. Bug: 366914 EGit-Change-Id: I50380f13fc82c22d0036f47c7859cc3a77e767c5 Change-Id: I50380f13fc82c22d0036f47c7859cc3a77e767c5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge "Retain file length and mod time when doing a mixed reset" into stable-2.0Robin Rosenberg2012-05-301-6/+43
|\ \ \
| * | | Retain file length and mod time when doing a mixed resetKevin Sawicki2012-05-281-6/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the index was cleared and updated with a new tree. Now the commit being reset to and the index are iterated over in a tree walk and the current index mod time and file length are copied over to the new dir cache entry being written if the object ids are the same. Change-Id: Iaf9e624efb0bf90f9e05fcb0587dde4dec50000c
* | | | Merge "Update smudged entries when writing index" into stable-2.0Robin Rosenberg2012-05-302-3/+102
|\| | |
| * | | Update smudged entries when writing indexKevin Sawicki2012-05-282-3/+102
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overload DirCache.lock to take a repository that is used for updating smudged index entries with information from the repository's working tree. New unit tests are also added for updating smudged index entries on reset, checkout, and commit. Change-Id: I88689f26000e4e57e77931e5ace7c804d92af1b6
* / / Enable loading history until a given commitMatthias Sohn2012-05-301-0/+66
|/ / | | | | | | | | | | | | This is needed to allow jumping to a selected commit when loading history incrementally. Change-Id: Id3b97d88d3b4b2d67561b11f8810cb88fe040823 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* / Ensure resetting on commit idDariusz Luksza2012-05-231-1/+1
|/ | | | | | | | | When reset command was called with tag name as parameter the resulting HEAD was set to the tag's SHA-1 which is a bug. This patch ensures that repository.resolve() call always returns commit id. Change-Id: I219b898c620a75c497c8652dbf4735fd094c4d7c Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Smudge index entries on first write (too), as well when readingRobin Rosenberg2012-05-213-18/+44
| | | | | | | | | | | That happens when the index and a new file is created within the same second and becomes a problem if we then modify the newly created file within the same second after adding it to the index. Without smudging JGit will, on later reads, think the file is unchanged. The accompanying test passed with the smuding on read. Change-Id: I4dfecf5c93993ef690e7f0dddb3f3e6125daae15
* Don't swallow JSchException "Auth fail" exceptionDariusz Luksza2012-05-161-1/+2
| | | | | | | | | "Auth fail" exception was swallowed during retrying, this leads to "Session down" exception during clone operation with invalid SSH keys. Bug: 336795 Change-Id: Id8d9e83b10f4f2a01e0cf89819190bb23a04a2b9 Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
* Enable call chaining on LsRemoteCommand methodsDave Borowitz2012-05-141-4/+10
| | | | Change-Id: I706332386415892d7a964b241442832ad79fa223
* Factor a base class out of ReceivePackDave Borowitz2012-05-146-1132/+1322
| | | | | | | | | | | | We are working on a publish/subscribe based git protocol, and we want to reuse several parts of the ReceivePack-like code for reading commands and processing a pack. In this new implementation, the connection management will be very different, in particular, there may be multiple packs received on a single open connection. So, hoist out as much as we can from ReceivePack, mostly just leaving behind the single-connection version in that class. Change-Id: I5567aad6ae77951f73f59c1f91996d934ea88334
* Cleanup MergeResult constructorsTomasz Zarna2012-05-101-6/+8
| | | | | | | | 'mergeStrategy' should be 5th argument, after 'mergeStatus'. Pass 'description' if available. Change-Id: I97cebfe5d7db6247fe899075d917b82955906f85 Signed-off-by: Chris Aniszczyk <zx@twitter.com>