我試着在回購站上運行git p4提交,我一直在作爲git和perforce之間的過渡橋運行。多人使用回購作爲遠程,並定期提交回執行。git p4提交失敗
它一直工作得很好,除了一些重複的perforce提交的奇怪的行爲,我似乎無法重現。然後有一天,我得到這個錯誤。我不能再推任何git提交來執行。
[email protected]:~/Source/code$ git p4 submit -M --export-labels
Perforce checkout for depot path //depot/perforce/workspace/ located at /home/user/Source/git-p4-area/perforce/workspace/
Synchronizing p4 checkout...
... - file(s) up-to-date.
Applying ffa390f comments in config xml files
//depot/perforce/workspace/sub/folder/structure/first.xml#3 - opened for edit
//depot/perforce/workspace/sub/folder/structure/second.xml#3 - opened for edit
//depot/perforce/workspace/sub/folder/structure/third.xml#3 - opened for edit
//depot/perforce/workspace/sub/folder/structure/forth.xml#3 - opened for edit
//depot/perforce/workspace/sub/folder/structure/fifth.xml#1 - opened for edit
error: patch failed: sub/folder/structure/first.xml:1
error: sub/folder/structure/first.xml: patch does not apply
error: patch failed: sub/folder/structure/second.xml:1
error: sub/folder/structure/second.xml: patch does not apply
error: patch failed: sub/folder/structure/third.xml:1
error: sub/folder/structure/third.xml: patch does not apply
error: patch failed: sub/folder/structure/forth.xml:1
error: sub/folder/structure/forth.xml: patch does not apply
error: patch failed: sub/folder/structure/fifth.xml:1
error: sub/folder/structure/fifth.xml: patch does not apply
Unfortunately applying the change failed!
//depot/perforce/workspace/sub/folder/structure/first.xml#1 - was edit, reverted
//depot/perforce/workspace/sub/folder/structure/second.xml#3 - was edit, reverted
//depot/perforce/workspace/sub/folder/structure/third.xml#3 - was edit, reverted
//depot/perforce/workspace/sub/folder/structure/forth.xml#3 - was edit, reverted
//depot/perforce/workspace/sub/folder/structure/fifth.xml#3 - was edit, reverted
No commits applied.
該錯誤看起來很像這個錯誤:
git-p4 submit fails with patch does not apply
除了我沒有做任何關鍵字替換,所以我不知道它可能是什麼。加入--verbose
似乎沒有幫助解釋很多(我手邊沒有那個命令輸出)
我能想象的唯一變化就是我添加了一個.gitattributes文件,其中包含以下內容作出承諾。然而,均屬此之前提交,而gitattributes文件已經到位沒有工作,所以它不可能是(我以來取得的.gitattributes文件更詳細)
* text eol=lf
我試圖回滾做在此違規提交之前提交此遠程倉庫,然後將它們從我的倉庫中重新裝入此遠程倉庫,然後重新提交。同樣的行爲。我嘗試回滾,並對同一文件進行不同的編輯,重新編排,重新提交。同樣的行爲。它似乎只發生在這些文件。自回滾以來,我試圖對其他文件進行編輯,並且它們可以正常工作。我試圖運行dos2unix來強制unix行結束在違規的文件,並沒有解決它。
什麼命令可以讓我更好地解釋這裏發生了什麼?有一個我可以尾巴的git日誌文件嗎?任何援助將不勝感激。
編輯:我重新測試了我的問題,沒有.gitattributes文件。這沒有什麼區別。目前我的全局core.autocrlf設置是輸入。但是.gitattributes文件丟失似乎沒有什麼區別。下面是當我用--verbose
打開的其中一個違規文件重新測試它時的樣子。
[email protected]:/code$ git p4 submit -M --export-labels --verbose
Reading pipe: git name-rev HEAD
Reading pipe: ['git', 'config', 'git-p4.allowSubmit']
Reading pipe: git rev-parse --symbolic --remotes
Reading pipe: git rev-parse p4/master
Reading pipe: git cat-file commit 0457c7589ea679dcc0c9114b34f8f30bc2ee08cf
Reading pipe: git cat-file commit HEAD~0
Reading pipe: git cat-file commit HEAD~1
Reading pipe: ['git', 'config', 'git-p4.conflict']
Origin branch is remotes/p4/master
Reading pipe: ['git', 'config', '--bool', 'git-p4.useclientspec']
Opening pipe: ['p4', '-G', 'where', '//depot/perforce/workspace/...']
Perforce checkout for depot path //depot/perforce/workspace/ located at /home/user/Source/git-p4-area/perforce/workspace/
Synchronizing p4 checkout...
... - file(s) up-to-date.
Opening pipe: p4 -G opened ...
Reading pipe: ['git', 'rev-list', '--no-merges', 'remotes/p4/master..master']
Reading pipe: ['git', 'config', '--bool', 'git-p4.skipUserNameCheck']
Reading pipe: ['git', 'config', 'git-p4.detectCopies']
Reading pipe: ['git', 'config', '--bool', 'git-p4.detectCopiesHarder']
Reading pipe: ['git', 'show', '-s', '--format=format:%h %s', 'ef3b95f5fec193fe2612b28e2e3b5e7f8ba9419e']
Applying ef3b95f making test change
Opening pipe: p4 -G users
Reading pipe: ['git', 'log', '--max-count=1', '--format=%ae', 'ef3b95f5fec193fe2612b28e2e3b5e7f8ba9419e']
Reading pipe: git diff-tree -r -M "ef3b95f5fec193fe2612b28e2e3b5e7f8ba9419e^" "ef3b95f5fec193fe2612b28e2e3b5e7f8ba9419e"
//depot/perforce/workspace/sub/folder/structure/first.xml#3 - opened for edit
<stdin>:17: trailing whitespace.
<!-- comment line 1 -->
<stdin>:18: trailing whitespace.
<!-- comment line 2 -->
<stdin>:19: trailing whitespace.
<!-- comment line 3 -->
error: patch failed: sub/folder/structure/first.xml:1
error: sub/folder/structure/first.xml: patch does not apply
Unfortunately applying the change failed!
Reading pipe: ['git', 'config', '--bool', 'git-p4.attemptRCSCleanup']
//depot/perforce/workspace/sub/folder/structure/first.xml#3 - was edit, reverted
No commits applied.
Reading pipe: ['git', 'config', '--bool', 'git-p4.exportLabels']
Opening pipe: ['p4', '-G', 'labels', '//depot/ipstor.maple/automation/...']
Reading pipe: ['git', 'tag']
Reading pipe: ['git', 'config', 'git-p4.labelExportRegexp']
我想'git diff-tree -r -M「ef3b95f5fec193fe2612b28e2e3b5e7f8ba9419e ^」「ef3b95f5fec193fe2612b28e2e3b5e7f8ba9419e」'看看你是否可以手動應用補丁? – 2013-04-12 08:24:04