aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
Commit message (Collapse)AuthorAgeFilesLines
* Fix minor spelling error in commentRobin Rosenberg2014-08-191-1/+1
| | | | Change-Id: I320b5cd526827844d4fe0cbc0f32551010e98090
* Support remote aliases in repo manifest.Yuxuan 'fishy' Wang2014-08-181-2/+5
| | | | | Change-Id: Icbe5761b9d8a4ae5305bfe45b2d042f214156fc8 Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* Support non-default remotes in project tag.Yuxuan 'fishy' Wang2014-08-181-9/+23
| | | | | Change-Id: I3c730a1ce379d142d3ed81dda4a73f86f1f9c3eb Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* Add toString to Git with repository pathRobin Stocker2014-08-171-0/+4
| | | | | | | Useful for debugging. Change-Id: I78b92ccbcc099370fc99a1d2fa2cf60d5f5892e6 Signed-off-by: Robin Stocker <robin@nibor.org>
* ResolveMerger: Use the ObjectReader to access objectsShawn Pearce2014-08-152-7/+8
| | | | | | | | This is necessary to ensure objects accessed by the TreeWalk come from the associated ObjectInserter when the merger is a RecursiveMerger instance and a virtual common base was constructed but not flushed. Change-Id: Iebe739d30fd868ebc4f61dbfb714673146a2c3ec
* Cleanup use of java.util.Inflater, fixing rare infinite loopsShawn Pearce2014-08-146-81/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The native implementation of inflate() can set finished to return true at the same time as it copies the last bytes into the buffer. Check for finished on each iteration, terminating as soon as libz knows the stream was completely inflated. If not finished, it is likely input is required before the next native call could do any useful work. Most invocations are passing in a buffer large enough to store the entire result. A partial return from inflate() will need more input before it can continue. Checking right away that needsInput() is true saves a native call to determine no bytes can be inflated without more input. This should fix a rare infinite loop condition inside of inflation when an object ends exactly at the end of a block boundary, and the next block contains only the 20 byte trailing SHA-1. When the stream is finished each new attempt to inflate() returns n == 0, as no additional bytes were output. The needsInput() test tries to add the length of the footer block to itself, but then loops back around an reloads the same block as the block is smaller than a full block size. A zero length input is set to the inflater, which triggers needsInput() condition again. Change-Id: I95d02bfeab4bf995a254d49166b4ae62d1f21346
* Add missing @since 3.5 tag to RepoCommand.setIncludedFileReaderShawn Pearce2014-08-131-0/+1
| | | | Change-Id: Ib5d24f8dafacc0d12c36927c2bbc3ebef2fff7b2
* Add support to <include> tag in repo manifest xml.Yuxuan 'fishy' Wang2014-08-133-6/+77
| | | | | Change-Id: I32d468f92e24701ea680435bf3417e3850857303 Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* Merge "Tweak the handling of remote url in jgit repo."Shawn Pearce2014-08-131-11/+6
|\
| * Tweak the handling of remote url in jgit repo.Yuxuan 'fishy' Wang2014-08-131-11/+6
| | | | | | | | | | | | | | | | This kind of reverted 31148. URI.resolve actually can handle the absolute URL well, the problem is only the missing "/". Change-Id: Iee5866c005cbc1430dc20ee7db321b8b51afed30 Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* | Revert "Add a method to DfsOutputStream to read as an InputStream"Shawn Pearce2014-08-133-145/+39
| | | | | | | | | | | | | | | | | | | | | | This reverts commit b646578d89513c5db30151f0b865c7335c88d682. openInputStream() is never used in JGit, nor is it used by any known working DFS implementation. The method was added as a utility for reading back from a DfsInserter, but the final implementation of that feature does not requrire this method. Change-Id: I075ad95e40af49c92b554480f8993ef5658f7684
* | Add a Merger.merge method that makes flushing optionalDave Borowitz2014-08-131-2/+32
| | | | | | | | | | | | | | | | This allows callers performing multiple separate merges to reuse a single ObjectInserter without flushing the inserter on each iteration (which can be slow in the DFS case). Change-Id: Icaff7d2bc2c20c873ce5a7d9af5002da84ae1c2b
* | Teach mergers to use ObjectInserter.newReader()Dave Borowitz2014-08-131-17/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the RecursiveMerger to iteratively create new merge bases without necessarily flushing packs to storage in the DFS case; flushing only need happen at the end of the whole merge process. Since Merger's walk now depends on its inserter, we need to construct an inserter at Merger construction time. This should not be a significant increase in overhead since unused inserters don't use any resources (beyond a reference to the Repository). We also must release and recreate the walk whenever setObjectInserter is called, which can break usages where setObjectInserter is called in the middle of stateful operations on the walk. No usages of this method within JGit currently do this; the inserter is only ever set before any stateful walk operations happen. Change-Id: I9682a6aa4a2c37dccef8e163f132ddb791d79103
* | Add a method to ObjectInserter to read back inserted objectsDave Borowitz2014-08-136-2/+330
|/ | | | | | | | | | | | | | | | | | In the DFS implementation, flushing an inserter writes a new pack to the storage system and is potentially very slow, but was the only way to ensure previously-inserted objects were available. For some tasks, like performing a series of three-way merges, the total size of all inserted objects may be small enough to avoid flushing the in-memory buffered data. DfsOutputStream already provides a read method to read back from the not-yet-flushed data, so use this to provide an ObjectReader in the DFS case. In the file-backed case, objects are written out loosely on the fly, so the implementation can just return the existing WindowCursor. Change-Id: I454fdfb88f4d215e31b7da2b2a069853b197b3dd
* DfsInserter: buffer up to streamFileThreshold from InputStreamShawn Pearce2014-08-121-1/+15
| | | | | | | | | | | | | | Since 2badedcbe0f87c0a in-core merges can write up to 10 MiB into a TemporaryBuffer.Heap strategy, where the data is stored as a chain of byte[] blocks. Support the inserter reading up to the streamFileThreshold (default 50 MiB) from the supplied input stream and hash the content to determine if the merged result blob is already present in the repository. This allows the inserter to avoid creating duplicate objects in more cases, reducing repository pack file churn. Change-Id: I38967e2a0cff14c0a856cdb46a2c8fedbeb21ed5
* Merger: clarify getBaseCommit javadocDave Borowitz2014-08-111-2/+6
| | | | Change-Id: Ic52475248a545d51d3d8ac31a24f0344a1241e45
* Reuse Merger's ObjectReader from ResolveMergerDave Borowitz2014-08-111-26/+19
| | | | | | | | The base Merger class already has a single ObjectReader instance that it handles releasing as necessary, so creating new readers is not necessary. Change-Id: I990ec43af7df448c7825fc1b10e62eadaa3e0c2a
* Merge "Fix CheckoutCommand not setting up tracking"Robin Rosenberg2014-08-112-25/+22
|\
| * Fix CheckoutCommand not setting up trackingRobin Stocker2014-08-052-25/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of passing on the start point as is to CreateBranchCommand, the resolved ObjectId was used. Given this, CreateBranchCommand did not set up tracking. This also fixes CreateBranchCommand with setStartPoint(null) to use HEAD (instead of NPEing), as documented in the Javadoc. Bug: 441153 Change-Id: I5ed82b4a4b4a32a81a7fa2854636b921bcb3d471 Signed-off-by: Robin Stocker <robin@nibor.org>
* | Process most in-core merges without local temp filesShawn Pearce2014-08-081-62/+67
| | | | | | | | | | | | | | | | | | | | | | | | Instead of always writing to disk use TemporaryBuffer.LocalFile to store up to 10 MiB of merge result in RAM. Most source code will fit into this limit, avoiding local disk IO for simple merges. Larger files will automatically spool to a temporary file that can be cleaned up in the finally, reducing the risk of leaving them on disk and consuming space in /tmp. Change-Id: Ieccbd9b354d4dd3d2bc1304857325ae7a9f34ec6
* | ResolveMerger: push result file creation into updateIndex()Shawn Pearce2014-08-081-4/+3
| | | | | | | | | | | | | | | | | | The only caller of writeMergedFile is updateIndex, and the only user of this path object is the code within the method. This is a no-op change that opens the door to refactoring the way temp files are handled for inCore merges. Change-Id: I863a303194689a806b667e55eb958e1decf046c1
* | RecursiveMerger: do not insert virtual commits into repositoryShawn Pearce2014-08-081-14/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | When merging common ancestors to create a single virtual common ancestor the commit does not need to be inserted into the Git repository. Instead just mock it out in memory as part of the merger's RevWalk pool. Make the author and committer stable and predictable for any given pair of merge bases. It is not necessary for the caller's name or email to be used as the commit will not be written out. Change-Id: I88d5ee4de121950e1b032a5c10486c9d2c42656c
* | Fix non-relative remote defined in manifest xml.Yuxuan 'fishy' Wang2014-08-061-3/+10
|/ | | | | | | | | | | Currently if the remote defined in repo manifest xml is non-relative (e.g. "https://chromium.googlesource.com"), our code will break. This change fixed that. It also makes that remotes are ending with "/". Change-Id: Icef46360b32227a9db1d9bb9e6d929c72aeaa8df Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* Merge "Add isRebase to API of BranchConfig"Robin Rosenberg2014-08-031-3/+11
|\
| * Add isRebase to API of BranchConfigRobin Stocker2014-08-031-3/+11
| | | | | | | | | | Change-Id: I9819f49410e30d32c2157db0556a0dd6a0bcc5a4 Signed-off-by: Robin Stocker <robin@nibor.org>
* | Merge "Use bitcheck to check for presence of OPT_FULL option"Robin Rosenberg2014-08-031-6/+1
|\ \
| * | Use bitcheck to check for presence of OPT_FULL optionKevin Sawicki2014-08-021-6/+1
| |/ | | | | | | | | | | | | Previously an equality check was performed so an exception would be thrown if any other options were set. Change-Id: I36b60e2c0a8aef9fcfe663055dba520192996872
* / NetRC parser and credentials provider.Alexey Kuznetsov2014-08-033-0/+438
|/ | | | | | | | | Adds default git command line behaviour of reading credentials for https connections from .netrc file. Bug: 428229 Change-Id: I88699ca5da6a20bdeaed24b7e3899cc1022b8e7c Signed-off-by: Alexey Kuznetsov <axet@me.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Enhance BranchConfig API to expose branch.* optionsRobin Stocker2014-08-031-18/+47
| | | | | | | With these, more code can use BranchConfig instead of directly accessing the raw configuration values. Change-Id: I4b52f97ff0e3fc8f097512806f043c615a3d2594 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* IndexDiffFilter should never filter entries with stage!=0Christian Halstrick2014-08-021-1/+5
| | | | | | | | | | | If the IndexDiffFilter is asked whether it should include or filter out a certain path and for that path there is a dircache entry with a stage different from 0, then the filter should never filter out this entry. IndexDiffFilter is an optimized version of AnyDiffFilter and there is no case where the index contains non-0 stages but we still don't see any diff for that path. Change-Id: I25915880f304090fe90584c79bddf021231227a2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "HistogramDiff: Convert stack recursion to heap managed queue"Robin Rosenberg2014-08-021-6/+14
|\
| * HistogramDiff: Convert stack recursion to heap managed queueShawn Pearce2014-07-251-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each time the longest common substring is found the diff algorithm recurses to reprocess the regions before and after the common string. Large files with many edits can trigger StackOverflowError as the algorithm attempts to process a deeply split tree of regions. This is especially prone to happen in servers where the Java stack size may have been limited to 1M or even 256K. To keep edits produced in order a queue is used to process edits in a depth-first strategy. Change-Id: Iae7260c6934efdffac7c7bee4d3633a8208924f7
* | Fix Javadoc errors with Java 8Robin Stocker2014-08-023-11/+11
| | | | | | | | | | | | Bug: 440414 Change-Id: Icce87bd23a3698513b76246677f1d45ddbcaab47 Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Fix API errors raised on ResolveMerger affecting API providers onlyChristian Halstrick2014-07-313-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In change If45bc3d078b3d3de87b758e71d7379059d709603 a new parameter was added to 3 protected methods of ResolveMerger. This breaks the code of developers which have subclassed ResolveMerger. The API baseline check in Eclipse reports this as API breakage. Since this will break only providers but not consumers of the API this should be allowed also in minor versions. According to OSGi semantic versioning http://www.osgi.org/wiki/uploads/Links/SemanticVersioning.pdf breaking providers in a minor version update is ok. Therefore silence these errors using API filter rules. Bug: 440757 Change-Id: Icabbd0e1de7e877c66a5c4a2c8391473f992a1aa Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Implement RepoCommand.Project.hashCode() since we override equals()Matthias Sohn2014-07-301-0/+5
| | | | | | | | | | Bug: 440757 Change-Id: I16614c75b62b2fbef05419dd8667e3c50889abe4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Remove @Override annotation illegal for interfaces on Java 5Matthias Sohn2014-07-301-1/+0
| | | | | | | | | | Bug: 440757 Change-Id: I11897e8e680722313f28d9d241e23e92eddeb966 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Mark package org.eclipse.jgit.gitrepo.internal as x-internalMatthias Sohn2014-07-301-1/+1
| | | | | | | | | | | | | | | | It's an internal package which isn't part of the API. Mark it x-internal to silence @since tag warnings which are only raised for new API. Bug: 440757 Change-Id: Id05deaca43f135cd1bfe83cf1f29787cbbdbecac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Small performance optimization for ignore rules/fnmatcherAndrey Loskutov2014-07-302-8/+28
| | | | | | | | | | | | | | | | | | | | | | - don't check empty segments generated by String.split() - don't continue to add segments if the matcher fails to match input - don't add empty heads - don't iterate over empty heads. Bug: 440732 Change-Id: I7d04dccfe24d91275d17ba246662337d6dba66df Signed-off-by: Andrey Loskutov <loskutov@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Added toString() methods for better debugging of ignore rulesAndrey Loskutov2014-07-303-0/+15
| | | | | | | | | | Change-Id: Ie31687faa2df47ecaacace2504c3b4e93f1ea809 Signed-off-by: Andrey Loskutov <loskutov@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Fix RevertCommand to correctly revert multiple commits at once.Maik Schreiber2014-07-301-0/+1
| | | | | | | | | | | | | | | | The fix is to move the new head commit to the newly-created revert commit, so that additional revert commits will use the correct head. Change-Id: I5de3a9a2a4c276e60af732e9c507cbbdfd1a4652 Signed-off-by: Maik Schreiber <blizzy@blizzy.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge "Remove overlapping submodules from repo manifest."Shawn Pearce2014-07-291-9/+65
|\ \
| * | Remove overlapping submodules from repo manifest.Yuxuan 'fishy' Wang2014-07-291-9/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently repo allows projects overlapping, e.g. one project's path is "foo" and another project's path is "foo/bar". This is not supported in git submodule. At JGit repo side we'll skip all the submodules that are in subdirectories of other submodules, and on repo side we'll make them submodules to resolve this problem. Change-Id: I6820c4ef400c530a36150b1228706adfcc43ef64 Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* | | Merge "Added the missing export in MANIFEST.MF."Shawn Pearce2014-07-291-0/+1
|\ \ \ | |/ / |/| |
| * | Added the missing export in MANIFEST.MF.Yuxuan 'fishy' Wang2014-07-241-0/+1
| |/ | | | | | | | | | | | | This fixes bug 440352. Change-Id: I4b1c63087a97b7b2f3d7bdb5e066424a84ef6cef Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* | Merge "RecursiveMerger should not fail on content-merge conflicts of parents"Christian Halstrick2014-07-293-9/+51
|\ \
| * | RecursiveMerger should not fail on content-merge conflicts of parentsChristian Halstrick2014-07-283-9/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously when RecursiveMerger was trying to create a single virtual common base for the merge it was failing when this lead to content-merge conflicts. This is different from what native git is doing. When native git's recursive merge algorithm creates a new common base it will merge the multiple parents and simply take the merge result (potentially including conflict markers) as common base. See my discussion with Shawn here: http://www.spinics.net/lists/git/msg234959.html : > - How should workingtree, index (stage1,2,3) look like if during that > merge of common ancestors a conflict occurs? Will I see in stage2 and > stage3 really see content of X1 and X2? Its done entirely in memory and never touches the working tree or index. When a conflict exists in the X1-X2 merge the conflict is preserved into the new virtual base. There is still the possibility that the merge of parents lead to conflicts. File/Folder conclicts, conflicts on filemodes. This commit only fixes the situation for conflicts when merging content. Bug: 438203 Change-Id: If45bc3d078b3d3de87b758e71d7379059d709603
* | | Strip trailing /s in repo base URI.Yuxuan 'fishy' Wang2014-07-281-1/+7
|/ / | | | | | | | | Change-Id: I71040db2cca69638cfad89acdc9179ee80592b27 Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* | Fixed message for exception thrown during recursive mergeChristian Halstrick2014-07-283-4/+4
| | | | | | | | | | | | | | | | | | | | During recursive merge jgit potentially has to merge multiple common ancestors. If this fails because there are conflicts then the exception thrown for that should have a message which states this clearly. Previously a wrong message was given ("More than 200 merge bases ...") Change-Id: Ia3c058d5575decdefd50390ed83b63668d31c1d1
* | Fix RecursiveMerger's internal use of merge to find a merge baseChristian Halstrick2014-07-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When RecursiveMerger tried to determine a common base tree it was recursively tried to merge multiple common bases. But these intermediate merges which have just been done to determine a single common base for the final merge already filled some important fields (toBeCheckedOut, toBeDeleted, ...). These side effects of the intermediate merges led to wrong results of the final merge. One symptom was that after a recursive merge which should be succesful you could still see leftover files in the worktree: files which existed in the (virtual) common base but which don't exist anymore in the branches to be merged. The solution is easy: Clear the appropriate fields after common base determination and start the final merge with a clean state. Change-Id: I644ea9e1cb15360f7901bc0483cdb9286308c226 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | Handle initial checkout correctlyChristian Halstrick2014-07-251-4/+11
|/ | | | | | | | | | As described in native gits file "git-read-tree.txt" git has in a special mode when doing the "initial" checkout. "Initial" means that the index is empty before the checkout. This was not handled correctly in JGit and is fixed in this commit. Also see https://github.com/git/git/blob/master/Documentation/git-read-tree.txt#L181 Change-Id: I9b9d1bd9ebf349cfca420c891c7b099a18d07ba4