git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [JGIT PATCH 0/9] List commonly used (or recognized) commands
@ 2008-07-25 19:45 Shawn O. Pearce
  2008-07-25 19:45 ` [JGIT PATCH 1/9] Switch jgit.pgm to J2SE-1.5 execution environment Shawn O. Pearce
  2008-07-25 19:52 ` [JGIT PATCH 0/9] List commonly used (or recognized) commands Shawn O. Pearce
  0 siblings, 2 replies; 12+ messages in thread
From: Shawn O. Pearce @ 2008-07-25 19:45 UTC (permalink / raw)
  To: Robin Rosenberg; +Cc: git

This series adds support to jgit to list commonly used subcommands
if the user just executes `jgit` with no subcommand requested:

  $ jgit
  jgit --git-dir GIT_DIR --help (-h) --show-stack-trace command [ARG ...]
  
  The most commonly used commands are:
   fetch  Update remote refs from another repository
   log    View commit history
   push   Update remote repository from local refs
   tag    Create a tag

Commands inside of the pgm.debug package are automatically given
the debug- prefix, allowing debug-show-commands to be used to show
the command table.

Commands must be listed in the META-INF/services/org...TextBuiltin
file in order to be considered for execution.  This means that we
must add (or remove) command class names from the listing each time
we introduce or remove a command line subcommand.

One advantage to this structure is additional commands can defined
in other packages, and are available so long as the classes are
reachable through the CLASSPATH.  Since jgit.sh hardcodes the
CLASSPATH to only itself this is not fully supported yet, but does
open the door for users to extend jgit's command line support.


Shawn O. Pearce (9):
  Switch jgit.pgm to J2SE-1.5 execution environment
  Remove unnecessary duplicate if (help) test inside TextBuiltin
  Create an optional documentation annotation for TextBuiltin
  Create a lightweight registration wrapper for TextBuiltin
  Create a catalog of CommandRefs for lookup and enumeration
  Document some common commands with the new Command annotation
  Include commonly used commands in main help output
  Refactor SubcommandHandler to use CommandCatalog instead of
    reflection
  Add debug-show-commands to display the command table

 org.spearce.jgit.pgm/.classpath                    |    2 +-
 .../services/org.spearce.jgit.pgm.TextBuiltin      |   14 ++
 .../src/org/spearce/jgit/pgm/Command.java          |   72 ++++++++
 .../src/org/spearce/jgit/pgm/CommandCatalog.java   |  188 ++++++++++++++++++++
 .../src/org/spearce/jgit/pgm/CommandRef.java       |  158 ++++++++++++++++
 .../src/org/spearce/jgit/pgm/Fetch.java            |    1 +
 .../src/org/spearce/jgit/pgm/Log.java              |    1 +
 .../src/org/spearce/jgit/pgm/Main.java             |   18 ++
 .../src/org/spearce/jgit/pgm/Push.java             |    1 +
 .../src/org/spearce/jgit/pgm/Tag.java              |    1 +
 .../src/org/spearce/jgit/pgm/TextBuiltin.java      |   17 +--
 .../org/spearce/jgit/pgm/debug/ShowCommands.java   |   78 ++++++++
 .../spearce/jgit/pgm/opt/SubcommandHandler.java    |   65 +------
 13 files changed, 543 insertions(+), 73 deletions(-)
 create mode 100644 org.spearce.jgit.pgm/src/META-INF/services/org.spearce.jgit.pgm.TextBuiltin
 create mode 100644 org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Command.java
 create mode 100644 org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/CommandCatalog.java
 create mode 100644 org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/CommandRef.java
 create mode 100644 org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/debug/ShowCommands.java

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-07-25 20:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-25 19:45 [JGIT PATCH 0/9] List commonly used (or recognized) commands Shawn O. Pearce
2008-07-25 19:45 ` [JGIT PATCH 1/9] Switch jgit.pgm to J2SE-1.5 execution environment Shawn O. Pearce
2008-07-25 19:46   ` [JGIT PATCH 2/9] Remove unnecessary duplicate if (help) test inside TextBuiltin Shawn O. Pearce
2008-07-25 19:46     ` [JGIT PATCH 3/9] Create an optional documentation annotation for TextBuiltin Shawn O. Pearce
2008-07-25 19:46       ` [JGIT PATCH 4/9] Create a lightweight registration wrapper " Shawn O. Pearce
2008-07-25 19:46         ` [JGIT PATCH 5/9] Create a catalog of CommandRefs for lookup and enumeration Shawn O. Pearce
2008-07-25 19:46           ` [JGIT PATCH 6/9] Document some common commands with the new Command annotation Shawn O. Pearce
2008-07-25 19:46             ` [JGIT PATCH 7/9] Include commonly used commands in main help output Shawn O. Pearce
2008-07-25 19:46               ` [JGIT PATCH 8/9] Refactor SubcommandHandler to use CommandCatalog instead of reflection Shawn O. Pearce
2008-07-25 19:46                 ` [JGIT PATCH 9/9] Add debug-show-commands to display the command table Shawn O. Pearce
2008-07-25 20:02           ` [JGIT PATCH 5/9 v2] Create a catalog of CommandRefs for lookup and enumeration Shawn O. Pearce
2008-07-25 19:52 ` [JGIT PATCH 0/9] List commonly used (or recognized) commands Shawn O. Pearce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).