summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Support refspecs with wildcard in middle (not only at end)Robin Stocker2013-05-284-19/+214
| | | | | | | | | | | | | | | The following refspec, which can be used to fetch GitHub pull requests, is supported by C Git but was not yet by JGit: +refs/pull/*/head:refs/remotes/origin/pr/* The reason is that the wildcard in the source is in the middle. This change also includes more validation (e.g. "refs//heads" is not valid) and test cases. Bug: 405099 Change-Id: I9bcef7785a0762ed0a98ca95a0bdf8879d5702aa
* Fix multiple bugs in RawSubStringPattern used by MessageRevFilterRobin Stocker2013-05-282-5/+109
| | | | | | | | | | * Match at end of input was not handled correctly. * When more than one character matched but not all, the next character was not considered as a match start (e.g. pattern "abab" didn't match input "abaabab"). Bug: 409144 Change-Id: Ia44682c618bfbb927f5567c194227421d222a160 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Handle short branch/tag name for setBranch in CloneCommandRobin Stocker2013-05-262-10/+48
| | | | | | | | | | | | | | Before, it was not clear from the documentation what kind of branch name was accepted. Users specifying "branch" (instead of "refs/heads/branch") got no error message and ended up with a repository without HEAD and no checkout. With this, CloneCommand now tries "$branch", then "refs/heads/$branch" and then "refs/tags/$branch". C Git only does the last two, but for compatibility we should still allow "refs/heads/branch". Bug: 390994 Change-Id: I4be13144f2a21a6583e0942f0c7c40da32f2247a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add missing Bundle-Localization headerMatthias Sohn2013-05-261-0/+1
| | | | Change-Id: I6831ad417f069127b4705fdd909844ec72065527 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Apply tree filter marks when pairing DiffEntry for renamesRobin Stocker2013-05-241-0/+2
| | | | | | | | | | When using a RenameDetector to generate new DiffEntries after using DiffEntry.scan, the treeFilterMarks of the original entries were lost. Now it combines the marks from src and dst. See EGit bug 335082 where this is used. Change-Id: I72b34b10ca12e3a6bd10ce44f4fa05b193fc52cc
* Improve feature names to become understandable by end usersMatthias Sohn2013-05-216-6/+6
| | | | | | | | | This was requested in [1]. [1] http://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg08981.html Change-Id: I9764961a651c1fa64042098d60da9b496453f703 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Update kepler orbit version to R20130517111416Matthias Sohn2013-05-201-1/+1
| | | | Change-Id: I635aaa28230d571f4b6bf65485edaba1b1561fc2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix BatchRefUpdate progress-monitoring so it doesn't count twiceRoberto Tyley2013-05-192-10/+32
| | | | | | | | | | | | | | | I was seeing output like this while running The BFG: Updating references: 200% (374/187) ...issue sneaked in with 5cf53fda I think. The update call is also moved to the end of the loop, as update() is only supposed to be called after work has been done ("Denote that some work units have been completed"). Change-Id: I1620fa75be16dc80df44745d0e123ea512762e31 Signed-off-by: Robin Stocker <robin@nibor.org>
* Merge "Fix DiffFormatter NPEs for DiffEntry without content change" into ↵Matthias Sohn2013-05-162-2/+36
|\ | | | | | | stable-3.0
| * Fix DiffFormatter NPEs for DiffEntry without content changeRobin Stocker2013-05-152-2/+36
| | | | | | | | | | | | | | | | DiffEntry.getOldId() returns null for a diff without an index line (e.g. only mode changed, rename without content change). Bug: 407743 Change-Id: I42eac87421f2a53c985af260a253338f578492bc
* | Fix AnyObjectId's generic type declaration of ComparableRoberto Tyley2013-05-161-5/+1
|/ | | | | | | | | | | | | | | | | | | | | If you look at any implementation of Comparable in the JDK, you'll see that the type parameter for Comparable is supposed to be the type of the implementing class: http://docs.oracle.com/javase/6/docs/api/java/lang/Comparable.html The current type signature of Comparable<Object> is pretty awful, at the very least because you can not, in fact, successfully compare AnyObjectId with any random subclass of Object. It also causes problems with type-inference and the scala.math.Ordering trait in Scala. In order to compile, this change *does* require removing the AnyObjectId.ompareTo(Object) method - which actually only ever cast to AnyObjectId in any case. Nothing in the JGit test suite requires this method, but it might constitute a breaking API change, so it would be best if it can be added in time for JGit 3.0. Change-Id: I3b549a5519ccd6785f98e444da76d2363bcbe41a
* Fix CommitCommand not to destroy repoChristian Halstrick2013-05-112-60/+98
| | | | | | | | | | | | | | | | | | There was a severe bug in CommitCommand which could corrupt repos. When merging an annotated tag the JGit MergeCommand writes correctly the ID of the tag (and not the id of the commit the tag was pointing to) into MERGE_HEAD. Native git does the same. But CommitCommand was reading this file and trusting blindly that it will contain only IDs of commits. Then the CommitCommand created a commit which has as parent a non-commit object (the tag object). That's so corrupt that even native git gives up when you call "git log" in such a repo. To reproduce that with EGit simply right-click on a tag in the Repository View and select Merge. The result was a corrupt repo! Bug: 336291 Change-Id: I24cd5de19ce6ca7b68b4052c9e73dcc6d207b57c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix the parameters to an exceptionRobin Rosenberg2013-05-101-20/+18
| | | | | | | A parenthesis was in the wrong place passing arguments to the wrong format call. Also fix formatting of enclosing switch statement. Change-Id: I4cb9642f08b58c39033c3a81dab4bd56bebf4fd2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare post 3.0.0 M7 buildsMatthias Sohn2013-05-0846-58/+58
| | | | Change-Id: I062c44529c7ae2f960d3c64a0923a45d2dc8a863 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v3.0.0.201305080800-m7v3.0.0.201305080800-m7Matthias Sohn2013-05-0846-58/+58
| | | | | Change-Id: I377b174993862918a117f54e6cba4733dfc2307c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add missing @since tagsMatthias Sohn2013-05-065-1/+12
| | | | | Change-Id: I9657125765716c874bb6ecf8844c34749cb3b069 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Move org.eclipse.jgit.pgm's resource bundle to internal packageMatthias Sohn2013-05-0650-35/+50
| | | | | | | | Translatable texts aren't API and shouldn't require maintenance of @since tags to prevent API warnings. Change-Id: I228ff37f17c0e792a6bc188c463a0d19138e88ac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "URIish: Allow multiple slashes in paths"Shawn Pearce2013-05-052-4/+21
|\
| * URIish: Allow multiple slashes in pathsRobin Stocker2013-04-272-4/+21
| | | | | | | | | | | | It's also allowed by C Git. Change-Id: Ie0a0d1f57d84e70fd5ef50b7844d22fea43d0e08
* | Remove unused repository field from RevWalkDave Borowitz2013-05-052-10/+2
| | | | | | | | | | | | | | | | The comment about legacy Tag and Object types no longer applies, though prior to Idb273d5a92849b42935ac14eed73b796b80aad50 the field was still being used by RewriteTreeFilter. Change-Id: I9ee5da8f8a3b61c9cf543817c03117ee0609dd8f
* | Merge "Require a DiffConfig when creating a FollowFilter"Shawn Pearce2013-05-056-28/+47
|\ \
| * | Require a DiffConfig when creating a FollowFilterDave Borowitz2013-05-056-28/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The various rename detection options are an inherent part of the filter, similar to the path being followed. This fixes a potential NPE when a RevWalk with a FollowFilter is created without a Repository, since the old code path tried to get the DiffConfig from the RevWalk's possibly-missing repository. Change-Id: Idb273d5a92849b42935ac14eed73b796b80aad50
* | | Add optional feature to install Java 7 supportMatthias Sohn2013-05-0415-19/+481
| | | | | | | | | | | | | | | | | | Change-Id: I15cfd91857830d69abbe729be3e237fc9cd4fca0 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Extend the FS class for Java7Robin Rosenberg2013-05-0465-61/+3024
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The most important difference is that in Java7 we have symbolic links and for most operations in the work tree we want to operate on the link itself rather than the link target, which the old File methods generally do. We also add support for the hidden attribute, which only makes sense on Windows and exists, just since there are claims that Files.exists is faster the File.exists. A new bundle is only activated when run with a Java7 execution environment. It is implemented as a fragment. Tycho currently has no way to conditionally include optional features based on the java version used to run the build, this means with this change the jgit packaging build always needs to be run using java 7. Change-Id: I3d6580d6fa7b22f60d7e54ab236898ed44954ffd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Fix line endingsMatthias Sohn2013-05-035-335/+335
|/ / | | | | | | Change-Id: I61c9c173237a535da8576a9299bfd4bb29e8f56b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | TagCommand should be able to create unannotated tags tooRobin Rosenberg2013-05-034-45/+95
| | | | | | | | | | | | | | Using the low level API's is just too cumbersome. Change-Id: Id5b9f560ee095d6db0b2ea5b26aef3e53021626e Signed-off-by: Robin Stocker <robin@nibor.org>
* | Add test for RefUpdate delete without HEADRobin Stocker2013-05-031-1/+16
| | | | | | | | | | Bug: 406722 Change-Id: I555fb366ee64d885de2a71a67cf00833f4c62561
* | Merge "Fix warnings about assigning paramter in util.io"Robin Rosenberg2013-05-025-40/+43
|\ \
| * | Fix warnings about assigning paramter in util.ioRobin Stocker2013-05-015-40/+43
| | | | | | | | | | | | Change-Id: I08bed4275af9ec52aa4d7054067ac82f6a3c9781
* | | Update tags on fetch if --tags or tag refspec specifiedRobin Stocker2013-05-012-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When either --tags or a tag ref is explicitly specified on fetch, C Git updates existing local tags if they are different. Before this change, JGit returned REJECTED in such a case. Now it updates it and returns FORCED. Example: % mkdir a % cd a % git init -q % touch test.txt % git add test.txt % git commit -q -m 'Initial' % git tag v1 % cd .. % git clone -q a b % cd a % echo Test > test.txt % git commit -q -a -m 'Second' % git tag -f v1 Updated tag 'v1' (was bc85c08) % cd ../b % git fetch --tags - [tag update] v1 -> v1 Bug: 388095 Change-Id: I5d5494c2ad1a2cdb8e9e614d3de445289734edfe
* | | Only fetch tags that do not exist locally with auto-followRobin Stocker2013-05-012-27/+94
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This corresponds to what C Git does, quoting from the fetch man page: This is done by first fetching from the remote using the given <refspec>s, and if the repository has objects that are pointed by remote tags that it does not yet have, then fetch those missing tags. Before, JGit would also fetch tags that exist locally but point to a different object, resulting in REJECTED results for these. Also add some test cases to cover more cases. Bug: 388095 Change-Id: Ib03d2d82e9c4b60179d626cfd5174be1da6388b2 Also-by: Stefan Lay <stefan.lay@sap.com>
* | ArchiveCommand: Add missing @since tagJonathan Nieder2013-04-301-0/+2
| | | | | | | | Change-Id: I9e48a1f82b747492bebb3ca65fd16f599e425e8b
* | Abort before delete in FileUtils.delete EMPTY_DIRECTORIES_ONLY|RECURSIVERobin Stocker2013-04-292-2/+131
| | | | | | | | | | | | | | | | | | | | | | | | Depending on the order in which items are traversed for RECURSIVE, an empty directory may come first before detecting that there is a file and aborting. This fixes it by traversing files first. Bug: 405558 Change-Id: I638b7da58e33ffeb0fee172b96f4c823943d29e9 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge "Cleanup imports and javadocs in ArchiveCommand"Robin Rosenberg2013-04-271-3/+6
|\ \
| * | Cleanup imports and javadocs in ArchiveCommandRobin Rosenberg2013-04-271-3/+6
| | | | | | | | | | | | Change-Id: Icb1cd177e791cc646636a88c67fd9399dfc7030c
* | | Delete CLIText strings previously used in iplog generatorJonathan Nieder2013-04-272-6/+0
| | | | | | | | | | | | | | | | | | | | | The only callers using these strings were removed in commit 850e5bc24e31 (Delete the iplog generator, 2013-01-09). Change-Id: Ia4f81b29b8d00782ee559d69de3befc0a6c4d403
* | | Merge "Make the Reflog a public API again"Robin Rosenberg2013-04-2724-103/+273
|\ \ \
| * | | Make the Reflog a public API againRobin Rosenberg2013-04-2624-103/+273
| | | | | | | | | | | | | | | | Change-Id: I8ced7098da5b345fd9af2fdfafd1ef6a44ccee0d
* | | | Merge "Remove unused logger from RecursiveMerger"Robin Rosenberg2013-04-271-3/+0
|\ \ \ \
| * | | | Remove unused logger from RecursiveMergerJonathan Nieder2013-04-261-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JGit doesn't currently use java.util.logging.Logger. Remove this never-used Logger introduced in ab99b78ca08a (Implement recursive merge strategy, 2013-02-21) to make that easier to see. Change-Id: I92c578e7f3617085a667de7c992174057be3eb71
* | | | | Refer to getEntryPathLength in docs of getEntryPathBufferRobin Stocker2013-04-271-1/+8
| |_|_|/ |/| | | | | | | | | | | Change-Id: Icca41d80bd0791cd2d4bf03297795d161afbee70
* | | | Allow deletions to occur when there is no HEADAlex Blewitt2013-04-271-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the HEAD is not present in a repository, then there is a NullPointerException thrown in the delete code. Since this only exists to verify if the deletion is not the HEAD reference, then skip this check if the HEAD cannot be found. Bug: 406722 Change-Id: I882497202d986096513a4d791cd07fa935a3f9e4 Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
* | | ArchiveCommand: Do not warn for unsupported file modeJonathan Nieder2013-04-263-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When ArchiveCommand is invoked directly on the command line, these warnings to stderr warning: mode of path/to/some/submodule ignored are a useful hint, but in the more usual case where an archive is being served by a server, the intended audience for that message cannot see stderr. Later it might be useful to accept a callback to return these warnings out of band. Change-Id: I22e79be69859176d85594031d67c6cb3371c4bd2
* | | Add internal porcelain-style API for ArchiveCommandJonathan Nieder2013-04-264-124/+288
| | | | | | | | | | | | | | | | | | | | | One step closer to exposing archive creation functionality in a org.eclipse.jgit.archive bundle. Change-Id: If0ebb2417a941d9d3fc0d3f444316d0d1c494ff3
* | | Merge "archive: Release resources before returning"Shawn Pearce2013-04-261-18/+22
|\ \ \ | |/ / |/| |
| * | archive: Release resources before returningJonathan Nieder2013-04-261-18/+22
| | | | | | | | | | | | | | | | | | | | | | | | The only caller exits immediately after calling execute() so this shouldn't make a difference, but it's good practice and should make it easier to expose the functionality in a public API later. Change-Id: Ia6cd2ce8382f1a62e576409107fc5c9a6b321fb6
* | | Merge "status: Print conflict description for unmerged paths"Robin Rosenberg2013-04-255-9/+77
|\ \ \ | |/ / |/| |
| * | status: Print conflict description for unmerged pathsRobin Stocker2013-04-195-9/+77
| | | | | | | | | | | | | | | | | | | | | Prefix unmerged paths with conflict description (e.g. "both modified:"), the same way C Git does. Change-Id: I083cd191ae2ad3e2460aa4052774aed6e36c2699
* | | Document RevTag#getObject() that returned object is unparsedRobin Stocker2013-04-221-1/+9
| | | | | | | | | | | | Change-Id: I238d388e40362721eecf37f64ad7d48a399ff129
* | | Improve class documentation of TagCommandRobin Stocker2013-04-221-4/+13
| | | | | | | | | | | | Change-Id: I9c636b927fa2d7cfbe1eb5535a9e702b2209f51d