Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

JGit GSoc 2012

JGit Command Line Interface

About

The Command Line Interface (CLI) in JGit mimics its CGit equivalent. However, there is more to it than just having a second tool doing the same thing. The JGit CLI is a perfect way to verify robustness of the JGit Command API. It can be also used to simplify writing JUnit tests.

The project would be about adding new CLI commands to the o.e.jgit.pgm project and vice versa ie translating some of the existing CLI commands/switches to JGit Command API. In addition, the student could help with randomized JGit tests.

Project timeline

Phase 1 (up to June 20, 2012) - Complete

Goals:

  • Research JGIT CLI code base - Complete
  • Compile list of commands to update in this project - Version 1 Complete
  • Write script to automate comparison of JGit API and JGit CLI - Version 1 Complete

Note: Phase 1 was extended to June 20 to some initial problems with set up, and overestimating available work time during travels.

Phase 2 (up to July 10, 2012) - In progress

Goals:

  • Implement first commands - - In progress
  • Research automated and unit testing in JGIT

Some steps have been taken for Phase 2, including:

  • Submitting bug reports to learn to use Bugzilla [1] - Complete
  • Submitting trivial bug patch to learn to use Gerrit [2] - Complete

Phase 3 (up to August 10, 2012)

Goals:

  • Add additional new commands
  • Use script from phase 1 to ensure new commands properly implemented
  • Explore extended automated and unit testing in JGIT

Script (First Draft)

Script source

 #
 #Script for comparing JGit cli and api - version 1.0 
 #author: Franziska Schmidt 
 #README: Place in git/jgit source directory, make executable, run.
 
 api=org.eclipse.jgit/src/org/eclipse/jgit/api
 cli=org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm
 
 echo -e "\n Comparing JGit CLI to JGit api \n"
 
 find $api -type f | while read file; do
    check=${file/%Command.java/.java}           #replace end
    check=${check/#*\//}                        #replace beginning before slash
    [[ -f $cli/${check} ]] && echo ">> Implemented in cli:"  $file "as" "$check"
    [[ ! -f $cli/${check} ]] && echo "Additional file in api (not in cli yet):" $file
 done 
 echo -e "\n\n" 



Output Excerpt

   >> Implemented in cli: org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java as LsRemote.java
   >> Implemented in cli: org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java as Add.java
   Additional file in api (not in cli yet): org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java

List of Target Commands

Implement (non-existing)

  • status

Update(exist, but need improvement)

  • init (target)
  • log
  • commit
  • checkout
  • config

Resources

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=382163

[2] https://git.eclipse.org/r/#/c/6102/

Back to the top