Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15

Re: git-p4 move/delete errors

From: Thomas Berg <hidden>
Date: 2016-06-15 22:49:07
Subsystem: the rest · Maintainer: Linus Torvalds

On Fri, Jul 9, 2010 at 11:32 PM, Thomas Berg [off-list ref] wrote:
Anyway, as far as I can see from the git-p4 source code, the command
is only used to generate the diff preview in the interactive window
that pops up when you "git p4 submit". So if you replace the line
diff = p4_read_pipe("diff -du ...")
with
diff = ""

it should start working again (the diff preview part will become
empty). I'm unable to test it right now, but fairly sure it will work.
I'll see if I can find a better solution when I have access to the
Perforce server again.
It seems like they have done some bugfixes to "p4 diff -du ...", I
guess that's why we get different behaviour now. It prints the correct
output, but exits with an error code anyway when files have been
removed.

My solution is in the diff below. I'll run with it for a few days,
then I'll submit a proper patch to the mailing list (unless someone
else beat me to it).

Thomas
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index c1ea643..19f4519 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -706,7 +706,7 @@ class P4Submit(Command):
             submitTemplate = self.prepareLogMessage(template, logMessage)
             if os.environ.has_key("P4DIFF"):
                 del(os.environ["P4DIFF"])
-            diff = p4_read_pipe("diff -du ...")
+            diff = p4_read_pipe("diff -du ...", ignore_error=True)

             newdiff = ""
             for newFile in filesToAdd:
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help