2015-06-26 42 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