Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git p4 clone has no files

I'm migrating from Perforce to git, and in the process I'm trying to get the file structure right.

The current perforce structure is something like this:

//depot
    /android
        /main
        /other_branches
        /core_library
            /main
            /other_branches

and I'm shooting for something like this in git:

/android
/core_library

I set up my client spec View as follows (I'll worry about the branches later):

//depot/android/main/... //p4-git/android/...
//depot/android/core_library/main/... //p4-git/core_library/...

Wen I run the following, the full commit history appears, but no files.

set P4CLIENT=p4-git
git p4 clone --use-client-spec //p4-git/@all
like image 581
keyboardr Avatar asked Jan 29 '14 01:01

keyboardr


1 Answers

The problem is in this line:

git p4 clone --use-client-spec //p4-git/@all

Here you're passing a client path (//p4-git), but git-p4 expects a depot path. This causes problems later on when it tries to map Perforce depot paths to Git paths. Try running

git p4 clone --use-client-spec //depot/android/main/@all

instead.

Bear in mind that if you specify --use-client-spec, git-p4 will automatically use your client spec, whichever one that is. It will also remember this choice and use it for future git-p4 commands. It's probably a good idea to:

  • create a dedicated client for git-p4 work
  • make sure P4CLIENT is set to this client whenever you use git-p4
  • avoid changing the view of your git-p4 client
like image 114
benj Avatar answered Oct 20 '22 02:10

benj