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

[JGIT PATCH 2/2] Correct Javadoc comment for TransportLocal about forking

From
Shawn O. Pearce <spearce@spearce.org>
Date
May 2, 2009, 20:30 UTC
Message-ID
<1241296230-19342-2-git-send-email-spearce@spearce.org>
In-Reply-To
<1241296230-19342-1-git-send-email-spearce@spearce.org>

Since a4548aedff ("Switch local fetch connection to use our own UploadPack") this code has tried to avoid forking to execute the CGit upload-pack or receive-pack processes, instead favoring the creation of a helper thread and performing all work through a shared memory buffer within the same JVM.

Update the Javadoc to better reflect what this class does.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 .../org/spearce/jgit/transport/TransportLocal.java |   24 +++++++++++++++----
 1 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java
index d5a6c14..230ab76 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java
@@ -52,13 +52,27 @@
 import org.spearce.jgit.util.FS;
 
 /**
- * Transport that executes the Git "remote side" processes on a local directory.
+ * Transport to access a local directory as though it were a remote peer.
  * <p>
  * This transport is suitable for use on the local system, where the caller has
- * direct read or write access to the remote repository. This implementation
- * forks a C Git process to provide the remote side access, much as the
- * {@link TransportGitSsh} implementation causes the remote side to run a C Git
- * process.
+ * direct read or write access to the "remote" repository.
+ * <p>
+ * By default this transport works by spawning a helper thread within the same
+ * JVM, and processes the data transfer using a shared memory buffer between the
+ * calling thread and the helper thread. This is a pure-Java implementation
+ * which does not require forking an external process.
+ * <p>
+ * However, during {@link #openFetch()}, if the Transport has configured
+ * {@link Transport#getOptionUploadPack()} to be anything other than
+ * <code>"git-upload-pack"</code> or <code>"git upload-pack"</code>, this
+ * implementation will fork and execute the external process, using an operating
+ * system pipe to transfer data.
+ * <p>
+ * However, during {@link #openPush()}, if the Transport has configured
+ * {@link Transport#getOptionReceivePack()} to be anything other than
+ * <code>"git-receive-pack"</code> or <code>"git receive-pack"</code>, this
+ * implementation will fork and execute the external process, using an operating
+ * system pipe to transfer data.
  */
 class TransportLocal extends Transport implements PackTransport {
 	private static final String PWD = ".";
-- 
1.6.3.rc3.212.g8c698
Previous: Shawn O. PearceNext: Robin Rosenberg
Message 2 of 6 in “Ensure that a PackFile instance stays invalid when overwritten”
  1. 1/2 Ensure that a PackFile instance stays invalid when overwrittenShawn O. Pearce, May 2, 2009
  2. 2/2 Correct Javadoc comment for TransportLocal about forkingShawn O. Pearce, May 2, 2009
  3. Robin RosenbergMay 3, 2009
  4. Shawn O. PearceMay 4, 2009
  5. Robin RosenbergMay 3, 2009
  6. 1/2 Ensure that a PackFile instance stays invalid when overwrittenShawn O. Pearce, May 4, 2009

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.