Repository navigation
source: add raw commit/tag object access to resolveMetadata - #6298
Merged
Merged
Conversation
tonistiigi
force-pushed
the
git-object-resolve
branch
from
October 17, 2025 03:31
2c97380 to
b29f018
Compare
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
tonistiigi
force-pushed
the
git-object-resolve
branch
from
October 17, 2025 23:45
b29f018 to
5e410ed
Compare
tonistiigi
marked this pull request as ready for review
October 18, 2025 19:37
crazy-max
reviewed
Oct 20, 2025
| Message string | ||
| } | ||
|
|
||
| func Parse(raw []byte) (*GitObject, error) { |
Member
There was a problem hiding this comment.
Wonder if we could use https://github.com/go-git/go-git to parse objects?
Member
There was a problem hiding this comment.
Seems we could just use the plumbing package if it's not too heavy: https://github.com/go-git/go-git/blob/0fe67ec8dc1d6474b430fefe415737dbe8211f89/plumbing/object.go#L42-L47
import (
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
)
...
obj := &plumbing.MemoryObject{}
obj.SetType(plumbing.CommitObject)
obj.SetSize(int64(len(raw)))
w, _ := obj.Writer()
w.Write(raw)
w.Close()
commit, err := object.DecodeCommit(obj)
Member
Author
There was a problem hiding this comment.
I think it is too heavy.
crazy-max
approved these changes
Oct 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
depends on #6293
When calling
ResolveSourceMetadataon Git source, ifReturnObjectis set then raw commit and tag objects are returned with the response for more detailed inspection.