git-p4 should memorize the relevant P4* variables during 'git p4 clone' instead of requiring them again for sync/sumbit operations
- From
- Yuri <yuri@rawbw.com>
- Date
- Nov 17, 2022, 08:09 UTC
- Message-ID
- <de2e1474-e044-72d2-1553-5943c7cdcbd4@tsoft.com>
Currently 'git p4 submit' requires the variable P4CLIENT to be exactly same as it was during 'git p4 clone'. When people have multiple repositiories it is easy to confuse P4CLIENT and this leads to strange cryptic errors and repository becoming unusable.
I suggest to improve git-p4: it should memorize the P4CLIENT value during 'git p4 clone' and use the same value when in calls the p4 executable regardless of what P4CLIENT value is actually set.
'git p4 submit' and 'git p4 sync' should probably also require the repository to have the same path as it had during 'git p4 clone', because this is what the P4 client is tied to.
This would make git-p4 a lot less error prone due to mismatching P4CLIENT values.
It is easy for users to confuse P4CLIENT and run 'git p4 xx' from a wrong (mismatching) repository, causing errors difficult to recover from.
Thanks,
Yuri