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

[PATCH 3/5] git-p4 stream: show relative path in debug messages

From
PWPete Wyckoff <pw@padd.com>
Date
Jul 25, 2009, 14:24 UTC
Message-ID
<20090725142434.GD3841@arf.padd.com>
In-Reply-To
<20090725142329.GA3841@arf.padd.com>

Not repo path, but the one where git will put the file. They're shorter and allows verifying branchPrefixes too.

Signed-off-by: Pete Wyckoff <pw@padd.com>
---
 contrib/fast-import/git-p4 |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 3a52254..3ab016b 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -954,10 +954,9 @@ class P4Sync(Command):
     # - helper for streamP4Files
 
     def streamOneP4File(self, file, contents):
-        if verbose:
-            sys.stderr.write("%s\n" %  file["depotFile"])
-
         relPath = self.stripRepoPath(file['depotFile'], self.branchPrefixes)
+        if verbose:
+            sys.stderr.write("%s\n" % relPath)
 
         mode = "644"
         if isP4Exec(file["type"]):
@@ -994,11 +993,9 @@ class P4Sync(Command):
         self.gitStream.write("\n")
 
     def streamOneP4Deletion(self, file):
-        if verbose:
-            sys.stderr.write("delete %s\n" %  file["path"])
-
         relPath = self.stripRepoPath(file['path'], self.branchPrefixes)
-
+        if verbose:
+            sys.stderr.write("delete %s\n" % relPath)
         self.gitStream.write("D %s\n" % relPath)
 
     # Stream directly from "p4 files" into "git fast-import"
-- 
1.6.2.5
Previous: Pete WyckoffNext: Pete Wyckoff
Message 5 of 7 in “git-p4: stream from perforce to speed up clones”
  1. git-p4: stream from perforce to speed up clonesLuke Diamand, Jul 11, 2009
  2. Pete WyckoffJul 25, 2009
  3. 1/5 git-p4 stream: remove unused functionPete Wyckoff, Jul 25, 2009
  4. 2/5 git-p4 stream: do not pass branchPrefixes so muchPete Wyckoff, Jul 25, 2009
  5. 3/5 git-p4 stream: show relative path in debug messagesPete Wyckoff, Jul 25, 2009
  6. 4/5 git-p4 stream: check apple file typePete Wyckoff, Jul 25, 2009
  7. 5/5 git-p4 stream: use existing p4CmdList with callbackPete Wyckoff, Jul 25, 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.