# git-p4 should memorize the relevant P4* variables during 'git p4 clone' instead of requiring them again for sync/sumbit operations

1 messages from 2022-11-17 to 2022-11-17. Participants: Yuri.
Thread: https://gitlist.dev/t/58809

## Yuri, 2022-11-17 08:09

Subject: git-p4 should memorize the relevant P4* variables during 'git p4 clone' instead of requiring them again for sync/sumbit operations
Message-ID: <de2e1474-e044-72d2-1553-5943c7cdcbd4@tsoft.com>
URL: https://gitlist.dev/e/de2e1474-e044-72d2-1553-5943c7cdcbd4%40tsoft.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



```
