Search code examples
gitperforcegit-p4

git2p4 submit fails because of illegal characters in filenames


Our team uses git2p4 to develop locally on github repo and then submit it to perforce. For eg.

/home/workspace/src/ - the git repo code (changes present)

/home/workspace_p4git/src - the local client workspace associated to a depot on perforce.

When we copy the git repo source code in the perforce local directory, changes are seen in git as unstaged.

Now my problem:

There is a file named: abc %28def%29.extension in the git repo.

When I 'git add -A'; it shows me-
renamed: abc %2528def%2529.extension -> abc %28def%29.extension

Maybe this is because Perforce does not allow '%' character in the filename.

Then I try to submit my code to the git repo - git p4 submit -M

This fails with the following error:

Target file has illegal escape sequence [%xx].

command failed: p4 integrate -Dt "abc %2528def62%2529.extension" "abc %28def%29.extension"

Does anyone has any suggestion to resolve this other than change the filename in git repo?


Solution

  • Maybe this is because Perforce does not allow '%' character in the filename.

    No, it is because %25 is the percent encoding for %.

    You need to try and git mv back the added file, using \% or %% to see if you can restore the proper % in its name.
    Make sure to update first to the latest git version.