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

[PATCH 3/3] git-p4: Fix error message crash in P4Sync.commit.

From
Tor Arvid Lund <torarvid@gmail.com>
Date
Mar 15, 2011, 12:08 UTC
Message-ID
<1300190883-31833-3-git-send-email-torarvid@gmail.com>
In-Reply-To
<1300190883-31833-1-git-send-email-torarvid@gmail.com>

There is an error message that crashes the script because of an invalid ref to the non-existing "path" variable. It is almost never printed, which would explain why nobody encountered this problem before... But anyway, this oneliner fixes it.

Signed-off-by: Tor Arvid Lund <torarvid@gmail.com>
---
 contrib/fast-import/git-p4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index d47596f..47ba7ad 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1160,7 +1160,7 @@ class P4Sync(Command):
             if [p for p in branchPrefixes if p4PathStartsWith(f['path'], p)]:
                 new_files.append (f)
             else:
-                sys.stderr.write("Ignoring file outside of prefix: %s\n" % path)
+                sys.stderr.write("Ignoring file outside of prefix: %s\n" % f['path'])
 
         self.gitStream.write("commit %s\n" % branch)
 #        gitStream.write("mark :%s\n" % details["change"])
-- 
1.7.3.1.68.g06779.dirty
Previous: Tor Arvid LundNext: Pete Wyckoff
Message 3 of 4 in “git-p4: Teach gitConfig method about arguments.”
  1. 1/3 git-p4: Teach gitConfig method about arguments.Tor Arvid Lund, Mar 15, 2011
  2. 2/3 Teach git-p4 to ignore case in perforce filenames if configured.Tor Arvid Lund, Mar 15, 2011
  3. 3/3 git-p4: Fix error message crash in P4Sync.commit.Tor Arvid Lund, Mar 15, 2011
  4. Pete WyckoffMar 15, 2011

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.