Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "JGit GSoc 2012"

(Phase 2 (up to July 10, 2012))
(Phase 2 (up to July 10, 2012))
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
= JGit Command Line Interface =
+
= JGit Command Line Interface =
  
==About==
+
== 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 [https://bugs.eclipse.org/bugs/show_bug.cgi?id=365439 verify robustness of the JGit Command API]. It can be also used to [https://bugs.eclipse.org/bugs/show_bug.cgi?id=365444 simplify writing JUnit tests].  
 
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 [https://bugs.eclipse.org/bugs/show_bug.cgi?id=365439 verify robustness of the JGit Command API]. It can be also used to [https://bugs.eclipse.org/bugs/show_bug.cgi?id=365444 simplify writing JUnit tests].  
Line 14: Line 14:
 
*Eclipse Project: [http://eclipse.org/jgit/ JGit]
 
*Eclipse Project: [http://eclipse.org/jgit/ JGit]
  
==Project timeline==
+
== Project timeline ==
  
===Phase 1 (up to June 20, 2012) ===
+
=== Phase 1 (up to June 20, 2012) - Complete  ===
  
 
Goals:  
 
Goals:  
+
 
*Research JGIT CLI code base - '''Complete'''
+
*Research JGIT CLI code base - '''Complete'''  
*Compile list of commands to update in this project - '''In progress'''
+
*Compile list of commands to update in this project - '''Version 1 Complete'''  
*Write script to automate comparison of JGit API and JGit CLI - '''In progress'''
+
*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.
 
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) ===
+
=== Phase 2 (up to July 10, 2012) - In progress  ===
  
 
Goals:  
 
Goals:  
  
*Implement first commands - - '''In progress'''
+
*Implement first commands - - '''In progress'''  
 
*Research automated and unit testing in JGIT
 
*Research automated and unit testing in JGIT
  
Some steps have been taken for Phase 2, including:
+
Some steps have been taken for Phase 2, including:  
  
*Submitting bug reports to learn to use Bugzilla [1] - '''Complete'''
+
*Submitting bug reports to learn to use Bugzilla [1] - '''Complete'''  
 
*Submitting trivial bug patch to learn to use Gerrit [2] - '''Complete'''
 
*Submitting trivial bug patch to learn to use Gerrit [2] - '''Complete'''
  
===Phase 3 (up to August 10, 2012) ===
+
=== Phase 3 (up to August 10, 2012) ===
  
-
+
Goals:
==Resources==
+
 
 +
*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"
 +
 
 +
<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
 +
 
 +
== 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  
 
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=382163  
 +
 
[2] https://git.eclipse.org/r/#/c/6102/
 
[2] https://git.eclipse.org/r/#/c/6102/

Latest revision as of 16:22, 21 June 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