GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — New core type: GitCommit · Issue #13086 · dagger/dagger Closed DescriptionProblemThe core Git API currently models branches, tags, HEAD, and commit IDs through But commit metadata does not belong directly on Today this leaves no clean place to expose commit details such as committer date, author date, message, parent SHAs, or the semver release tag associated with a commit. SolutionAdd a extend type GitRepository { """Returns details of a commit.""" commit(id: String!): GitCommit! } extend type GitRef { """The commit this ref resolves to.""" asCommit: GitCommit! } """An immutable git commit.""" type GitCommit { """The full commit SHA.""" sha: String! """The abbreviated commit SHA.""" shortSha: String! """Git author date, in RFC3339 format.""" authoredDate: String! """Git committer date, in RFC3339 format.""" committedDate: String! """Git author name.""" authorName: String! """Git author email.""" authorEmail: String! """Git committer name.""" committerName: String! """Git committer email.""" committerEmail: String! """Full commit message.""" message: String! """First line of the commit message.""" messageHeadline: String! """Commit message body, excluding the headline.""" messageBody: String! """Parent commit SHAs.""" parentShas: [String!]! """The filesystem tree at this commit.""" tree( discardGitDir: Boolean = false depth: Int = 1 includeTags: Boolean = false ): Directory! """Highest semver tag pointing directly at this commit, if any.""" releaseTag(includePreRelease: Boolean = false): GitRef """Highest semver tag reachable from this commit, if any.""" ancestorReleaseTag(includePreRelease: Boolean = false): GitRef }
Release Tags
“Highest” means semver order, not newest tag date or closest ancestor. If multiple semver tags point at the same commit, the highest semver tag wins. By default, pre-release tags are ignored. When Tag lookup should be pure and reusable across Do not implement this with Instead, build an effective tag set by reconciling local tags with remote tags:
Compare peeled commit SHAs, not raw tag object SHAs, so annotated tags do not produce false conflicts. For local repositories, choose the remote the same way For remote Ancestor lookup may fetch commit objects needed for reachability checks, but it must not fetch tags into local tag refs. Example{
git(url: "https://github.com/dagger/dagger") {
head {
ref
commit
asCommit {
committedDate
messageHeadline
releaseTag {
ref
}
ancestorReleaseTag(includePreRelease: true) {
ref
}
}
}
commit(id: "b6315d8f2810962c601af73f86831f6866ea798b") {
sha
authoredDate
committedDate
parentShas
}
}
}Workspace git composes through the same commit API: {
currentWorkspace {
git {
head {
asCommit {
releaseTag {
ref
}
ancestorReleaseTag {
ref
}
}
}
}
}
}LazinessScalar fields on
Release tag lookup should not checkout the tree or mutate Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |