aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src/org
Commit message (Collapse)AuthorAgeFilesLines
* Delete deprecated TextBuiltin.outMatthias Sohn2015-06-031-10/+0
| | | | Change-Id: I184c2f0e0203fa95e0a117391bae93da0d23a435 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Replace deprecated release() methods by close()Matthias Sohn2015-05-2112-92/+60
| | | | | | | | See the discussion [1] in the Gerrit mailing list. [1] https://groups.google.com/forum/#!topic/repo-discuss/RRQT_xCqz4o Change-Id: I2c67384309c5c2e8511a7d0d4e088b4e95f819ff Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Expose disposeBody() on RevCommit and RevTagShawn Pearce2015-05-101-0/+1
| | | | | | | | | Applications that use a commit message once and do not need it again can free the body to save memory. Expose the disposeBody() methods to support this and use it in pgm.Log which only visits each commit once. Change-Id: I4142a0749c24f15386ee7fb119934a0432234de3
* Restore AwtCredentialsProvider to enable debugging pgm in EclipseMatthias Sohn2015-04-221-4/+46
| | | | | | | | | | | | In 6c1f7393882baf8464859136a70199ea96fcae0f the AWT based credentials provider was dropped because we don't support Java 5 any longer so we can always use the ConsoleCredentialsProvider which requires Java 6. This broke debugging org.eclipse.jgit.pgm since Eclipse doesn't support using a system console authenticator [1]. [1] see https://bugs.eclipse.org/bugs/show_bug.cgi?id=148831 Change-Id: Iba71001a7762e73d6579ba9dfa5a08ddaba777ea
* CLI status should support --untracked-filesKaloyan Raev2015-03-122-10/+137
| | | | | | | | | | | | | | | | | | A special options handler is added to properly handle the short -u alias of the option. The "normal" mode is not supported by this patch, because this mode of listing untracked files is not supported by the org.eclipse.jgit.lib.IndexDiff class. This mode is not necessary for my use case. It can be added later if anyone really needs it. The StatusTest is updated to cover all possible combinations of the --porcelain and --untracked-files options. Bug: 459319 Change-Id: I305ac95739cfed0c16735e0987844e57fa27e236 Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add "--long" option to JGit describeChristian Halstrick2015-03-091-0/+5
| | | | | | | | | | | Native git supports "git describe --long". This will enforce returning a long description of a commit even if a tag is directly pointing to the commit (in contrast to just returning the tag name as it is now). This commit teaches JGits DescribeCommand and the describe command in the pgm package to support "--long". Bug: 460991 Change-Id: I65e179b79e89049c6deced3c71cb3ebb08ed0a8f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Move console classes to pgm bundleMatthias Sohn2015-02-104-46/+297
| | | | | | | | | Since we updated minimum Java version to Java 7 the console bundle doesn't need to be a separate bundle anymore. Move the contained classes to the pgm bundle which is using these classes. Change-Id: If8e6f2d7405fdfe6f4b178673b4ccf99c67d4b64 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add option --orphan for checkoutRüdiger Herrmann2015-02-041-3/+6
| | | | | Change-Id: I546a93f3e147d8d6fc70094b22679c0d11cd8921 Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
* [pgm] Prevent commands from writing progress to System.errRüdiger Herrmann2015-01-136-6/+6
| | | | | | | | | Commands which report progress used to write to System.err. This is not desirable in cases where jgit.pgm is embedded. This change redirects progress output to the error stream that is configured by the command. Change-Id: I01fa5e167437e619448ac201fcb1cbf63bad96d7 Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [pgm] Add option --bare to clone commandMatthias Sohn2014-12-221-1/+4
| | | | Change-Id: I528491e3e20d3c9ebe37fe3cd2bf85b4644d8698 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [pgm] Implement clone using CloneCommandMatthias Sohn2014-12-222-120/+31
| | | | Change-Id: I56699b7bf9a71f673cb308d3015f51de5b06c1d9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [pgm] Add option --tags for ls-remoteMatthias Sohn2014-12-161-1/+4
| | | | | Bug: 444072 Change-Id: I52b470924609fc201e078d9d232aad257506728d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [pgm] Add option --heads for ls-remoteMatthias Sohn2014-12-161-1/+4
| | | | | | | | TODO: find a way to use option -h which is already captured by TextBuiltin's option --help which also uses the alias -h. Bug: 444072 Change-Id: Ie66584c2fc7fc224014a43cf928547703dd9d213 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [pgm] Use LsRemoteCommand to implement ls-remote and add a testMatthias Sohn2014-12-151-16/+18
| | | | Change-Id: Ic266f844c23e2519df5770ca56284b26e4cfe1f4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-3.5'Matthias Sohn2014-09-261-0/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.5: Prepare 3.5.1-SNAPSHOT builds JGit v3.5.0.201409260305-r Fix PackWriterBitmapWalker handling non-existing uninteresting objects Enable maven site generation for jgit Generate javadocs as part of Maven site project reports Compare API changes with clirr against 3.4.1 [cli] Use chaining credentials provider to enable .netrc Add chaining credentials provider [Java 8] Configure doclint to accept missing descriptions Do not use .netrc implicitly if no CredentialsProvider was set Prepare post 3.5.0-rc1 builds JGit 3.5.0.201409071800-rc1 Fix the ls-remote command when there is no local repo Change-Id: Iaa4485cac6ff9c7917380e89e12e416e0f52a557 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Fix the ls-remote command when there is no local repoRobin Rosenberg2014-09-071-0/+5
| | | | | | | | | | Bug: 436695 Change-Id: I567f9a8e355c7624efa3efc9bac4f3b9015afa97 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add "aggressive" option to GCChristian Halstrick2014-09-191-5/+8
|/ | | | | | | | | | | | | | | | | | | | JGit should offer the possibility to do a garbage collection in "aggressive" mode. In this mode garbage collection more aggressively optimize the repository at the expense of taking much more time. Technically a aggressive mode garbage collection differs from a non-aggressive one by: - not reusing packed objects found in old packs. Recompress every object - the configuration pack.window is set to 250 (the default is 10) - the configuration pack.depths is set to 250 (the default is 50) The associated classes in org.eclipse.jgit.api and the command line command in org.eclipse.jgit.pgm expose this new option. The configuration parameters gc.aggressiveDepth and gc.aggressiveWindow have been introduced to configure this feature. Bug: 444332 Change-Id: I024101f2810acf6be13ce144c9893d98f5c4ae76
* Rename local variables/parameters to remove warnings about hidingRobin Rosenberg2014-09-041-3/+3
| | | | Change-Id: I73f38492b6a2e7fd6e77005efd0a8a8c65763e74
* Handle -m option for Merge commandAxel Richard2014-08-301-1/+8
| | | | | | | | | Set the commit message to be used for the merge commit (in case one is created) Bug: 442886 Change-Id: Ie5ecc13822faa366f00b3daa07f74c8441cae195 Signed-off-by: Axel Richard <axel.richard@obeo.fr> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Handle diff formatting when there is nothing to compare withRobin Rosenberg2014-07-061-2/+3
| | | | | | | | DiffFormatter now suports either side being null and the log program will output the diff for the first commit. Bug: 395791 Change-Id: I378957b57e9ad1f7195ba416f402178453f0ebd3
* Merge "Command line: implement checkout -- <path>"Matthias Sohn2014-05-161-4/+17
|\
| * Command line: implement checkout -- <path>Matthias Sohn2014-05-121-4/+17
| | | | | | | | Change-Id: I3d261e6541fe0fcaa210587d2aa226e153071351 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | LsTree: quote paths in outputDave Borowitz2014-05-071-1/+2
|/ | | | Change-Id: Ic78d5b41e057fcd3282e97ac73ed506666f28f88
* Do not rewrite parents in RevWalkTextBuiltinsDave Borowitz2014-05-051-4/+8
| | | | | | | | Default behavior of C git is to skip parent rewriting unless particular history simplification or --parents flags are passed. Since JGit has no such flags, JGit should not rewrite parents. Change-Id: I9ba0e70fe6d5f49f975b71eea46f93198900f37d
* RevWalkTextBuiltin: Add -n to limit number of commits returnedDave Borowitz2014-05-051-1/+5
| | | | | | Implementing the -<#> flag from C git is less trivial. Change-Id: Idb55a303304a6d4055aaf37d0b4dcf92c684e25f
* Added groups support to repo subcommand.Yuxuan 'fishy' Wang2014-04-231-0/+4
| | | | | Change-Id: Id0e7663b6ac4f6938fdcacaf2158107b6285fc25 Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* Added the command line of jgit repo.Yuxuan 'fishy' Wang2014-04-231-0/+65
| | | | | Change-Id: Ib809b00c236a9c44422a872ae801b060f5b26808 Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* Merge "blame: Format commit and author only once per range"Shawn Pearce2014-04-231-13/+23
|\
| * blame: Format commit and author only once per rangeShawn Pearce2014-04-211-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | When a commit is blamed for multiple lines of the result file the command line interface prints the same text before each line in that span. Format these strings once and reuse them as the line prefix. For long files (e.g. 2425 lines of ReceiveCommits.java in Gerrit) this can save as much as 20ms during the output phase of the command line blame program. Change-Id: Ie42787d77c8d0cbca7ccbf59c795120494a2a891
* | pgm: Flush stderr during shutdownShawn Pearce2014-04-211-0/+2
|/ | | | | | | | If an error occurs in command line option parsing the error message may be stuck in a Java level buffer. Flush the stream to ensure everything is made available to the calling process or terminal. Change-Id: I55b16e43aa96fc81c1197121032f5cdd901d412c
* blame: Automatically increase commit abbreviation lengthShawn Pearce2014-04-171-3/+17
| | | | | | | | | Ensure commit object names are unique by extending the default abbreviation as long as necessary. This allows `jgit blame` to more closely match the formatted output of `git blame` on large histories like Gerrit Code Review's ReceiveCommits.java file. Change-Id: I5f7c4855769ee9dcba973389df9e109005dcdb5b
* Avoid calls to System.exit() and throw an exception insteadGuillaume Nodet2014-04-023-2/+37
| | | | | | | | The exception is caught in Main and System.exit() is called. Bug: 413522 Change-Id: Ibe68f7104d4fd55b832000a7840c07a169e7dd58 Signed-off-by: Guillaume Nodet <gnodet@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add an input stream and an error stream to TextBuiltin base classGuillaume Nodet2014-03-3010-52/+88
| | | | | | | | Leverage these streams to remove calls to System.in and System.err Bug: 413522 Change-Id: I8396f3e273c93e23861e8bcfb2ab8182fb09220d Signed-off-by: Guillaume Nodet <gnodet@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Implement "git branch --contains" in pgmRobin Stocker2014-03-071-17/+31
| | | | | | Bug: 425678 Change-Id: Ib59e05a0bde58562cc61e6e3000df761660b468e Signed-off-by: Robin Stocker <robin@nibor.org>
* Add missing @Deprecated to deprecated fields and methodsShawn Pearce2014-03-031-0/+1
| | | | | | | | Java spec requires the @Deprecated annotation on any deprecated field or method. Add the missing annotation to fields and methods already declared deprecated in the javadoc. Change-Id: Ic0ef24b43cfd99ac947e771ef5a28e493c304274
* CLI clone command should support --no-checkoutKaloyan Raev2014-02-261-9/+15
| | | | | | | | doCheckout() is called only if --no-checkout option is not set. Bug: 428917 Change-Id: I350bef446dd7a37613b9506aae99679569bd36e1 Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add symlink support to JGitRobin Rosenberg2014-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | The change includes comparing symbolic links between disk and index, adding symbolic links to the index, creating/modifying links on checkout. The behavior is controlled by the core.symlinks setting, just as C Git does. When a new repository is created core.symlinks will be set depending on the capabilities of the operating system and Java runtime. If core.symlinks is set to true, the assumption is that symlinks are supported, which may result in runtime errors if this turns out not to be the case. Measuring the cost of jgit status on a repository with ~70000 files, of which ~30000 are tracked reveals a penalty of about 10% for using the Java7 (really NIO2) support module. Bug: 354367 Change-Id: I12f0fdd9d26212324a586896ef7eb1f6ff89c39c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Tag som non-localizable strings with NON-NLSRobin Rosenberg2014-01-101-1/+1
| | | | Change-Id: I6882c98c2785f38241a81ba5b93892aab79690a5
* Suppport the GIT_CONFIG_NOSYSTEM environment variableRobin Rosenberg2014-01-061-1/+5
| | | | Change-Id: If3cc05931683d396b5ae2ea8952adceeb9a82ab9
* [CLI] Add option --millis / -m to debug-show-dir-cache commandMatthias Sohn2013-12-271-3/+12
| | | | | | | | | | | This is useful when comparing mtime displayed by $ jgit debug-show-dir-cache -m with mtime displayed by $ git ls-files --debug or $ stat "%m" Change-Id: Id133ebe6f6093a56a6a6645e1c5bb18752fb2fd0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* archive: Prepend a specified prefix to all entry filenamesJonathan Nieder2013-12-172-0/+5
| | | | | | | | | | Common practice when distributing tarballs is to prefix all entries with a single directory name so when the tarball is extracted it all falls neatly into a single directory. Add a setPrefix() method to ArchiveCommand to support this. Change-Id: I16b2832ef98c30977f6b77b646728b83d93c196f Signed-off-by: Jonathan Nieder <jrn@google.com>
* CLI status should support --porcelainKaloyan Raev2013-12-041-8/+117
| | | | | | | | Add support for the machine-readable output format along with the existing default long format. Bug: 419968 Change-Id: I37fe5121b4c9dbae1106b1d18e9fdc134070a9dd Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
* Manage CheckoutConflictException in pgmAxel Richard2013-11-292-0/+10
| | | | | Change-Id: I49f92bf7cafc80404f0bd07d62ff4b25e4db6e7c Signed-off-by: Axel Richard <axel.richard@obeo.fr> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* CLI fetch command should support --tagsKaloyan Raev2013-10-261-0/+14
| | | | | | | Bug: 419638 Change-Id: I1dc99fd38e678e091a1d141d741328f0dec1756a Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Merge "Add describe command to JGit command line interface"Robin Rosenberg2013-10-202-0/+76
|\
| * Add describe command to JGit command line interfaceMatthias Sohn2013-10-112-0/+76
| | | | | | | | Change-Id: I1560fd2be417361b3d2df15a27618053031bd873 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | CLI version command falls back to Bundle-VersionKaloyan Raev2013-10-121-3/+48
|/ | | | | | | | | | | If the version command cannot read the Implementation-Version of the containing JAR fall back to read the Bundle-Version header in MANIFEST.MF. This makes the command working also from the org.eclipse.jgit.pgm bundle and during development in a host IDE. Bug: 419087 Change-Id: I4269d1cbd9bf9fd8be6fb4463aecc1c434aa387b Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add support for --version in JGit CLIKaloyan Raev2013-10-091-1/+9
| | | | | Bug: 419000 Change-Id: I43f5267182ea69d1f9abbff33136e0491c629071 Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
* Propagate IOException where possible when getting refs.Colby Ranger2013-10-075-8/+22
| | | | | | | | | | Currently, Repository.getAllRefs() and Repository.getTags() silently ignores an IOException and instead returns an empty map. Repository is a public API and as such cannot be changed until the next major revision change. Where possible, update the internal jgit APIs to use the RefDatabase directly, since it propagates the error. Change-Id: I4e4537d8bd0fa772f388262684c5c4ca1929dc4c
* Add missing usage texts for JGit commandline commandsMatthias Sohn2013-09-0921-11/+43
| | | | | | | Also update help text for the merge command now supporting recursive strategy as the default merge strategy. Change-Id: I07886fe875c407e2244f562c003bb9d04f398026 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>