salesforce / p4-fusion

A fast Perforce to Git conversion tool written in C++ using Perforce Helix Core C++ API and Libgit2
BSD 3-Clause "New" or "Revised" License
78 stars 17 forks source link

'Invalid option' error when running p4-fusion #52

Closed dgilbert101 closed 2 years ago

dgilbert101 commented 2 years ago

Receiving the following error when trying p4-fusion out

[ WARNING @ Run:126 ] Retrying: p4 changes -l -s submitted -r //src/... [ ERROR @ HandleError:13 ] Received error: error Usage: changes [-i -t -l -L -f -c client -m count -s status -u user] [files...] Invalid option: -r.

p4 changes has no '-r' option, although the docs state it does.

$ p4 -V Perforce - The Fast Software Configuration Management System. Copyright 1995-2022 Perforce Software. All rights reserved. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) Version of OpenSSL Libraries: OpenSSL 1.1.1n 15 Mar 2022 See 'p4 help [ -l ] legal' for additional license information on these licenses and others. Extensions/scripting support built-in. Parallel sync threading built-in. Rev. P4/LINUX26X86_64/2022.1/2305383 (2022/06/28).

twarit-waikar commented 2 years ago

Could you please check what's the Perforce server version that you are using?

p4 changes does have a -r version according to the docs as you mentioned, however, the option being supported by the p4 CLI is a different thing than the option being supported by the server.

[ WARNING @ Run:126 ] Retrying: p4 changes -l -s submitted -r //src/...

One way to test that would be to copy the command printed after the Retrying: phrase and try to run it externally through your p4 CLI in a terminal.

p4-fusion has logged the message in such a way that the commands are easy to read, however, p4-fusion is not using the p4 CLI and instead, it is utilising the Helix Core C++ APIs.

twarit-waikar commented 2 years ago

Also, you may have to use p4 -p $P4PORT changes... in case you use an alternate P4PORT to run p4-fusion

dgilbert101 commented 2 years ago

Thanks for the quick response. Then that is more than likely the issue, we are running an older version P4D/NTX64/2015.1/1252202 (2015/10/22). Its not worth upgrading at this point and time.

I can just continue to use git-p4 for the time being. Thanks again.

twaritwaikar commented 2 years ago

It should technically be possible to work around this limitation. Since -r is the only option that seemed to be unsupported, and the only thing it does is return the results in the reverse chronological order, there is a possibility to add the inversion logic to p4-fusion instead of depending on the server to do that same thing.

However, it is also a question of whether it is a good idea to support it for this particular use-case. I say we could do it, but would need extra time and effort.

(I am the same guy as the one who replied to the issue above, just a different account)

ppavacic commented 9 months ago

You can use my fork to solve this issue. If you are running old perforce version on the server you will get this issue. https://github.com/salesforce/p4-fusion/pull/71