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

Re: git-p4 move/delete errors

From
TBThomas Berg <merlin66b@gmail.com>
Date
Jul 13, 2010, 11:22 UTC
Message-ID
<AANLkTimWeZq3yPo01Ytj-rfP5tY8k100kDHJX_eWRwUq@mail.gmail.com>
In-Reply-To
<AANLkTilQtnIzNCcRzYzSqPEvXenHgND-_SAWmUeM64BH@mail.gmail.com>
On Fri, Jul 9, 2010 at 11:32 PM, Thomas Berg <merlin66b@gmail.com> wrote:
Show 11 quoted lines
> 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:
Previous: Thomas Berg
Message 7 of 7 in “git-p4 move/delete errors”
  1. Lance LinderMay 28, 2010
  2. Thomas BergJul 9, 2010
  3. Lance LinderJul 9, 2010
  4. Tor Arvid LundJul 9, 2010
  5. Lance LinderJul 9, 2010
  6. Thomas BergJul 9, 2010
  7. Thomas BergJul 13, 2010

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.