Open gcstang opened 2 years ago
To help us keep things tidy and focus on the active tasks, we've introduced a stale bot to spot issues/PRs that haven't had any activity in a while.
This particular issue hasn't had any updates or activity in the past 90 days, so it's been labeled as 'stale'. If it remains inactive for the next 30 days, it'll be automatically closed.
We understand everyone's busy, but if this issue is still important to you, please feel free to add a comment or make an update to keep it active.
Thanks for your understanding and cooperation!
For convenience we'll say the tag is
v0.0.2
in this documentI can pull all tags using and loop through them
tagrefs, err := repo.Tags()
looping using this provides a name for the plumbing.Reference Hash
tagrefs.ForEach(func(t *plumbing.Reference) error {
obj, err := repo.TagObject(t.Hash())
Here obj.Name == v0.0.2 and t.Hash() == 2cd76ba792107c08dd8156a96e3468b8304b6649Now I need to loop commits and for a hash find if there's a tag name
iter.ForEach(func(c *object.Commit) error {
If I print this
c.ID().String()
the value is 73dfadc751909a6053b91f5774a2b55c9f04cf44 it matches the value returned when I do this with the tag name I captured priorstartHash, err := repo.ResolveRevision(plumbing.Revision("v0.0.2"))
if I print startHash the value is 73dfadc751909a6053b91f5774a2b55c9f04cf44However using the c.ID() in this doesn't provide a value even though it's the same printed hash
obj, err := repo.TagObject(c.ID())