summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src
Commit message (Collapse)AuthorAgeFilesLines
* Declare essentially static methods as staticRobin Rosenberg2012-12-276-8/+11
| | | | Change-Id: I83ca25fb569c0dbc36eb374d5437fcf2b65a6f68
* Mark non-externalizable strings as suchRobin Rosenberg2012-12-2731-146/+145
| | | | | | | | | | A few classes such as Constanrs are marked with @SuppressWarnings, as are toString() methods with many liternal, but otherwise $NLS-n$ is used for string containing text that should not be translated. A few literals may fall into the gray zone, but mostly I've tried to only tag the obvious ones. Change-Id: I22e50a77e2bf9e0b842a66bdf674e8fa1692f590
* Fix hidden field warningMatthias Sohn2012-12-121-3/+3
| | | | Change-Id: Ic52527c32f8167db3c7bb7fa0297c86fee21da27 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix empty control block warningsMatthias Sohn2012-12-121-7/+8
| | | | Change-Id: I7c546fa89f5e1933cff6648b2e03e07db61273e8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Cleanup unused import and Java 6 syntax in ArchiveRobin Rosenberg2012-12-121-5/+0
| | | | | | | @Override for implementation of interface is Java 6. JGit's execution environment is still Java 5. Change-Id: I48d10b3bf81a60938da86e026053b2f3d5e24ad3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* archive: Add tar supportJonathan Nieder2012-12-041-1/+37
| | | | | | | | Unlike ZIP files, tar files do not treat symlinks as ordinary files with a different mode, so tar support involves a little more code than would be ideal. Change-Id: Ica2568f4a0e443bf4b955ef0c029bc8eec62d369
* archive: Add --format option that switches between formatsJonathan Nieder2012-12-042-18/+62
| | | | | | | Prepare for .tar support. Change-Id: Ieb07702da1a54b41ae764fbb425f70826907b593 Improved-by: Shawn O. Pearce <spearce@spearce.org>
* archive: Record executable and symlink bitsJonathan Nieder2012-12-041-4/+10
| | | | | | | | | | | Setting the mode for a zip entry is now as simple as "entry.setUnixMode(mode)", so do that. The test checks using the system's "zipinfo" command (from InfoZIP) that the mode has been recorded correctly on systems that happen to have a "zipinfo" command, using org.junit.Assume to distinguish them. Change-Id: I4236c102fd76f18d01b2dc926eeb9b9fa11a61b7
* [RFC] archive: Switch to commons-compress as ZIP archiverJonathan Nieder2012-12-031-5/+6
| | | | | | | | | | | | | | | | | The Apache Commons Compress library provides a similar interface to java.util.zip with some features not found in java.util.zip, including support for inclusion of metadata (file mode and symlink targets) and support for multiple file formats (zip, .tar.xz, etc). Use it, in preparation for making use of these features. No functional change intended yet. A previous version of this patch used plexus-archiver. That is a heavier-weight dependency and offers a less convenient interface. Thanks to James Moger and Chris Aniszczyk for advice. Change-Id: Id01146950bb9c18dae0169311e3cde2c3bfa675e
* 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
* 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
* 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 "jgit archive" tool that writes a tree as a ZIP fileJonathan Nieder2012-11-162-0/+106
| | | | | | | | | | | | | | | | | | | | | | | 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
* Add reflog command to JGit CLITomasz Zarna2012-11-161-0/+88
| | | | | | Bug: 394497 Change-Id: Ib8bc1d9fd789d22fe5f10e03068a11cfdd3e46eb Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Make an exception for the formatting rules (turn off) for some filesRobin Rosenberg2012-11-161-0/+1
| | | | | | | | | | 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>
* Add missing @since tags to mark API added in 2.2Matthias Sohn2012-11-162-2/+11
| | | | | | 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-162-4/+58
| | | | | | Bug: 394432 Change-Id: I373128c0ba949f9b24248874f77f3d68b50ccfd1 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add a test for org.eclipse.jgit.pgm.TagTomasz Zarna2012-11-152-2/+9
| | | | | | | | 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-151-0/+2
| | | | | Change-Id: I99f5467477ed53101121a5a5d8a0910c55758401 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Prefix an abnormal CLI command termination with 'fatal:'Tomasz Zarna2012-11-151-1/+0
| | | | | Change-Id: I3d257666c6fbed7b238c575808f73ec518e811b9 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* 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
* Suppress resource warnings with Java 7Robin Rosenberg2012-10-251-0/+1
| | | | | | | | | | | For streams that should not be closed, i.e. don't own an underlying stream, and in-memory streams that do not need to be closed we just suppress the warning. This mostly apply to test cases. GC is enough. For streams with external resources (i.e. files) we add the necessary call to close(). Change-Id: I4d883ba2e7d07f199fe57ccb3459ece00441a570
* Add --squash option to org.eclipse.jgit.pgm.MergeTomasz Zarna2012-10-072-1/+11
| | | | Change-Id: Ifd20b6f4731cfa71319145cac7b464aa53db18b8
* Revert "The constructor CmdLineException(String) is deprecated"Shawn O. Pearce2012-09-265-35/+20
| | | | | | | | | | | | | | | | This reverts commit 07f99362575f324e466d7f5ae49d5f8f69cf7a8a. 07f9 seems to require a more recent args4j, but I cannot locate a CQ that verifies we can use a version more recent then 2.0.12. 2.0.16 has been released, but the Hudson CI instance at Eclipse won't build it. Since the commit fixes an issue identified in March but wasn't actually submitted to the tree until September, we can continue to ignore whatever the problem is/was until someone can attempt a more correctly working solution. Change-Id: I94fa432c219bda21c1126976bb60e5292760092e
* Remove uses of TextBuiltin.out in favor of outwRobin Rosenberg2012-09-233-14/+18
| | | | | | | These came from patches in review in parallel with the introduction of the exception throwing print writer. Change-Id: I1c27fa276eb1fcf12ad19792049c35cb52518c16
* The constructor CmdLineException(String) is deprecatedTomasz Zarna2012-09-235-20/+35
| | | | | | | | | | Use CmdLineException(CmdLineParser, String) instead. The new constructor has been added in args4j 2.0.12, so in pom.xml that would be the minimum version. Set the upper boundary in pom.xml to 2.1.0 (exclusive), just like in the MANIFEST.MF. Change-Id: If45d809e4ffa11a3572d958ce121422fb03cf8f3 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Suppress boxing warnings where we know they are okRobin Rosenberg2012-09-2211-26/+58
| | | | | | | | | Invoke the wrapper types' valueOf via static imports. For booleans used in asserts, add a new assert in the JUnit utility package since out current version of JUnit does not have the assert(boolean, boolean) method. Change-Id: I9099bd8efbc8c133479344d51ce7dabed8958a2b
* Add tests for output result of merging -- org.eclipse.jgit.pgm.MergeTomasz Zarna2012-09-172-0/+3
| | | | Change-Id: I888c7e80503b869d65a9617e6a07e01d1ff5f197
* Check for write errors in standard out and exit with errorRobin Rosenberg2012-09-1637-220/+261
| | | | | | | | | | | | | The underlying problem is that System.out is a PrintWriter and as such it does not throw exceptions on error, but rather just sets a flag and continues. This changes replaces the use of System.out with a PrintWriter-like writer that does not catch error, but instead throw them to the caller. Bug: 366243 Change-Id: I44405edc4416e943b87f09a0f6ed041c6c51b046
* Added new Status CLI command 'jgit status'Robin Rosenberg2012-09-092-2/+199
| | | | | | | | | | | | | This is a first basic implementation that displays current branch and list of files of various status, but isn't as refined as its native counterpart (e.g. does not say if we're ahead or behind the remote). It's been helpful in the diagnostic of bug #347885. Bug: 348318 CQ: 6769 Change-Id: Ifc35da608fbba652524c1b5b522e3c0d5369ad5e Signed-off-by: François Rey <eclipse.org@francois.rey.name> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Output result of switching branch -- o.e.jgit.pgm.CheckoutTomasz Zarna2012-09-052-2/+43
| | | | Change-Id: I9829950b686ce3b8c70b8f7a1774d5e2b55cd00a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix NPE when notes are presentRobin Rosenberg2012-09-051-1/+1
| | | | Change-Id: If9200ae4a7f582a5562aecf323ff0430ba154583 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Garbage collector for FileRepositoriesChristian Halstrick2012-07-291-0/+58
| | | | | | | | | | | | | | | | | | | | | Implements a garbage collector for FileRepositories. Main ideas are copied from the garbage collector for DFS based repos (DfsGarbageCollector). Added functionalities are - pruning loose objects - handling of the index - packing refs - handling of reflogs (objects referenced from reflog will not be pruned/) These are features of a GC which are not handled in this change and which should come with subsequent changes: - unpacking packed objects into loose objects (to support that pruning packed objects doesn't delete them until they are older than two weeks) - expiration of reflogs - support for configuration parameters (e.g. gc.pruneExpire) Change-Id: I14ea5cb7e0fd1b5c50b994fd77f4e05bfbb9d911 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* show: Implement command line show for any objectShawn O. Pearce2012-07-182-0/+317
| | | | | | Change-Id: I4dea84428d48b3de0e187c510b766f965323b21b Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Typo in CLIText#unknownMergeStratey, should be #unknownMergeStrategyTomasz Zarna2012-07-142-2/+2
| | | | | Change-Id: I4d4aa59723d6422ff755165e45f368da76d309ab Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Add config --list command to pgmTomasz Zarna2012-05-231-0/+121
| | | | | | | Currently, only --list option is supported with --global, --system, --local and --file switches. Change-Id: I9b179b162996520e95c4e001dccd65c566a4bd27 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add user friendly output from jgit commit commandMikael Karlsson2012-05-181-1/+6
| | | | | | | | Instead of printing the stack trace from the JGitInternalException thrown from CommitMessage.call(), print just the exception message, using the Die exception. Change-Id: I9ec3eb02eb001813fa15ac6f90a606223dcdafdc
* Add --all switch to org.eclipse.jgit.pgm.CommitTomasz Zarna2012-05-102-2/+9
| | | | | Change-Id: Iab52f995676daf60e0dfa043cc9e022f6e32a758 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Fix broken TagCommand APIRobin Rosenberg2012-04-061-4/+5
| | | | | | | | Tags can be un-annotated whereby there is no RevTag object, only a ref pointing to the tagged object. Bug: 360650 Change-Id: I06309c45c0a896fe2a0a874700febf78c9fb87e8
* cleanup: Get rid of some unused-warningsRobin Rosenberg2012-03-092-3/+3
| | | | Change-Id: Ia3e82682781c6b5bc3141b3e27db67b93c3162cd
* Merge "Allow to list tags with org.eclipse.jgit.pgm.Tag"Robin Rosenberg2012-01-251-7/+20
|\
| * Allow to list tags with org.eclipse.jgit.pgm.TagTomasz Zarna2011-12-021-7/+20
| | | | | | | | Change-Id: I79c284a720935814aef9767156106833f983bb8b
* | Allow to amend commits with JGit CLITomasz Zarna2011-12-181-0/+4
|/ | | | Change-Id: I0e8d365b56e079ac4ccece7fcf80ea140c319c78
* Make use of the many date formatting options in the log commandRobin Rosenberg2011-10-261-12/+14
| | | | Change-Id: I30f1049fce086f2cf7e39ba3ad8b335df3a7b827
* Add a method to SystemReader to get the time zoneRobin Rosenberg2011-10-201-1/+2
| | | | Change-Id: Ifd31f408ed2c5b7869694b715fea3219e74963ef
* Document the show methods of RevWalkTextBuiltinRobin Rosenberg2011-09-181-0/+22
| | | | | Change-Id: Ic704008cb215e1437c0a3fd1aec3aa38209ef3c7 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Fix a boxing warning in org.eclipse.jgit.pgm.RevWalkTextBuiltinRobin Rosenberg2011-09-181-2/+4
| | | | | Change-Id: Ia154da79926ce25731e856bed264dd19a76bc1f1 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Use the appropriate constant for ".git"Robin Rosenberg2011-08-272-2/+2
| | | | | | | | | | We have two constants with the same content. DOT_GIT is intended for the git repository below the work tree, while DOT_GIT_EXT is the ".git" directory extension usually associated with bare repositories. Change-Id: I0946b4beb2d1c3af289ddbbb5641d2f4e4c49d3f Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>