Skip to contentSkip to conversation

Dangerous new server status for deleted files

PATCH Pal-Kristian Engstad 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

Our new Perforce server (P4D/NTX64/2009.2/228098 2009/12/16) seems to be giving out 'move/delete' instead of the old 'delete' status for files that are moved within the repo. Attached is the simple patch to fix it. (By the way: How do you "sign off" a patch?) This is urgent, as it will corrupt git repos trying to track a Perforce depot.

Thanks,

PKE.

Signature · 5 lines
Pål-Kristian Engstad ([email protected]), Lead Graphics & Engine Programmer,
Naughty Dog, Inc., 1601 Cloverfield Blvd, 6000 North,
Santa Monica, CA 90404, USA. Ph.: (310) 633-9112.

"Emacs would be a far better OS if it was shipped with a halfway-decent text editor." -- Slashdot, Dec 13. 2005.

From bbc0cf2dbd318faaf5731b684d67c5b2126cb1e0 Mon Sep 17 00:00:00 2001
From: Pal-Kristian Engstad <[email protected]>
Date: Wed, 20 Jan 2010 12:07:21 -0800
Subject: [PATCH] git-p4: Fix sync errors due to new server version.

New server P4D/NTX64/2009.2/228098 (2009/12/16) reports 'move/delete' instead of 'delete'. This causes files that are moved to leave their old file in git. Fixed by adding the new status string.

---
 contrib/fast-import/git-p4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
contrib/fast-import/git-p4 +1 -1
index 6303449..ef7c23b 100755
@@ -1089,7 +1089,7 @@ class P4Sync(Command):
 
             if includeFile:
                 filesForCommit.append(f)
-                if f['action'] not in ('delete', 'purge'):
+                if f['action'] not in ('delete', 'move/delete', 'purge'):
                     filesToRead.append(f)
                 else:
                     filesToDelete.append(f)
Signature · 1 line
1.6.5.2.6.gc3c1e.dirty
#1 lore raw
Quoted 5 lines · Pal-Kristian Engstad

Our new Perforce server (P4D/NTX64/2009.2/228098 2009/12/16) seems to be giving out 'move/delete' instead of the old 'delete' status for files that are moved within the repo. Attached is the simple patch to fix it. (By the way: How do you "sign off" a patch?) This is urgent, as it will corrupt git repos trying to track a Perforce depot.

Hi, and welcome to the Git community.

The patch itself may be fine, but you should probably read Documentation/SubmittingPatches for hints on the customs of this list. For
example: We prefer patches _inline_ in the mail, so that it's easier to review and comment on them. The Documentation/SubmittingPatches also explains what is meant by a sign-off, and how to sign-off your patches.

Have fun! :)

...Johan

Signature · 2 lines
Johan Herland, <[email protected]>
www.herland.net