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

[PATCH] Fix git-p4 on Windows to not use the Posix sysconf

From
Marius Storm-Olsen <marius@trolltech.com>
Date
Jul 13, 2007, 12:56 UTC
Message-ID
<46977660.7070207@trolltech.com>
 From 255ec32feb7525db8eef582eeed2b6e60be35ed8 Mon Sep 17 00:00:00 2001
From: Marius Storm-Olsen <marius@trolltech.com>
Date: Fri, 13 Jul 2007 14:39:05 +0200
Subject: [PATCH] Fix git-p4 on Windows to not use the Posix sysconf 
function.

Add condition for Windows, since it doesn't support the os.sysconf module. We hardcode the commandline limit to 2K, as that should work on most Windows platforms.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
---
  contrib/fast-import/git-p4 |    6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 54a05eb..746e0ca 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -717,7 +717,11 @@ class P4Sync(Command):
          # POSIX says it's 4096 bytes, default for Linux seems to be 
130 K.
          # and all OS from the table below seems to be higher than POSIX.
          # See http://www.in-ulm.de/~mascheck/various/argmax/
-        argmax = min(4000, os.sysconf('SC_ARG_MAX'))
+        if (self.isWindows):
+            argmax = 2000
+        else:
+            argmax = min(4000, os.sysconf('SC_ARG_MAX'))
+
          chunk = ''
          filedata = []
          for i in xrange(len(files)):
-- 
1.5.2-GUB
Next: Alex Riesen
Message 1 of 8 in “Fix git-p4 on Windows to not use the Posix sysconf”
  1. Fix git-p4 on Windows to not use the Posix sysconfMarius Storm-Olsen, Jul 13, 2007
  2. Alex RiesenJul 13, 2007
  3. Simon HausmannJul 13, 2007
  4. Shawn O. PearceJul 15, 2007
  5. Junio C HamanoJul 15, 2007
  6. Shawn O. PearceJul 16, 2007
  7. Junio C HamanoJul 16, 2007
  8. Simon HausmannJul 16, 2007

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.