summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* blame: Implement blame on the command lineShawn O. Pearce2011-08-132-0/+351
| | | | | | | | Command line options match the C implementation of `git blame` as closely as possible, making for a pretty complete tool. Change-Id: Ie1bd172ad9de586c3b60f0ee4a77a8f047364882 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Fix jgit rev-list --objects masterShawn O. Pearce2011-08-081-3/+5
| | | | | | | | | | This flag was not being honored due to a bug in createWalk(). argWalk is always non-null when there are commits passed in on the command line. If --objects was specified, always make a new ObjectWalk for the actual execution. Change-Id: I6e1a1636f2634605d86671a83766cc1c42939821 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Merge "Merge in JGit CLI is missing break statement"Chris Aniszczyk2011-07-121-0/+1
|\
| * Merge in JGit CLI is missing break statementTomasz Zarna2011-07-121-0/+1
| | | | | | | | | | Change-Id: I2095601b848e66e54d5dac828ef6ed1a4c5ae66c Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | RFC: Ugly fix for i18n of metaVar CLI argumentsRobin Rosenberg2011-06-202-0/+67
|/ | | | | | | | This patch possibly ties to a specific version of args4j. Bug: 318286 Change-Id: I05d4ecf6bd25deec7fb2efbfa61913f4ec4e04e5 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Added Merge command to the CLIChristian Halstrick2011-03-292-0/+130
| | | | | | | | | | This merge command accepts the merge strategy as option and uses the resolve strategy as default. It expects exactly one other revision which is merged with current head. Change-Id: Ia8c188b93ade4afabe6a9ccf267faf045f359a3a Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Registering the Checkout command and fixed a typo.Sasa Zivkov2011-03-241-1/+1
| | | | | | | | | The Checkout command line command was added to JGit but it wasn't registered in the list of available commands. Additionally, the 'force' option was named '---force' (triple '-'). Change-Id: I259773932fa9aec3bb29e215740e67c834566f6f Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
* PushCommand: Add utilities for --all, --tagsShawn O. Pearce2011-03-151-6/+6
| | | | | | | | | | | The --all flag on the command line implies using refs/heads/* as a push specification. Add this to the standard command object. The --tags flag on the command line implies using refs/tags/* as a push specification. Add this to the standard command object. Change-Id: Iaef200b17cce77604548dbfb15cf2499b10687b5 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Make --git-dir optional for 'jgit init'Philipp Thun2011-03-151-1/+2
| | | | | | | | | | | | For compatibility reasons with regards to native git and also to make the init command easier to use from the command line, argument --git-dir should not be required. Additionally the path created in case --git-dir is not supplied now is canonical and thus easier to read. Change-Id: Idb7d77e983a78c4b21fbf232fc1e75ef581e5ed1 Signed-off-by: Philipp Thun <philipp.thun@sap.com>
* Always fetch tags during cloneShawn O. Pearce2011-03-141-0/+2
| | | | | | | | | | C Git always fetches tags during clone, even if the tag doesn't point to an object that was fetched by the branch specifications. Match that behavior, as users expect it. Bug: 326611 Change-Id: I81a82b7359a9649f18a172219da44ed54e77ca2f Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Add -o option to commit commandPhilipp Thun2011-03-112-2/+18
| | | | | | | This change adds the --only/ -o option to the commit command. Change-Id: I44352d56877f8204d985cb7a35a2e0faffb7d341 Signed-off-by: Philipp Thun <philipp.thun@sap.com>
* Improve readability of timestamps shown by debug-show-dir-cacheMatthias Sohn2011-03-031-1/+1
| | | | | | | The old format is hard to read. Change-Id: I27f3a7dbd92b26256993d27d5223b743fef70902 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Enhance debug-show-dir-cache command to show stageMatthias Sohn2011-03-031-0/+4
| | | | | Change-Id: I6fb17ec7f04f8bfaf1253b2ff08200ef9fc51898 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* PackWriter: Avoid CRC-32 validation when feeding IndexPackShawn O. Pearce2011-03-021-1/+1
| | | | | | | | | | | | | | | | | There is no need to validate the object contents during copyObjectAsIs if the result is going to be parsed by unpack-objects or index-pack. Both programs will compute the SHA-1 of the object, and also validate most of the pack structure. For git daemon like servers, this work is already done on the client end of the connection, so the server doesn't need to repeat that work itself. Disable object validation for the 3 transport cases where we know the remote side will handle object validation for us (push, bundle creation, and upload pack). This improves performance on the server side by reducing the work that must be done. Change-Id: Iabb78eec45898e4a17f7aab3fb94c004d8d69af6 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Merge "ProgressMonitor: Refactor to use background alarms"Chris Aniszczyk2011-03-011-1/+4
|\
| * ProgressMonitor: Refactor to use background alarmsShawn O. Pearce2011-02-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of polling the system clock on every update(1) method call, use a scheduled executor to toggle a volatile once per second until the task is done. Check the volatile on each update(int), looking to see if output should occur. This limits progress output to either once per 1% complete, or once per second. To save time during update calls the timer isn't reset during each 1% of output, which means we may see one unnecessary output trigger if at least 1% completed during the one second of the alarm time. Change-Id: I8fdd7e31c37bef39a5d1b3da7105da0ef879eb84 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Show notes in Log CLI command - Part 2Sasa Zivkov2011-03-013-39/+28
|/ | | | | | | | This change fixes issues identified in the commit 5f3d577e5a1e8f23a2b6ea6a2bf24516806e01b8. Change-Id: Idbd935f5f60ad043faa0d4982b3e101ef7c07d60 Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
* Show notes in Log CLI commandSasa Zivkov2011-02-231-0/+120
| | | | | | | | | | | | | | Support for --no-standard-notes and --show-notes=REF options is added to the Log command. The --show-notes option can be specified more than once if more than one notes branch should be used for showing notes. The notes are displayed from note branches in the order how the note branches are specified in the command line. However, the standard note, from the refs/notes/commits, is always displayed as first unless the --no-standard-notes options is given. Change-Id: I4e7940804ed9d388b625b8e8a8e25bfcf5ee15a6 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Add Reset to the JGit CLIChris Aniszczyk2011-02-171-0/+89
| | | | | Change-Id: I85368c849c0964b9a539fa1991920adb2ace94df Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* pgm: Make --git-dir a stringShawn O. Pearce2011-02-156-18/+27
| | | | | | | | | | | DHT based repository types don't use a java.io.File to name the repository. Moving the type to a string starts to open up more types of repository names, making the standard pgm package easier to reuse on other storage systems. Change-Id: I262ccc8c01cd6db88f832ef317b0e1e5db2d016a Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* daemon: Use HTTP's resolver and factory patternShawn O. Pearce2011-02-141-6/+10
| | | | | | | | | | | | | | | | | | | Using a resolver and factory pattern for the anonymous git:// Daemon class makes transport.Daemon more useful on non-file storage systems, or in embedded applications where the caller wants more precise control over the work tasks constructed within the daemon. Rather than defining new interfaces, move the existing HTTP ones into transport.resolver and make them generic on the connection handle type. For HTTP, continue to use HttpServletRequest, and for transport.Daemon use DaemonClient. To remain compatible with transport.Daemon, FileResolver needs to learn how to use multiple base directories, and how to export any Repository instance at a fixed name. Change-Id: I1efa6b2bd7c6567e983fbbf346947238ea2e847e Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* [findbugs] Do not ignore exceptional return value of mkdirMatthias Sohn2011-01-281-2/+2
| | | | | | | | | java.io.File.mkdir() and mkdirs() report failure as an exceptional return value false. Fix the code which silently ignored this exceptional return value. Change-Id: I41244f4b9d66176e68e2c07e2329cf08492f8619 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fixed several NPEs in the Fetch CLISasa Zivkov2011-01-261-5/+10
| | | | | | | | | | The Fetch command line was failing with NPE in case some options were omitted. Additionally, it was setting a negative timeout when no timeout option was used which caused HttpURLConnection to throw an IllegalArgumentException. Change-Id: I2c67e2e1a03044284d183d73f0b82bb7ff79de95 Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Fixed NLS in JGit command line interfaceSasa Zivkov2011-01-261-2/+2
| | | | | | | | | | There was one place where the parameter substitution wasn't done which caused text fragments like "{0}" to appear in JGits output. Bug: 325025 Change-Id: I89b881a8b5ef39f609437546310463ed4f6e1fb5 Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Refactor IndexPack to not require local filesystemShawn O. Pearce2011-01-251-17/+18
| | | | | | | | | | | | | | | | | By moving the logic that parses a pack stream from the network (or a bundle) into a type that can be constructed by an ObjectInserter, repository implementations have a chance to inject their own logic for storing object data received into the destination repository. The API isn't completely generic yet, there are still quite a few assumptions that the PackParser subclass is storing the data onto the local filesystem as a single file. But its about the simplest split of IndexPack I can come up with without completely ripping the code apart. Change-Id: I5b167c9cc6d7a7c56d0197c62c0fd0036a83ec6c Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* clone: Use DirCacheCheckoutShawn O. Pearce2010-12-201-9/+4
| | | | | | | | | This simple change lets us get rid of WorkDirCheckout from JGit, and all of its supporting code. Change-Id: I1a5aabe9ab4a2b156fd37cc7e9ededb4ed70f53a Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Reduce calls to Repository.getConfigShawn O. Pearce2010-12-151-5/+8
| | | | | | | | | | | | | | | | | | | | Each time getConfig() is called on FileRepository, it checks the last modified time of both ~/.gitconfig and $GIT_DIR?config. If $GIT_DIR/config appears to have been modified, it is read back in from disk and the current config is wiped out. When mutating a configuration file, this may cause in-memory edits to disappear. To avoid that callers need to avoid calling getConfig until after the configuration has been saved to disk. Unfortunately the API is still horribly broken. Configuration should be modified only while a lock is held on the configuration file, very similar to the way a ref is updated via its locking protocol. But our existing API is really broken for that so we'll have to defer cleaning up the edit path for a future change. Change-Id: I5888dd97bac20ddf60456c81ffc1eb8df04ef410 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Clarify WorkingTreeOptions and filemode usageShawn O. Pearce2010-12-081-1/+4
| | | | | | | | | | | | | | | | | | | | | | To improve runtime performance, caching the WorkingTreeOptions inside of the Config object using the Config.SectionParser API allows the WorkingTreeOptions to be accessed more efficiently whenever a FileTreeIterator is constructed for the Repository. Instead of passing the filemode handling option into isModified(), the WorkingTreeIterator should always honor whatever setting has been configured in this repository, as defined by its own copy of the WorkingTreeOptions. This simplifies all of the callers as they no longer need to lookup core.filemode on their own. A few locations were changed from always using a hardcoded "true" on the file mode to passing what is actually configured in the repository. This is a behavior change, but corrects what should be considered to be bugs as the core.filemode variable wasn't always being used. Change-Id: Idb176736fa0dc97af372f1d652a94ecc72fb457c Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Remove empty iterator from TreeWalkShawn O. Pearce2010-12-073-4/+1
| | | | | | | | | | | | | | | | | Its confusing that a new TreeWalk() needs to have reset() invoked on it before addTree(). This is a historical accident caused by how TreeWalk was abused within ObjectWalk. Drop the initial empty tree from the TreeWalk and thus remove a number of pointless reset() operations from unit tests and some of the internal JGit code. Existing application code which is still calling reset() will simply be incurring a few unnecessary field assignments, but they should consider cleaning up their code in the future. Change-Id: I434e94ffa43491019e7dff52ca420a4d2245f48b Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Avoid NPE in InitChris Aniszczyk2010-12-071-2/+5
| | | | | | | | We should grab the repository directory from the command to avoid an NPE if no git directory is passed in via the CLI. Change-Id: I649467c6d84bbc0d26a070d0d4ff1e6f81fd5bad Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Update Init to use InitCommandChris Aniszczyk2010-12-051-9/+7
| | | | | Change-Id: I3ff700a87dfa6ac255c1aaf3fe11a07264594aab Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Make diff algorithm configurableChristian Halstrick2010-11-261-13/+2
| | | | | | | | | | | | | | | | The diff algorithm which is used by Merge, Cherry-Pick, Rebase should be configurable. A new configuration parameter "diff.algorithm" is introduced which currently accepts the values "myers" or "histogram". Based on this parameter for example the ResolveMerger will choose a diff algorithm. The reason for this is bug 331078. This bug shows that JGit is more compatible with C Git when histogram diff is in place. But since histogram diff is quite new we need an easy way to fall back to Myers diff. Bug: 331078 Change-Id: I2549c992e478d991c61c9508ad826d1a9e539ae3 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Philipp Thun <philipp.thun@sap.com>
* Add the Checkout command to the Git CLIChris Aniszczyk2010-11-231-0/+71
| | | | | | | | The implementation delegates to the CheckoutCommand and therefore only supports some of the options supported by the CheckoutCommand. Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Update Rm in the JGit CLIChris Aniszczyk2010-11-221-38/+12
| | | | | | | Since we have the RmCommand API now, update Rm to use it. Change-Id: I6e2cb37573cc8a29846f01e09e8c07e0dc279dbe Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Implement command line support for CredentialsProviderShawn O. Pearce2010-11-101-3/+3
| | | | | | | | | Instead of configuring the JSch session factory, configure a more generic CredentialsProvider, which will work for other transport types such as http, in addition to the existing ssh. Change-Id: I22b13303c17e654ba6720edf4be2ef15fe29537a Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Merge "Make Repository.shortenRefName static"Shawn Pearce2010-11-081-1/+1
|\
| * Make Repository.shortenRefName staticRobin Stocker2010-11-061-1/+1
| | | | | | | | | | | | The method has no reason to be non-static. Change-Id: I1c09e074395d49cee0e6e53679b499d1f0c351ea