2015-06-26 49 views
2

我想寫一個腳本,自動git櫻桃挑。我需要能夠處理所有可能的git cherry-pick失敗。到目前爲止,我已經計算了3種輸出:git:不同的可能輸出櫻桃挑

+櫻桃挑選成功,沒有合併衝突。退出代碼爲0.輸出如下所示:

git cp ed54dfc 
[dev/nango/cp3_nocconflict 97f2dce] test cp1 
1 file changed, 1 insertion(+) 
create mode 100644 foo.txt 

+ Cherry-pick提交已經在分支中,或者沒有提交代碼。退出代碼1.輸出如下:

You are currently cherry-picking commit 61ff477. 


It took 3.90 seconds to enumerate untracked files. 'status -uno' 
may speed it up, but you have to be careful not to forget to add 
new files yourself (see 'git help status'). 
nothing to commit, working directory clean 
The previous cherry-pick is now empty, possibly due to conflict resolution. 
If you wish to commit it anyway, use: 

git commit --allow-empty 

Otherwise, please use 'git reset' 

+ Cherry-pick引發合併衝突。退出代碼1:

error: could not apply ed54dfc... test cp1 
hint: after resolving the conflicts, mark the corrected paths 
hint: with 'git add <paths>' or 'git rm <paths>' 
hint: and commit the result with 'git commit' 

是否有任何其他的櫻桃採摘的可能性?我看看文檔,關於櫻桃挑選的可能結果沒有太多提及。

謝謝。

回答

1