All of lore.kernel.org
 help / color / mirror / Atom feed
* git-p4 move/delete errors
@ 2010-05-28  0:30 Lance Linder
  2010-07-09 15:05 ` Thomas Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Lance Linder @ 2010-05-28  0:30 UTC (permalink / raw)
  To: git

Hello,

Until recently I have been successfully using git-p4 with much joy and
happiness. Then suddenly git-p4 submit started throwing "Command
failed: p4 diff -du ..." when ever I delete or move a file.

We recently upgraded our perforce server ( Rev.
P4D/NTX86/2009.2/238357 (2010/03/15) ). It was about this time that
the problem came up. First thing I did of course was upgrade to the
latest version of git ( now on 1.7.1 ) but the problem still persists.
Next I updated my p4 client ( Rev. P4/MACOSX104U/2009.2/238357
(2010/03/15) ) but still same problem. All other submits work fine as
long as there are not any deletions or moves.

Here is the exact output from git-p4 submit:

git p4 submit
Perforce checkout for depot path //depo/
Synchronizing p4 checkout...
... - file(s) up-to-date.
Applying c287e823b3da49dcaf3463a5153d73ac493ad48e test

tmp2.txt - file(s) not opened on this client.
//depo/tmp2.txt#3 - opened for delete
open for read: /depo/tmp2.txt: No such file or directory
Command failed: p4 diff -du ...

Anyone else seeing these issues?

Thanks,
Lance

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git-p4 move/delete errors
  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
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Berg @ 2010-07-09 15:05 UTC (permalink / raw)
  To: Lance Linder; +Cc: git

Hi,

On Fri, May 28, 2010 at 2:30 AM, Lance Linder <llinder@gmail.com> wrote:
> Until recently I have been successfully using git-p4 with much joy and
> happiness. Then suddenly git-p4 submit started throwing "Command
> failed: p4 diff -du ..." when ever I delete or move a file.
>
> We recently upgraded our perforce server ( Rev.
> P4D/NTX86/2009.2/238357 (2010/03/15) ). It was about this time that
> the problem came up. First thing I did of course was upgrade to the
> latest version of git ( now on 1.7.1 ) but the problem still persists.
> Next I updated my p4 client ( Rev. P4/MACOSX104U/2009.2/238357
> (2010/03/15) ) but still same problem. All other submits work fine as
> long as there are not any deletions or moves.
[...]
>
> Anyone else seeing these issues?


Indeed, we just upgraded our Perforce server too, and now I'm getting
this exact error. Did you find a solution to the problem?

If not I'm very interested in solving it. Seems like the p4 diff
command has changed behaviour and broken the git-p4 script.

Cheers,
Thomas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git-p4 move/delete errors
  2010-07-09 15:05 ` Thomas Berg
@ 2010-07-09 17:06   ` Lance Linder
  2010-07-09 20:21   ` Tor Arvid Lund
  1 sibling, 0 replies; 7+ messages in thread
From: Lance Linder @ 2010-07-09 17:06 UTC (permalink / raw)
  To: Thomas Berg; +Cc: git

I spent some time trying to debug this problem but couldn't resolve it myself. It is a huge pain and if I happen to find a fix I will definitely post an update but right now I have given up.

Hopefully someone smarter than myself finds a way to fix this because it is a nightmare to delete/rename files with git and submit back to perforce.

Lance


On Jul 9, 2010, at 10:05 AM, Thomas Berg wrote:

> Hi,
> 
> On Fri, May 28, 2010 at 2:30 AM, Lance Linder <llinder@gmail.com> wrote:
>> Until recently I have been successfully using git-p4 with much joy and
>> happiness. Then suddenly git-p4 submit started throwing "Command
>> failed: p4 diff -du ..." when ever I delete or move a file.
>> 
>> We recently upgraded our perforce server ( Rev.
>> P4D/NTX86/2009.2/238357 (2010/03/15) ). It was about this time that
>> the problem came up. First thing I did of course was upgrade to the
>> latest version of git ( now on 1.7.1 ) but the problem still persists.
>> Next I updated my p4 client ( Rev. P4/MACOSX104U/2009.2/238357
>> (2010/03/15) ) but still same problem. All other submits work fine as
>> long as there are not any deletions or moves.
> [...]
>> 
>> Anyone else seeing these issues?
> 
> 
> Indeed, we just upgraded our Perforce server too, and now I'm getting
> this exact error. Did you find a solution to the problem?
> 
> If not I'm very interested in solving it. Seems like the p4 diff
> command has changed behaviour and broken the git-p4 script.
> 
> Cheers,
> Thomas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git-p4 move/delete errors
  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
  1 sibling, 1 reply; 7+ messages in thread
From: Tor Arvid Lund @ 2010-07-09 20:21 UTC (permalink / raw)
  To: Thomas Berg; +Cc: Lance Linder, git

On Fri, Jul 9, 2010 at 5:05 PM, Thomas Berg <merlin66b@gmail.com> wrote:
> Hi,
>
> On Fri, May 28, 2010 at 2:30 AM, Lance Linder <llinder@gmail.com> wrote:
>> Until recently I have been successfully using git-p4 with much joy and
>> happiness. Then suddenly git-p4 submit started throwing "Command
>> failed: p4 diff -du ..." when ever I delete or move a file.
>>
>> We recently upgraded our perforce server ( Rev.
>> P4D/NTX86/2009.2/238357 (2010/03/15) ). It was about this time that
>> the problem came up. First thing I did of course was upgrade to the
>> latest version of git ( now on 1.7.1 ) but the problem still persists.
>> Next I updated my p4 client ( Rev. P4/MACOSX104U/2009.2/238357
>> (2010/03/15) ) but still same problem. All other submits work fine as
>> long as there are not any deletions or moves.
> [...]
>>
>> Anyone else seeing these issues?

