aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Commit message may not necessarily be in UTF-8"Shawn Pearce2012-12-041-2/+2
|\
| * Commit message may not necessarily be in UTF-8Robin Rosenberg2012-11-271-2/+2
| | | | | | | | | | | | | | Trying different encoding makes presentation nicer to user. Change-Id: I2d2c2a95d0b5cd709855d7a67cbc247478434d2f
* | Fix DeltaWindow.clear() to release loaded buffer bytes.Colby Ranger2012-12-031-1/+1
| | | | | | | | | | | | | | | | | | It is possible for the buffer to be set but not the index. It ocurrs when an exception occurs during creating an index, but after the buffer is loaded. Furthermore, the cleared DeltaWindowEntry should have been ent and not res. Change-Id: I2e0d79540316635bf7aa43efd225e4eb38230844
* | Enable reuse of FileTreeIterator and FileEntry for non subclassesRobin Stocker2012-12-031-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For EGit change I2c41d86b8b74c2a334433de1bbfed5b36af872bf, ContainerTreeIterator also needs to create entries for File objects in case of filtered resources. Instead of reimplementing FileEntry there, make the constructor public so that it can be reused. Also allow to pass a WorkingTreeIterator instead of a FileTreeIterator in FileTreeIterator's constructor, which is enough and allows to pass other subclasses. Bug: 358901 Change-Id: Ie0f9c9434ef7d73a8d73d4fe46db4147ded1d267 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | Merge "Support --cached in RmCommand"Chris Aniszczyk2012-12-032-13/+64
|\ \
| * | Support --cached in RmCommandRobin Stocker2012-12-032-13/+64
| | | | | | | | | | | | | | | | | | | | | | | | Also extend documentation and add examples. Bug: 395599 Change-Id: Id1ddbc9da787472f82e58834092bc073224b262b Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | | Add basic "jgit add" testsJonathan Nieder2012-11-292-0/+116
|/ / | | | | | | | | Change-Id: I056c2556c7db98bf57e2527dec11af7c3daf472a Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | add: Fix bad metaVar reference in <filepattern> helpJonathan Nieder2012-11-282-1/+2
| | | | | | | | | | | | | | | | | | | | Without this patch, "jgit add --help" throws two exceptions (NoSuchFieldException: metavar_filepattern; MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key metavar_filepattern) instead of printing a usage message, due to a small typo and a missing declaration. Change-Id: I4b848b3a8c7b1a49d8b9582809375daa4aca6b50
* | Merge "Do not warn about non-translated strings in the ant library"Chris Aniszczyk2012-11-251-1/+1
|\ \
| * | Do not warn about non-translated strings in the ant libraryRobin Rosenberg2012-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | Ant tasks are generally not translated, hence don't warn about untranslated strings Change-Id: I60920ccdaf3c0139979bb4ef19eb42036bb7e07f
* | | Merge "Do not warn about non-translated strings in the iplog generator"Chris Aniszczyk2012-11-251-1/+1
|\| |
| * | Do not warn about non-translated strings in the iplog generatorRobin Rosenberg2012-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | This module is used by very few people so translation is not a priority and hence we need no warnings about untranslated strings. Change-Id: I11be2e9903583d1a3dade7bf3d5eb77a30152b7c
* | | Merge "Do not warn about non-translated strings in the http library"Chris Aniszczyk2012-11-251-1/+1
|\| | | |/ |/|
| * Do not warn about non-translated strings in the http libraryRobin Rosenberg2012-11-251-1/+1
| | | | | | | | | | | | The strings here are for machine-to-machine communications. Change-Id: Ia0d19fce3d9843d18d329d9bc5b10d62c4125db8
* | Add a case statement for fast-forward mergeRobin Rosenberg2012-11-251-0/+1
|/ | | | | | | This case was ommitted. Treat the same as a non-fastworwad merge. Change-Id: Ia81e2430dfe04c3ce9b6e2f8fb4b6c646293a174
* RevWalk support for shallow clonesMarc Strapetz2012-11-2114-28/+318
| | | | | | | | | | | | StartGenerator now processes .git/shallow to have the RevWalk stop for shallow commits. See RevWalkShallowTest for tests. Bug: 394543 CQ: 6908 Change-Id: Ia5af1dab3fe9c7888f44eeecab1e1bcf2e8e48fe Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add support for rebase interactive 'edit' commandDariusz Luksza2012-11-192-7/+72
| | | | | | | | | | The 'edit' command allows you to change arbitrary commit content and the message of any commit in the repository. Bug: 394577 Change-Id: I43a44782cdb10b29f13784fa75ab37fe5d4da01b Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add support for rebase interactive 'reword' commandDariusz Luksza2012-11-192-7/+187
| | | | | | | | | | 'reword' command is used to change commit message of any commit in git history. Bug: 394575 Change-Id: Ic974e76dfd923fd6f0cb8f07d1a6fbecd9abbf31 Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add GarbageCollectCommand to porcelain APIMatthias Sohn2012-11-185-0/+253
| | | | | | | Bug: 394544 Change-Id: I73faa55d860db64efc3412fee27386df47552a75 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Have git-ls tree to accept path args like git-ls-treeKetan Padegaonkar2012-11-181-2/+14
| | | | | | | | | | Usage is: jgit ls-tree [-r|--recursive] <tree-ish> [-- paths...] Change-Id: I2e1c9c3cc8cddfa12ca4bfb9afc4df0492a9fce1 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add config constant for "mergeoptions"Tomasz Zarna2012-11-181-0/+3
| | | | | | Bug: 336933 Change-Id: Idcc0fbc8a8143dd665e80e4d6f4a4adaeae287db Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add "jgit archive" tool that writes a tree as a ZIP fileJonathan Nieder2012-11-165-0/+285
| | | | | | | | | | | | | | | | | | | | | | | C Git's "git archive" command represents a tree object using a standard archival format like tar, zip, or tgz, ready for consumption by other, git-unaware users or tools. Add a bare-bones analagous "jgit archive" command to show what is possible, supporting only ZIP format for now. It uses java.util.zip which is not aware of the InfoZIP extensions for representing symlinks and file permissions, so symlinks, executable files, and submodule entries are represented as plain text files. Making this functionality available from the library, improving handling of special entries, and support for other output formats are left for later patches. Ultimately the intent is to offer a TreeArchiveStream class for use by web frontends like Gitiles to offer "download as zip/tgz/txz" links and use by, for example, code search tools to get easy access to the content of git tree objects. Test with "jgit archive my-favorite-tree >out.zip". Change-Id: Ib590f173ceff3df4b58493cecccd6b9a1b355e3d
* Allow commandline tests to use raw outputJonathan Nieder2012-11-161-4/+11
| | | | | | | | | | | | | | | | | | | | | Introduce a new CLIGitCommand.rawExecute() helper that behaves just like execute() except that instead of processing its output it returns it raw. So now you can do final byte[] expect = { 0, 1, 2, 3 }; final byte[] actual = CLIGitCommand.rawExecute( "git show HEAD:goo.raw", db); assertArrayEquals(expect, actual); to test the output from "git show HEAD:goo.raw" without being distracted by encoding issues. Noticed while writing tests for a new "jgit archive" command that writes its output in ZIP format. Change-Id: I2fe6020a537975d0ccf414b7125d85d6cd86898c
* Add support for pull with --rebase and --no-rebaseMikael Karlsson2012-11-162-4/+118
| | | | | | Bug: 394501 Change-Id: I697e2fc82a46c03762111eb1de93e673a2643b4f Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Declare all thrown exceptions in RepositoryDani Megert2012-11-161-1/+3
| | | | | | | Bug 393155 Change-Id: If702f2e54b17e82890f016126ee7bde4bff4af1d Signed-off-by: Dani Megert <Daniel_Megert@ch.ibm.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Import non-java.* JRE packagesMatthias Sohn2012-11-161-0/+4
| | | | | | | | | | | Otherwise loading javax.net.ssl.TrustManager fails if osgi.compatibility.bootdelegation=false which became the Equinox default since bug 344850 was fixed. Bug: 392056 Change-Id: I464871723649095942dbf77da93890ac8ec39075 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Adapt Status and CleanCommand to support cleaning directoriesMarkus Duft2012-11-164-5/+207
| | | | | | | | | | | | | This adds the possibility to: * retrieve untracked directories from the status * instruct the CleanCommand to clean those directories. * retrieve ignored paths from the status * instruct the CleanCommand to leave those ignored paths alone Bug: 338717 Change-Id: Ibed0459005a5e306c010b9932f5b5fd107fb5448 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add reflog command to JGit CLITomasz Zarna2012-11-164-0/+170
| | | | | | Bug: 394497 Change-Id: Ib8bc1d9fd789d22fe5f10e03068a11cfdd3e46eb Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* CheckoutCommand: Support checking out ours and theirsRobin Stocker2012-11-162-45/+179
| | | | | | | | | | | The checkoutPaths body is split into two implementations, depending on whether we are checking out the index or a branch. This improves readability, as in the index case we now also need to have access to DirCacheIterator. Bug: 390147 Change-Id: I99fd599b25b2ace9bdd84535a56565286a3cb7f1 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Make an exception for the formatting rules (turn off) for some filesRobin Rosenberg2012-11-167-0/+7
| | | | | | | | | | Our rule to enforce javodocs for public members gives us a problem because there are some patterns where javadoc make little sense so we make the comments as small as possible, which our formatting rules do not like, so disable it for those source files. Change-Id: I6e3edb1e650ed45428b89cf41e6151b6536bca8a Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Harmonize the JDT settings within JGitRobin Rosenberg2012-11-1648-102/+1709
| | | | | | | | | | | Note the the settings are slightly less restrictive for test bundles. -Also cleanup a couple of malformed javadocs -Update compiler warnings/errors to include default values from Juno -We now flag diagnosed null dereference as error. We didn't do that earlier because of some false positives. Change-Id: I58386d63164e65d3d8d1998da3390d99bdc7381a Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* DirCacheEditor: Apply PathEdit for each stageRobin Stocker2012-11-162-5/+51
| | | | | | | | | | | | This behavior was defined in the Javadoc of PathEdit, but not actually implemented. It's necessary when one wants to use a PathEdit to check out a specific stage in apply. Bug: 390147 Change-Id: Iaed5cf60c554fc17e6c4d188caf4f0231da920d0 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add missing @since tags to mark API added in 2.2Matthias Sohn2012-11-167-4/+25
| | | | | | Change-Id: I458167739210214fa54c4b3d62fac5abc82f96f7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add support for --no-ff while mergingTomasz Zarna2012-11-168-16/+200
| | | | | | Bug: 394432 Change-Id: I373128c0ba949f9b24248874f77f3d68b50ccfd1 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add a test for org.eclipse.jgit.pgm.TagTomasz Zarna2012-11-157-2/+91
| | | | | | | | The test checks if an error is thrown when trying to create the same tag for the second time. Change-Id: I4ed2f6c997587f0ea23bd26a32fb64a2d48a980e Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Do not fail when checking out HEADTomasz Zarna2012-11-152-3/+22
| | | | | Change-Id: I99f5467477ed53101121a5a5d8a0910c55758401 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Prefix an abnormal CLI command termination with 'fatal:'Tomasz Zarna2012-11-155-6/+6
| | | | | Change-Id: I3d257666c6fbed7b238c575808f73ec518e811b9 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Merge "CommitCommand: Ensure unmerged paths are added correctly with setOnly"Chris Aniszczyk2012-11-152-23/+82
|\
| * CommitCommand: Ensure unmerged paths are added correctly with setOnlyRobin Stocker2012-11-122-23/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | With bug 391855, PathEdit will be changed to apply an edit for each stage. With that, CommitCommand would no longer work correctly when committing an unmerged path. This changes it to use a DirCacheBuilder which allows us to correctly replace the entries for the three stages with one, which is not possible with PathEdit. Bug: 391859 Change-Id: I6dc180aec7e2cbf8d1e91f50482c95bc420f79de
* | Merge "Fix formatting in org.eclipse.jgit.pgm.CLIText"Matthias Sohn2012-11-141-6/+2
|\ \
| * | Fix formatting in org.eclipse.jgit.pgm.CLITextTomasz Zarna2012-11-111-6/+2
| |/ | | | | | | Change-Id: Ia87f28fa440cb354bf591713c8aadbe3969edbf1
* / diff, log -p: do not use outs before it is initializedJonathan Nieder2012-11-142-4/+16
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit caa362f20df1 (Check for write errors in standard out and exit with error, 2012-09-14), running "jgit diff" results in a NullPointerException: | $ jgit diff | java.lang.NullPointerException | at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) | at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126) | at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:688) | at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:630) | at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:616) | at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:600) | at org.eclipse.jgit.pgm.Diff.run(Diff.java:211) | at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:166) | at org.eclipse.jgit.pgm.Main.execute(Main.java:200) | at org.eclipse.jgit.pgm.Main.run(Main.java:120) | at org.eclipse.jgit.pgm.Main.main(Main.java:94) That patch replaced most uses of System.out with a wrapper, with changes like the following: class Diff extends TextBuiltin { private final DiffFormatter diffFmt = new DiffFormatter( // - new BufferedOutputStream(System.out)); + new BufferedOutputStream(outs)); outs is not set for TextBuiltin objects until init() has been run. Moving the initialization to after the super.init() call gets "jgit diff" and "jgit log -p" working well again. Change-Id: I80fcf259c4fb733990bd16e52bcf94e66d820826
* Fix redundant null check warning in RepositoryRobin Stocker2012-11-081-1/+1
| | | | | | rev is always null because of `if (rev != null) return ...` above. Change-Id: I8168aefd344e0c4b0c68caea1a3daee66c07173b
* Merge "Add the an event and listener for a dfs PackIndex being loaded."Colby Ranger2012-11-023-0/+143
|\
| * Add the an event and listener for a dfs PackIndex being loaded.Colby Ranger2012-11-023-0/+143
| | | | | | | | | | | | | | The DfsPackFile will fire any static repository listeners on the event just before the PackIndex is loaded. Change-Id: Ie51098106bd5a1a32feae7d2dd068abf02b030ee
* | Add ReflogCommandTest#testAmendReflogTomasz Zarna2012-11-011-0/+32
| | | | | | | | | | | | | | | | Add a test for reflog with an amend commit and add assertions for branch comments Change-Id: Ie44076ff1abf1f8954b85d8c74ac6cb41ab789cb Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | ResetCommand: Use DirCacheBuilder in resetIndexRobin Stocker2012-11-012-13/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | With bug 391855, DirCacheEditor's PathEdit will be applied for each stage. For an unmerged path, this would result in 3 equal entries for the same path. By using a DirCacheBuilder, the code is simpler and does not have the above problem with unmerged paths. Bug: 391860 Change-Id: I785deeaeb8474f8c7a7fbc9ef00d3131fac87e41 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | ResetCommand: Correctly reset unmerged paths in resetIndexForPathsRobin Stocker2012-11-012-25/+44
|/ | | | | | | | | The previous implementation used a PathEdit, which does not reset the stage of the entry. Bug: 391860 Change-Id: If26d3a35abfee85424ad69de724f06a28b6e9efb Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Merge "Add isIndexLoaded() to DfsPackFile."Shawn Pearce2012-11-011-0/+6
|\
| * Add isIndexLoaded() to DfsPackFile.Colby Ranger2012-11-011-0/+6
| | | | | | | | | | | | | | The method reports whether the index file for the pack has been loaded and cached in memory. Change-Id: Ifa8d63f737458e102cb3d28579c9711d46693d17