func GitDescribe(path string) (*RepoHead, error) {
	repo, err := git.PlainOpen(path)
	if err != nil {
		return nil, fmt.Errorf("failed to open repo: %w", err)
	}
	head, err := repo.Head()
	if err != nil {
		return nil, fmt.Errorf("failed to retrieve repo head: %w", err)
	}
	ref := RepoHead{
		Hash: head.Hash().String(),
	}
	tags, err := getTagMap(repo)
	if err != nil {
		return nil, fmt.Errorf("failed to retrieve tag-list: %w", err)
	}
	if tag, found := tags[ref.Hash]; found {
		ref.LastTag = tag
		return &ref, nil
	}
	commits, err := repo.Log(&git.LogOptions{
		From:  head.Hash(),
		Order: git.LogOrderCommitterTime,
	})
	if err != nil {
		return nil, fmt.Errorf("failed to list commits: %w", err)
	}
	_ = commits.ForEach(func(c *object.Commit) error {
		ref.LastTag = tags[c.Hash.String()]
		if ref.LastTag != "" {
			return storer.ErrStop
		}
		ref.CommitsSinceTag += 1
		return nil
	})
	return &ref, nil
}
GitDescribe looks at the git respository at path and figures
out versioning relvant information about the head commit.
package version
import (
	"fmt"
	"github.com/go-git/go-git/v5"
	"github.com/go-git/go-git/v5/plumbing"
	"github.com/go-git/go-git/v5/plumbing/object"
	"github.com/go-git/go-git/v5/plumbing/storer"
)
type RepoHead struct {
	LastTag         string
	CommitsSinceTag int
	Hash            string
}