github api比较提交,响应状态不同 [英] github api to compare commits, response status is diverged
问题描述
在配置詹金斯时,我想检测功能分支是否存在合并冲突,因此我使用github api v3在2个有意冲突的分支上进行测试.
When configuring jenkins, I want to detect feature branches whether they have merging conflicts, so I use github api v3 to test on 2 intentional conflicted branches.
将branch1合并为master之后,我像这样比较了branch2(b2):
After merge branch1 to master, I compared branch2(b2) like this:
curl -i https://api.github.com/repos/hao1987/myself/compare/hao1987:master...hao1987:b2
,它返回一个具有属性的长json:
and it returns a long json which has an attribute:
"status": "diverged"
我想知道这是否意味着冲突,我可以在哪里尝试使用状态"类型
I wonder if that means conflict, and where I can try types of "status"
推荐答案
此文档未记录(很抱歉!),但是status
可以是以下四种情况之一:
This isn't documented (sorry!), but status
can be one of four things:
-
"diverged"
=自共同祖先以来,头和基分支上都引入了提交 -
"ahead"
=在具有基础的共同祖先之后在头上引入了提交 -
"behind"
=提交是在具有共同头祖的基础上引入的 -
"identical"
=分支指向同一提交
"diverged"
= commits were introduced on both the head and base branch since the common ancestor"ahead"
= commits were introduced on head after the common ancestor with base"behind"
= commits were introduced on base after the common ancestor with head"identical"
= branches point to same commit
因此,"diverged"
不会告诉您分支之间的合并是否会导致合并冲突.
So, "diverged"
doesn't tell you whether a merge between the branches would result in merge conflicts.
这篇关于github api比较提交,响应状态不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!