aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
Commit message (Collapse)AuthorAgeFilesLines
* Add isRebase to API of BranchConfigRobin Stocker2014-08-031-3/+11
| | | | | Change-Id: I9819f49410e30d32c2157db0556a0dd6a0bcc5a4 Signed-off-by: Robin Stocker <robin@nibor.org>
* 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
* Preserve merges during pull if configured to do soKonrad Kügler2014-07-152-23/+49
| | | | | | | | | | Setting branch.<name>.rebase or pull.rebase to 'preserve' will preserve merges during rebase. Also, pull.rebase is now consulted if there is no branch-specific configuration. Bug: 429664 Change-Id: I345fa295c7e774e0d0a8e6aba30fbfc3552e0084 Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
* Rebase: Add --preserve-merges supportKonrad Kügler2014-07-152-30/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With --preserve-merges C Git re-does merges using the rewritten merge parents, discarding the old merge commit. For the common use-case of pull with rebase this is unfortunate, as it loses the merge conflict resolution (and other fixes in the merge), which may have taken quite some time to get right in the first place. To overcome this we use a two-fold approach: If any of the (non-first) merge parents of a merge were rewritten, we also redo the merge, to include the (potential) new changes in those commits. If only the first parent was rewritten, i.e. we are merging a branch that is otherwise unaffected by the rebase, we instead cherry-pick the merge commit at hand. This is done with the --mainline 1 and --no-commit options to apply the changes introduced by the merge. Then we set up an appropriate MERGE_HEAD and commit the result, thus effectively forging a merge. Apart from the approach taken to rebase merge commits, this implementation closely follows C Git. As a result, both Git implementations can continue rebases of each other. Preserving merges works for both interactive and non-interactive rebase, but as in C Git it is easy do get undesired outcomes with interactive rebase. CommitCommand supports committing merges during rebase now. Bug: 439421 Change-Id: I4cf69b9d4ec6109d130ab8e3f42fcbdac25a13b2 Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
* Repository.writeMergeHeads to accept a list with subtypes of ObjectIdKonrad Kügler2014-07-141-2/+2
| | | | | | Allows to pass for example a List<RevCommit>. Change-Id: I5522707060d7d3e0d848ba579956dc62f8fa0234 Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
* Cherry-Pick: Support --no-commitKonrad Kügler2014-07-141-6/+27
| | | | Change-Id: Ic4c313a8971a5aa15745518c49e2587a1a0fe8d4 Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
* Handle diff formatting when there is nothing to compare withRobin Rosenberg2014-07-061-17/+43
| | | | | | | | DiffFormatter now suports either side being null and the log program will output the diff for the first commit. Bug: 395791 Change-Id: I378957b57e9ad1f7195ba416f402178453f0ebd3
* Don't warn for methods that can be staticRobin Rosenberg2014-07-021-1/+1
| | | | | | | | Making the methods static would gain little in performance, make the code harder to change. Removing unncessary warnings is more important. Change-Id: If3e6aa9c1d92e58b4e7a8e246cf4aace237d7a7b
* Add new default settings from Eclipse 4.4Robin Rosenberg2014-07-021-0/+5
| | | | | | | | These settings were added by Eclipse simply by touching the project settings. Adding these makes it simpler to see what local changes have been made. Change-Id: Iab0aa62530312eb0c78b03b5c6a632742bcc4978
* Clarify comments in message properties files (and fix grammar)Robin Stocker2014-06-301-1/+1
| | | | | | Bug: 438261 Change-Id: I7b98475886ef789ae7635d8c9e008fc1aa00d534 Signed-off-by: Robin Stocker <robin@nibor.org>
* Add a comment to the message properties files on how they are processedRobin Rosenberg2014-06-291-0/+3
| | | | Change-Id: I073f0c2c0729e6a5d3f1834203f0cfeb4c462eda
* Fix spelling error in error messgaeRobin Rosenberg2014-06-291-1/+1
| | | | Change-Id: I5f712ba290592f7c5aa9ee865ff30383ad315247
* Fix formatting errors in error messagesRobin Rosenberg2014-06-291-6/+6
| | | | | | | | | {} is plain wrong and is not accepted by MessageFormat, the other risk becoming wrong if another single quote is introduced in the future and sets a bad example. Bug: 438261 Change-Id: I2948ca90c10f6ec2574f7f2b9be0a72821ea4daf
* Merge branch 'stable-3.4'Matthias Sohn2014-06-215-11/+75
|\ | | | | | | | | | | | | | | | | | | * stable-3.4: Prepare 3.4.2-SNAPSHOT builds JGit v3.4.1.201406201815-r Allow retrying connecting SshSession in case of an exception Change-Id: I7efb009b9e012637a16c57e2e93e074023b8e46c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 3.4.2-SNAPSHOT buildsMatthias Sohn2014-06-213-36/+36
| | | | | | | | | | Change-Id: If88217d84b88cda6d04c159418d5bc86233fe28c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v3.4.1.201406201815-rv3.4.1.201406201815-rMatthias Sohn2014-06-213-36/+36
| | | | | | | | | | Change-Id: I4383a90fd91a243cd5ce5d0ae4e53874b36c1f47 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Allow retrying connecting SshSession in case of an exceptionStefan Lay2014-06-205-11/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Connecting to an SshSession may fail due to different reasons. Jsch for example often throws an com.jcraft.jsch.JschException: verify: false.[1] The issue is still not fixed in JSch 0.1.51. In such a case it is worth retrying to connect. The number of connection attempts can be configured using ssh_config parameter "ConnectionAttempts" [2]. Don't retry if the user canceled authentication. [1] http://sourceforge.net/p/jsch/bugs/58/ [2] http://linux.die.net/man/5/ssh_config Bug: 437656 Change-Id: I6dd2a3786b7d3f15f5a46821d8edac987a57e381 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare post 3.4.0 buildsMatthias Sohn2014-06-113-4/+4
| | | | | | | | Change-Id: I49f3741f3973b247a635f7c99b72309d2381a377 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v3.4.0.201406110918-rv3.4.0.201406110918-rMatthias Sohn2014-06-113-4/+4
| | | | | | | | | | Change-Id: I56543234316f04bff4e45628bcb8286a6e52e31f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Remove no longer needed API breakage filtersRobin Rosenberg2014-06-151-19/+0
| | | | | | | | Change-Id: I2ea2dec55c187b62662195bae810b3f0af8a2983
* | Remove an unnecessary semicolonRobin Rosenberg2014-06-151-1/+1
| | | | | | | | Change-Id: I6c5b085ae4a47d0026bd2b2341de76ab333936b9
* | Remove an unnecessary $NON-NLS$ commentRobin Rosenberg2014-06-151-1/+1
| | | | | | | | Change-Id: I8335464061dac1c20de2b698f834e516ef78cf3d
* | Merge "Enable NLS / TranslationBundle to be used in OSGi"Robin Rosenberg2014-06-151-6/+10
|\ \
| * | Enable NLS / TranslationBundle to be used in OSGiRüdiger Herrmann2014-06-011-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TranslationBundle#load() used to load resource bundles through ResourceBundle#getBundle() without explicitly specifying a class loader. In this case, the class laoder of the calling class (TranslationBundle here) is used. This approach fails in runtime environments like OSGi where there are multiple class loaders. This change enables loading resource bundles in multi class loaders environments. The fix is to pass the class loader of the TranslationBundle-derived class to ResourceBundle#getBundle(). Bug: 436232 Change-Id: I39db61e012dc93ebf388a71bf6088a3310a22bac Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
* | | Don't set REWRITE flag unless parent rewriting is requestedDave Borowitz2014-06-121-5/+7
| | | | | | | | | | | | Change-Id: I65e3702ceb6c8854a2c358cfc2c2e3a9fb9486ff
* | | Rename RewriteTreeFilter to TreeRevFilter and make it publicDave Borowitz2014-06-123-20/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current behavior of passing a TreeFilter to RevWalk has limited usefulness, since the RevFilter derived from the TreeFilter is always ANDed together with any other RevFilters. It is also tied fairly tightly to the parent rewriting mechanism. Make TreeRevFilter a generic RevFilter that matches modified paths against any TreeFilter. This allows for more complex logic like (modified this path OR authored by this person). Leave the rewrite flag logic in this class, since it's closely tied to the parent comparison code, but hidden behind a protected constructor. Change-Id: Ia72ef591a99415e6f340c5f64583a49c91f1b82f
* | | Add missing javadoc and since tag for RepoCommand.readFileFromRepo()Matthias Sohn2014-06-121-0/+14
| | | | | | | | | | | | Change-Id: Ib0a98ce633e83c82a58b633c767e70d316b7254c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Refactor DefaultRemoteReader for easier code reuseYuxuan 'fishy' Wang2014-06-101-1/+9
| | | | | | | | | | | | | | | Change-Id: I7f326b4fc96198de7b424e15d8329bde7d7b39cf Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* | | Merge "Fixed the problem with calling LsRemoteCommand without a local ↵Robin Rosenberg2014-06-104-1/+50
|\ \ \ | | | | | | | | | | | | repository over the ssh and git:// protocols."