diff --git a/reloadTags.go b/reloadTags.go index 444dc86..37bc762 100644 --- a/reloadTags.go +++ b/reloadTags.go @@ -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 {