git-p4提交失败,补丁不适用 [英] git-p4 submit fails with patch does not apply

查看:307
本文介绍了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,我们的P4服务器被配置为使用关键字扩展(filetype = text + k),并且在问题文件的第3行有一个扩展关键字。我在第1行进行了修改。

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.

我尝试删除第1行的delta,但是当我重试git-p4提交时,错误仍然存​​在。

I've tried removing the delta at line 1, but the error persists when I retry the git-p4 submit.

推荐答案

在发布这个问题之后发现它。

Figured it out just after posting this question.

在后面的P4后面,并删除关键字扩展。

The trick was going in behind P4's back and stripping out the keyword expansion.

chmod +w foo/bar/blah.h
edit foo/bar/blah.h #change $File: //depot/foo/bar/blah.h$ to $File$
chmod -w foo/bar/blah.h
git-p4 submit

这有效。

这篇关于git-p4提交失败,补丁不适用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