Hi. Are any of you using Perforce's "keyword expansion" stuff? I mean
the thing where you put a:

$Id$

keyword in a file, and it expands to something like:

$Id: //depot/test/main.c#10 $

If I do that (and, unfortunately, people at my $dayjob do do that),
I'm almost sure that this is the error I got... The reason seems to be
that when git imports the file from P4, the keyword expansions get
stripped off (as in: reset to just $Id$). And then the p4 diff fails
if the $Id$ type lines are included in the diff. When deleting a file,
all lines are included in the diff...

It hasn't itched me hard enough that I have tried hard to solve it
(unfortunately). I simply do deletes from P4 instead of git-p4 :-/

-Tor Arvid-

> Indeed, we just upgraded our Perforce server too, and now I'm getting
> this exact error. Did you find a solution to the problem?
>
> If not I'm very interested in solving it. Seems like the p4 diff
> command has changed behaviour and broken the git-p4 script.
>
> Cheers,
> Thomas
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git-p4 move/delete errors
  2010-07-09 20:21   ` Tor Arvid Lund
@ 2010-07-09 21:20     ` Lance Linder
  2010-07-09 21:32       ` Thomas Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Lance Linder @ 2010-07-09 21:20 UTC (permalink / raw)
  To: Tor Arvid Lund; +Cc: Thomas Berg, git

Thanks for the tip about keyword expansion. Fortunately for me we don't use those.

When I was trying to debug this the problem seemed to be that the original file is removed from the local Perforce workspace before the p4 diff command is issued. I am not sure how the server upgrade caused this behavior but it was the only thing that changed when I first started seeing the error.

Lance

On Jul 9, 2010, at 3:21 PM, Tor Arvid Lund wrote:

> On Fri, Jul 9, 2010 at 5:05 PM, Thomas Berg <merlin66b@gmail.com> wrote:
>> Hi,
>> 
>> On Fri, May 28, 2010 at 2:30 AM, Lance Linder <llinder@gmail.com> wrote:
>>> Until recently I have been successfully using git-p4 with much joy and
>>> happiness. Then suddenly git-p4 submit started throwing "Command
>>> failed: p4 diff -du ..." when ever I delete or move a file.
>>> 
>>> We recently upgraded our perforce server ( Rev.
>>> P4D/NTX86/2009.2/238357 (2010/03/15) ). It was about this time that
>>> the problem came up. First thing I did of course was upgrade to the
>>> latest version of git ( now on 1.7.1 ) but the problem still persists.
>>> Next I updated my p4 client ( Rev. P4/MACOSX104U/2009.2/238357
>>> (2010/03/15) ) but still same problem. All other submits work fine as
>>> long as there are not any deletions or moves.
>> [...]
>>> 
>>> Anyone else seeing these issues?
> 
> Hi. Are any of you using Perforce's "keyword expansion" stuff? I mean
> the thing where you put a:
> 
> $Id$
> 
> keyword in a file, and it expands to something like:
> 
> $Id: //depot/test/main.c#10 $
> 
> If I do that (and, unfortunately, people at my $dayjob do do that),
> I'm almost sure that this is the error I got... The reason seems to be
> that when git imports the file from P4, the keyword expansions get
> stripped off (as in: reset to just $Id$). And then the p4 diff fails
> if the $Id$ type lines are included in the diff. When deleting a file,
> all lines are included in the diff...
> 
> It hasn't itched me hard enough that I have tried hard to solve it
> (unfortunately). I simply do deletes from P4 instead of git-p4 :-/
> 
> -Tor Arvid-
> 
>> Indeed, we just upgraded our Perforce server too, and now I'm getting
>> this exact error. Did you find a solution to the problem?
>> 
>> If not I'm very interested in solving it. Seems like the p4 diff
>> command has changed behaviour and broken the git-p4 script.
>> 
>> Cheers,
>> Thomas
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git-p4 move/delete errors
  2010-07-09 21:20     ` Lance Linder
@ 2010-07-09 21:32       ` Thomas Berg
  2010-07-13 11:22         ` Thomas Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Berg @ 2010-07-09 21:32 UTC (permalink / raw)
  To: Lance Linder; +Cc: Tor Arvid Lund, git

On Fri, Jul 9, 2010 at 11:20 PM, Lance Linder <llinder@gmail.com> wrote:
> Thanks for the tip about keyword expansion. Fortunately for me we don't use those.

We don't either.

> When I was trying to debug this the problem seemed to be that the original file is removed from the local Perforce workspace before the p4 diff command is issued. I am not sure how the server upgrade caused this behavior but it was the only thing that changed when I first started seeing the error.

Hasn't Perforce always deleted files immediately when they are marked
for deletion?

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.

Thomas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git-p4 move/delete errors
  2010-07-09 21:32       ` Thomas Berg
@ 2010-07-13 11:22         ` Thomas Berg
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Berg @ 2010-07-13 11:22 UTC (permalink / raw)
  To: Lance Linder; +Cc: Tor Arvid Lund, git

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:

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-07-13 11:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.