summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-21 09:14:01 -0600
committerJeff Carr <[email protected]>2025-02-21 09:14:01 -0600
commit3f1c8bf5c28a8cbff50b56367954d5daf4ad0bcc (patch)
treeecf8a31edf5b7b8ffb3c9e230ecad7129d396c80
parent135346af6a73a990ce0c094a275fe1073fe13436 (diff)
used for forge protobuf tables
-rw-r--r--gitTag.byAge.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/gitTag.byAge.go b/gitTag.byAge.go
index f5e3188..6c4a852 100644
--- a/gitTag.byAge.go
+++ b/gitTag.byAge.go
@@ -87,6 +87,25 @@ func (repo *Repo) NewestAge() time.Duration {
return time.Since(newest)
}
+func (repo *Repo) NewestTime() time.Time {
+ alltags := repo.Tags.selectAllGitTags()
+
+ var newest time.Time
+
+ for _, tag := range alltags {
+ // check the actual age of the patch
+ if newest.Before(tag.Authordate.AsTime()) {
+ newest = tag.Authordate.AsTime()
+ }
+ // check the age of the commit
+ if newest.Before(tag.Creatordate.AsTime()) {
+ newest = tag.Creatordate.AsTime()
+ }
+ }
+
+ return newest
+}
+
func (repo *Repo) NewestAgeVerbose() time.Duration {
alltags := repo.Tags.selectAllGitTags()