git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Berg <merlin66b@gmail.com>
To: Lance Linder <llinder@gmail.com>
Cc: Tor Arvid Lund <torarvid@gmail.com>, git@vger.kernel.org
Subject: Re: git-p4 move/delete errors
Date: Tue, 13 Jul 2010 13:22:40 +0200	[thread overview]
Message-ID: <AANLkTimWeZq3yPo01Ytj-rfP5tY8k100kDHJX_eWRwUq@mail.gmail.com> (raw)
In-Reply-To: <AANLkTilQtnIzNCcRzYzSqPEvXenHgND-_SAWmUeM64BH@mail.gmail.com>

On Fri, Jul 9, 2010 at 11:32 PM, Thomas Berg <merlin66b@gmail.com> 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:

      reply	other threads:[~2010-07-13 11:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-28  0:30 git-p4 move/delete errors Lance Linder
2010-07-09 15:05 ` Thomas Berg
2010-07-09 17:06   ` Lance Linder
2010-07-09 20:21   ` Tor Arvid Lund
2010-07-09 21:20     ` Lance Linder
2010-07-09 21:32       ` Thomas Berg
2010-07-13 11:22         ` Thomas Berg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimWeZq3yPo01Ytj-rfP5tY8k100kDHJX_eWRwUq@mail.gmail.com \
    --to=merlin66b@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=llinder@gmail.com \
    --cc=torarvid@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).