git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[JGIT PATCH 6/9] Document some common commands with the new Command annotation

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jul 25, 2008, 19:46 UTC
Message-ID
<1217015167-4680-7-git-send-email-spearce@spearce.org>
In-Reply-To
<1217015167-4680-6-git-send-email-spearce@spearce.org>

This way they are known to be common at runtime, by looking at the annotation associated with the class instance. Right now we do not use these annotations but they will be useful soon.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 .../src/org/spearce/jgit/pgm/Fetch.java            |    1 +
 .../src/org/spearce/jgit/pgm/Log.java              |    1 +
 .../src/org/spearce/jgit/pgm/Push.java             |    1 +
 .../src/org/spearce/jgit/pgm/Tag.java              |    1 +
 4 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Fetch.java b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Fetch.java
index 194f669..dcad972 100644
--- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Fetch.java
+++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Fetch.java
@@ -47,6 +47,7 @@ import org.spearce.jgit.transport.RefSpec;
 import org.spearce.jgit.transport.TrackingRefUpdate;
 import org.spearce.jgit.transport.Transport;
 
+@Command(common = true, usage = "Update remote refs from another repository")
 class Fetch extends TextBuiltin {
 	@Argument(index = 0, metaVar = "uri-ish")
 	private String remote = "origin";
diff --git a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Log.java b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Log.java
index 780a63b..e16387b 100644
--- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Log.java
+++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Log.java
@@ -45,6 +45,7 @@ import java.util.TimeZone;
 import org.spearce.jgit.lib.PersonIdent;
 import org.spearce.jgit.revwalk.RevCommit;
 
+@Command(common = true, usage = "View commit history")
 class Log extends RevWalkTextBuiltin {
 	private final TimeZone myTZ = TimeZone.getDefault();
 
diff --git a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java
index df6c664..6b35ab8 100644
--- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java
+++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Push.java
@@ -51,6 +51,7 @@ import org.spearce.jgit.transport.RemoteRefUpdate;
 import org.spearce.jgit.transport.Transport;
 import org.spearce.jgit.transport.RemoteRefUpdate.Status;
 
+@Command(common = true, usage = "Update remote repository from local refs")
 class Push extends TextBuiltin {
 	@Argument(index = 0, metaVar = "uri-ish")
 	private String remote = "origin";
diff --git a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Tag.java b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Tag.java
index a7bd037..6c73552 100644
--- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Tag.java
+++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Tag.java
@@ -45,6 +45,7 @@ import org.spearce.jgit.lib.ObjectId;
 import org.spearce.jgit.lib.ObjectLoader;
 import org.spearce.jgit.lib.PersonIdent;
 
+@Command(common = true, usage = "Create a tag")
 class Tag extends TextBuiltin {
 	@Option(name = "-f", usage = "force replacing an existing tag")
 	private boolean force;
-- 
1.6.0.rc0.182.gb96c7
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 7 of 12 in “List commonly used (or recognized) commands”
  1. 0/9 List commonly used (or recognized) commandsShawn O. Pearce, Jul 25, 2008
  2. 1/9 Switch jgit.pgm to J2SE-1.5 execution environmentShawn O. Pearce, Jul 25, 2008
  3. 2/9 Remove unnecessary duplicate if (help) test inside TextBuiltinShawn O. Pearce, Jul 25, 2008
  4. 3/9 Create an optional documentation annotation for TextBuiltinShawn O. Pearce, Jul 25, 2008
  5. 4/9 Create a lightweight registration wrapper for TextBuiltinShawn O. Pearce, Jul 25, 2008
  6. 5/9 Create a catalog of CommandRefs for lookup and enumerationShawn O. Pearce, Jul 25, 2008
  7. 6/9 Document some common commands with the new Command annotationShawn O. Pearce, Jul 25, 2008
  8. 7/9 Include commonly used commands in main help outputShawn O. Pearce, Jul 25, 2008
  9. 8/9 Refactor SubcommandHandler to use CommandCatalog instead of reflectionShawn O. Pearce, Jul 25, 2008
  10. 9/9 Add debug-show-commands to display the command tableShawn O. Pearce, Jul 25, 2008
  11. 5/9 Create a catalog of CommandRefs for lookup and enumerationShawn O. Pearce, Jul 25, 2008
  12. Shawn O. PearceJul 25, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.