Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 793663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:11:18+00:00 2026-05-14T22:11:18+00:00

I’m trying to use git-p4 to clone perforce depot. I keep running into a

  • 0

I’m trying to use git-p4 to clone perforce depot. I keep running into a problem in the git-p4 script, where git-p4 tries to access a dict key that is not defined and throws a trace.

[~/p4/prod@ernie02] (master) $ 
git p4 sync --verbose --use-client-spec //depot/prod/
Reading pipe: git config git-p4.user
Reading pipe: git config git-p4.password
Reading pipe: git config git-p4.port
Reading pipe: git config git-p4.host
Reading pipe: git config git-p4.client
p4 -u mkramer -c mkramer -G client -o
Opening pipe: p4 -u mkramer -c mkramer -G client -o
None
Doing initial import of //depot/prod/ from revision #head into refs/remotes/p4/master
p4 -u mkramer -c mkramer -G files //depot/prod/...#head
Opening pipe: p4 -u mkramer -c mkramer -G files //depot/prod/...#head
commit into refs/remotes/p4/master
p4 -u mkramer -c mkramer -G -x - print
Opening pipe: p4 -u mkramer -c mkramer -G -x - print
p4 -u mkramer -c mkramer -G users
Opening pipe: p4 -u mkramer -c mkramer -G users
Traceback (most recent call last):
  File "/home/mkramer/git/bin/git-p4", line 1922, in <module>
    main()
  File "/home/mkramer/git/bin/git-p4", line 1917, in main
    if not cmd.run(args):
  File "/home/mkramer/git/bin/git-p4", line 1651, in run
    self.importHeadRevision(revision)
  File "/home/mkramer/git/bin/git-p4", line 1461, in importHeadRevision
    self.commit(details, self.extractFilesFromCommit(details), self.branch, self.depotPaths)
  File "/home/mkramer/git/bin/git-p4", line 1063, in commit
    data = file['data']
KeyError: 'data'

I went into the script and printed out the file dict right at that point and got some more details, which I’ll revise for clarity & anonymity. The faulty dict looked like this:

{'action': 'move/delete', 'path': '//depot/prod/foo/bar', 'rev': '3', 'type': 'xtext'}

My p4 client looks like this:

Client: mkramer
Update: 2010/04/27 14:46:10
Access: 2010/04/27 14:51:29

Owner:  mkramer
Description:
        Created by mkramer.
Root:   z:\p4
AltRoots:
        z:\p4
        /home/mkramer/p4
Options:        noallwrite noclobber nocompress unlocked nomodtime normdir
SubmitOptions:  submitunchanged
LineEnd:        share
View:

        //depot/prod/... //mkramer/prod/...
        -//depot/.../foo/... //mkramer/.../foo/...

As you can see, the faulty dict is a file that does not exist in my client view. I believe this is the source of the problem. However, I am clearly running the command with –use-client-spec. I’ve also tried git config git-p4.useclientspec true
The verbose output makes it look like it’s pulling my view out of

Opening pipe: p4 -u mkramer -c mkramer -G client -o.  

If I run p4 -u mkramer -c mkramer client -o I see the correct view.

If I run p4 -u mkramer -c mkramer files //depot/prod/...#head I see files that aren’t in my view.

Versions of my software:

[~/p4/prod@ernie02] (master) $ p4 -V
Perforce - The Fast Software Configuration Management System.
Copyright 1995-2009 Perforce Software.  All rights reserved.
Rev. P4/LINUX26X86_64/2009.1/205670 (2009/06/29).
[~/p4/prod@ernie02] (master) $ git --version
git version 1.7.0.5
[~/p4/prod@ernie02] (master) $ python -V
Python 2.6.5
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:11:19+00:00Added an answer on May 14, 2026 at 10:11 pm

    We just ran into this ourselves. P4 appears to have added some new commands last year that git-p4 doesn’t fully support; particularly “move/delete” and “move/add”.

    In order to work around the issue, we changed the line:

    if file["action"] in ("delete", "purge"):
    

    to:

    if file["action"] in ("delete", "purge", "move/delete"):
    

    So far this is working for us, but I won’t assert that this is necessarily a robust fix.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.