gitperforcegit-p4

Slashes in git p4 name fails


I am in progress of converting my Perforce repository into a git repo by using git p4. I have many branch mappings, some of them are circular (which is fine in Perforce) and some changed over time so they don't work from @1, so I start from @50000, otherwise git p4 complains in several steps since the branch mappings don't reflect older integrates (anymore).

I created a dedicated branch mapping which perfectly maps two branches from @50000, and only these two are part of my client-specs view.

$ p4 workspace
View:
    //depot/feature/... //my-workspace/feature/...
    //depot/main/... //my-workspace/main/...

$ p4 branch main
View:
    //depot/feature/... //depot/main/...

Letting git p4 run for a few hours returns with this:

$ git p4 clone --detect-branches --use-client-spec --verbose //depot@50000,1000000 .
Importing from //depot@50000,1000000 into .
[...]
Updated branches: feature main
Reading pipe: ['git', 'config', '--bool', 'git-p4.importLabels']
Not checking out any branch, use "git checkout -q -b master <branch>"
executing git config --bool git-p4.useclientspec true

I tried a variety of different parameters, but the directory stays empty. Any ideas what I am doing wrong?


Solution

  • You just need to run git checkout:

    Not checking out any branch, use "git checkout -q -b master <branch>"
    

    In this case, git p4 clone didn't know which branch(es) you wanted created in your local clone, so it didn't create any, and with no branch names, did not run git checkout either. It still made all the commits, and presumably made names p4/master and p4/feature to identify the tip commits of these two branches.