我在使用git-p4使用perforce设置git时遇到问题。在完成了这篇优秀的博客文章:http://owenou.com/2011/03/23/git-up-perforce-with-git-p4.html中的所有步骤之后,我尝试添加一个新文件/修改本地git存储库中的现有文件。
当我尝试改变基址时,我得到了:
$git-p4 rebase
Traceback (most recent call last):
File "/home/user/bin/git-p4", line 2362, in <module>
main()
File "/home/user/bin/git-p4", line 2357, in main
if not cmd.run(args):
File "/home/user/bin/git-p4", line 2051, in run
sync.run([])
File "/home/user/bin/git-p4", line 2004, in run
changes = self.p4.p4ChangesForPaths(self.depotPaths, self.changeRange)
File "/home/user/bin/git-p4", line 232, in p4ChangesForPaths
assert depotPaths
AssertionError 将更改提交到git并执行
git p4 submit --verbose
这应该会将更改推送到p4存储库,我得到了65534行输出:
Reading pipe: git notes --ref=git-p4 show HEAD~1
Reading pipe: git notes --ref=git-p4 show HEAD~2
[...]
Reading pipe: git notes --ref=git-p4 show HEAD~65534
Traceback (most recent call last):
File "/home/wgorski/opt/git-p4/git-p4", line 2754, in <module>
main()
File "/home/wgorski/opt/git-p4/git-p4", line 2749, in main
if not cmd.run(args):
File "/home/wgorski/opt/git-p4/git-p4", line 1125, in run
self.depotPath = settings['depot-paths'][0]
KeyError: 'depot-paths' 不用说,更改不会推送到p4存储库。
发布于 2012-09-12 16:38:03
问题出在git版本上。我安装了git 1.7.0,git-p4脚本需要git版本的>= 1.7.1。我建议更新到最新的git版本。
如果不能升级git,您可以将git-p4脚本降级为不使用注释的修订版,如下所示:
git checkout 994ec6ce71cb03786a27a77da77ac33a9e53e090 .
在降级git-p4之后,您需要从perforce中查看本地git存储库。
https://stackoverflow.com/questions/12367328
复制相似问题