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

[JGIT PATCH] Allow jgit to load additional user classes

From
Shawn O. Pearce <spearce@spearce.org>
Date
Aug 11, 2008, 19:54 UTC
Message-ID
<20080811195442.GN26363@spearce.org>

Users may want to develop their own custom programs (implementations of TextBuiltin) and add them into the jgit runtime for command line usage. We now load additional classes from $JGIT_CLASSPATH, if it was defined when the process started.

To avoid users replacing our own internal commands or classes we put the user classpath behind our own, ensuring all of our standard classes and resources are found first.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 jgit.sh |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/jgit.sh b/jgit.sh
index 121beec..6b9b224 100755
--- a/jgit.sh
+++ b/jgit.sh
@@ -15,6 +15,11 @@ else
 	java_args=
 fi
 
+if [ -n "$JGIT_CLASSPATH" ]
+then
+	cp="$cp:$JGIT_CLASSPATH"
+fi
+
 # Cleanup paths for Cygwin.
 #
 case "`uname`" in
-- 
1.5.4.5

-- 
Shawn.
Message 1 of 1 in “Allow jgit to load additional user classes”
  1. Allow jgit to load additional user classesShawn O. Pearce, Aug 11, 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.