Difference between revisions of "JGit GSoc 2012"

From Eclipsepedia

Jump to: navigation, search
(added script first draft)
(added script sample output)
Line 47: Line 47:
  
 
== Script (First Draft)  ==
 
== Script (First Draft)  ==
 +
 +
=== Script source ===
  
 
   #
 
   #
Line 63: Line 65:
 
     [[ -f $cli/${check} ]] && echo ">> Implemented in cli:"  $file "as" "$check"
 
     [[ -f $cli/${check} ]] && echo ">> Implemented in cli:"  $file "as" "$check"
 
     [[ ! -f $cli/${check} ]] && echo "Additional file in api (not in cli yet):" $file
 
     [[ ! -f $cli/${check} ]] && echo "Additional file in api (not in cli yet):" $file
   done echo -e "\n\n"  
+
   done  
 +
  echo -e "\n\n"  
  
 
<br>  
 
<br>  
  
<br>  
+
<br>
 +
 
 +
=== 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
  
 
== Resources  ==
 
== Resources  ==

Revision as of 16:22, 18 June 2012

Contents

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)

Goals:

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

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)

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

Resources

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

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