git-p4 提交失败,补丁不适用
当我执行以下操作时:
$ git-p4 submit
我最终得到以下错误跟踪:
error: patch failed: foo/bar/blah.h:1
error: foo/bar/blah.h: patch does not apply
Unfortunately applying the change failed!
What do you want to do?
[s]kip this patch / [a]pply the patch forcibly and with .rej files / [w]rite the patch to a file (patch.txt)
如何从这种情况中恢复并成功提交?
FWIW,我们的 P4 服务器配置为使用关键字扩展(文件类型 = text+k),并且问题文件的第 3 行有一个扩展关键字。我在第 1 行进行了更改。
我尝试删除第 1 行的增量,但当我重试 git-p4 提交时,错误仍然存在。
When I do the following:
$ git-p4 submit
I wind up with the following error trace:
error: patch failed: foo/bar/blah.h:1
error: foo/bar/blah.h: patch does not apply
Unfortunately applying the change failed!
What do you want to do?
[s]kip this patch / [a]pply the patch forcibly and with .rej files / [w]rite the patch to a file (patch.txt)
How can I recover from this situation and make a successful submission?
FWIW, our P4 server is configured to use keyword expansion (filetype = text+k) and there is an expanded keyword at line 3 of the problem file. I made a change at line 1.
I've tried removing the delta at line 1, but the error persists when I retry the git-p4 submit.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
发布这个问题后就弄清楚了。
诀窍是在 P4 背后隐藏关键字扩展。
这有效。
Figured it out just after posting this question.
The trick was going in behind P4's back and stripping out the keyword expansion.
This worked.
这也咬了我。另一种选择是通过 GUI 工具或命令行更改文件类型,使其不再是
text+k
或text+ko
文件类型(因此扩展不会不会发生)。如果你这样做,它就会提交成功。This bit me as well. The other option is to change the file type through the GUI tool or the command line so that it's no longer a
text+k
ortext+ko
file type (so expansion doesn't happen). If you do that, it will commit OK.