discover branches

This commit is contained in:
Jeff Carr 2025-03-22 21:38:18 -05:00
parent 0bf8cc3d79
commit 27820d88f2
1 changed files with 17 additions and 0 deletions

View File

@ -11,6 +11,22 @@ import (
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
)
func (repo *Repo) AllCommits() {
tags := []string{"cd", "%(creatordate)", "%(*authordate)", "%(refname)", "%(subject)"}
format := strings.Join(tags, "_,,,_%")
cmd = []string{"git", "log", "--format=%cd"}
result = shell.PathRunQuiet(repo.FullPath, cmd)
if result.Error != nil {
log.Warn("git for-each-ref error:", result.Error)
return result.Error
}
newest := strings.Join(result.Stdout, "\n")
newest = strings.TrimSpace(newest)
tmp := getGitDateStamp(newest)
repo.Times.NewestCommit = timestamppb.New(tmp)
}
// reload the tags
func (repo *Repo) reloadGitTags() error {
// todo: look for changes in the tags?
@ -74,6 +90,7 @@ func (repo *Repo) reloadGitTags() error {
// good format for insuring the hashs are identical when using git am
// git log -1 --format="%H %aI %cI %an %ae %cn %ce"
// also set the repo.NewestCommit
cmd = []string{"git", "log", "-1", "--format=%cd"}
result = shell.PathRunQuiet(repo.FullPath, cmd)
if result.Error != nil {