Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365439

Summary: Leverage CLI commands from jgit.pgm with JGit API
Product: [Technology] JGit Reporter: Tomasz Zarna <tomasz.zarna>
Component: JGitAssignee: Project Inbox <jgit.core-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: fps2, matthias.sohn, mmmicke
Version: 1.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 378078, 380117, 348318, 378224    
Bug Blocks:    

Description Tomasz Zarna CLA 2011-12-02 09:41:31 EST
The CLI from org.eclipse.jgit.pgm is pretty cool, but seems to be a little bit out dated comparing to JGit API from org.eclipse.jgit.

After a quick look I've noticed couple of places where the API is not used or where having the API already in place a CLI command could be added:
* org.eclipse.jgit.api.ListTagCommand > org.eclipse.jgit.pgm.Tag, see http://egit.eclipse.org/r/#change,4718
* org.eclipse.jgit.api.CloneCommand > org.eclipse.jgit.pgm.Clone
* org.eclipse.jgit.api.PullCommand > org.eclipse.jgit.pgm.Pull (doesn't exist)
* org.eclipse.jgit.api.RebaseCommand > org.eclipse.jgit.pgm.Rebase (doesn't exist)
* ...

This kind of feedback could not only make the CLI more robust, but it could also work the other way round making sure the API supports all args needed be the CLI.
Comment 1 Tomasz Zarna CLA 2011-12-06 17:21:39 EST
org.eclipse.jgit.api.StatusCommand > org.eclipse.jgit.pgm.Status (doesn't exist, see bug 348318)
Comment 2 Tomasz Zarna CLA 2011-12-22 10:27:33 EST
* cannot find a CLI command for getting and setting repo/global options (org.eclipse.jgit.pgm.Config?)
Comment 3 Tomasz Zarna CLA 2012-02-16 12:44:15 EST
(In reply to comment #2)
> * cannot find a CLI command for getting (...) repo/global options

It's https://git.eclipse.org/r/#/c/4898/
Comment 4 Tomasz Zarna CLA 2012-04-30 09:19:36 EDT
See also https://git.eclipse.org/r/#/c/5763/ for adding --all switch to org.eclipse.jgit.pgm.Commit.
Comment 5 Tomasz Zarna CLA 2012-04-30 09:28:50 EDT
See also https://git.eclipse.org/r/#/c/5764/ for printing out which branch has been checked out in org.eclipse.jgit.Checkout
Comment 6 Mikael Karlsson CLA 2012-05-18 16:16:05 EDT
JGit Init command does not support specifying the directory for the new repository (but InitCommand in the api does).

For example:
jgit init my_new_repo
returns:
fatal: No argument is allowed: my_new_repo

You have to create the new directory manually, and the executing "jgit init" from there.
Comment 7 Tomasz Zarna CLA 2012-05-21 05:39:07 EDT
(In reply to comment #6)
> JGit Init command does not support specifying the directory for the new
> repository (but InitCommand in the api does).

Filed bug 380117 for this. It should be easy to fix.