aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | Add internal porcelain-style API for ArchiveCommandJonathan Nieder2013-04-263-124/+287
| | | | | | | | | | | | | | 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
* / status: Print conflict description for unmerged pathsRobin Stocker2013-04-192-5/+55
|/ | | | | | | Prefix unmerged paths with conflict description (e.g. "both modified:"), the same way C Git does. Change-Id: I083cd191ae2ad3e2460aa4052774aed6e36c2699
* Remove some unnecessary dependencies on FileRepostoryRobin Rosenberg2013-04-181-6/+7
| | | | | Change-Id: Ib6ee3a2874a7e2240aa68f4ac32d00c4d1fab5ae Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Make recursive merge strategy the default merge strategyMatthias Sohn2013-04-151-1/+1
| | | | | | | | Use recursive merge as the default strategy since it can successfully merge more cases than the resolve strategy can. This is also the default in native Git. Change-Id: I38fd522edb2791f15d83e99038185edb09fed8e1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* clean up merge squash and no-commit messages in pgmTomasz Zarna2013-04-081-0/+1
| | | | Change-Id: Iffa6e8752fbd94f3ef69f49df772be82e3da5d05
* Detect and handle a checkout conflict during merge nicelyRobin Rosenberg2013-04-082-1/+15
| | | | | | Report the conflicting files nicely and inform the user. Change-Id: I75d464d4156d10c6cc6c7ce5a321e2c9fb0df375
* Add the no-commit option to MergeCommandTomasz Zarna2013-04-042-1/+9
| | | | | | | | | | Added also tests and the associated option for the command line Merge command. Bug: 335091 Change-Id: Ie321c572284a6f64765a81674089fc408a10d059 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Indicate initial commit on a branch in the reflogRobin Rosenberg2013-04-021-7/+1
| | | | | Bug: 393463 Change-Id: I4733d6f719bc0dc694e7a6a6ad2092de6364898c
* JGit 3.0: move internal classes into an internal subpackageShawn Pearce2013-03-187-18/+13
| | | | | | | | This breaks all existing callers once. Applications are not supposed to build against the internal storage API unless they can accept API churn and make necessary updates as versions change. Change-Id: I2ab1327c202ef2003565e1b0770a583970e432e9
* Break the dependency on RevObject when creating a newObjectToPack().Colby Ranger2013-03-041-1/+1
| | | | | | | | | | Update the ObjectReuseAsIs API to support creating new ObjectToPack with only the AnyObjectId and Git object type. This is needed to support the future pack index bitmaps, which only contain this information and do not want the overhead of creating a temporary object for every ObjectId. Change-Id: I906360b471412688bf429ecef74fd988f47875dc
* Add the --branch flag to the jgit clone commandRobin Rosenberg2013-02-162-2/+14
| | | | | | | --branch or -b allows the user to specify which branch to checkout after clone. Change-Id: Ie27533e5ecb43097862a8337a27a742b501e17a5
* Remove unused importsMatthias Sohn2013-02-141-4/+0
| | | | | | | These imports are unused since commit cb349da0174e77cc751e6cb8a16b327c4976b993 Change-Id: I74ea2a17bf4976d9c74255500e5deeff18208e87 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Remove unused availableRefs local from Clone.guessHEADJonathan Nieder2013-02-121-3/+0
| | | | | | | | This variable has been populated and never used ever since it was introduced in v0.4.9~336 (Add "jgit clone", 2008-12-23). Remove it to make the function easier to understand. Change-Id: Idb7eb80bc236a20f7385ad2d6141b4d1c5c3f1cc
* Delete the iplog generatorMatthias Sohn2013-01-093-221/+0
| | | | | | | | | | | It stopped working when we moved to the Eclipse foundation's Gerrit server since it doesn't use the Gerrit internal user store but LDAP. Instead, since 2.0, we use the Eclipse foundation's automatic IP log generator [1] to generate IP logs for releasing jgit and egit. [1] http://www.eclipse.org/projects/ip_log_selector.php Change-Id: I98dc65efb62909bc0258e6c680df0c93a57e9677 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* pgm: Attempt to detect a broken pipe and exit silentlyRobin Rosenberg2013-01-071-0/+12
| | | | | | | | | | | | | When piping output to another program, the other pipe may exit before we are done. An example is "jgit log|head". The result is that errno get set to EPIPE. Unfortunately Java does not have specific exception for this so we have to look at the exception message and hope that the number of variants are small. The detection here seem to work on Windows, Linux and OS X and it seems the message is usually not localized. Change-Id: Id6968ea7a53ae27ba5496303f1a479e41e41fdcc
* 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>