Github GraphQl-如何获取标签之间的提交列表 [英] Github GraphQl - How to get a list of commits between tags
问题描述
使用Github GraphQL我想回答这个问题:
在版本/标签之间,哪些提交已合并到master中?
结果应类似于此问题的结果获取之间的提交列表如果要在命令行上使用,请在Git中添加标签.
我正在使用开发人员资源管理器,想知道我是否可以通过单个查询执行此操作,或者是否需要多个查询.我尝试了以下操作,但是它没有给我未标记的标签之间的提交,只是没有标记的提交.
{信息库(所有者:"CoolCompany",名称:"awesome-new-ui"){refs(refPrefix:"refs/tags/",第一个:2,orderBy:{field:TAG_COMMIT_DATE,方向:DESC}){边缘{节点{ID名称目标 {oid...提交时{作者 {日期电子邮件名称}信息}}}}}}}
来自Github GraphQL社区的
@ lee-dohm帮助我找到了已发布的解决方案 第2步:使用createdAt中的值(与发行版或标签相关联),然后执行以下操作: With Github GraphQL I want to answer the question: What commits have been merged into master between releases/tags? The result should be similar to the results for this question Get commit list between tags in Git if I were to do it on the command line. I'm using the developer explorer and wondering if I will be able to do this with a single query or if I will need several. I tried the following but it does not give me the commits between tags that have not been tagged, just the tagged commits.
@lee-dohm from the Github GraphQL community helped me arrive at a solution which is posted here I can paste my solution here as well. It seems this problem is not solve-able with a single query, but it can be done with 2 that work in conjunction with each other: Step 1: Get the most recent release information. You could modify this for tags as well. Step 2: Use the value from the createdAt (associated with the release or tag) and do this:
这篇关于Github GraphQl-如何获取标签之间的提交列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
{存储库(所有者:"CoolCompany",名称:"awesome-ui"){nameWithOwner对象(表达式:主"){...提交时{oid历史记录(第一个:100,因为:"$ createdAtDate"){节点{oidmessageHeadline作者 {用户{登录}}承诺日期}}}}}}
{
repository(owner: "CoolCompany", name: "awesome-new-ui") {
refs(refPrefix: "refs/tags/", first: 2, orderBy: {field: TAG_COMMIT_DATE, direction: DESC}) {
edges {
node {
id
name
target {
oid
... on Commit {
author {
date
email
name
}
message
}
}
}
}
}
}
}
{
repository(owner: "CoolCompany", name: "awesome-ui") {
releases(last: 1) {
edges{
node{
tagName
createdAt
}
}
}
}
}
{
repository(owner: "CoolCompany", name: "awesome-ui") {
nameWithOwner
object(expression: "master") {
... on Commit {
oid
history(first: 100, since: "$createdAtDate") {
nodes {
oid
messageHeadline
author {
user {
login
}
}
committedDate
}
}
}
}
}
}