From 3a785450da34c9e9bf711496d1c0b58b4c6c515a Mon Sep 17 00:00:00 2001 From: Gusted Date: Sun, 23 Jan 2022 19:20:51 +0100 Subject: [PATCH 1/4] Fix commit's time - Use the Committer's `when` as the CommitDate will be modified when the commit is being moved around in the git tree(e.g. being rebased on top of newer commits). The Author's `when` is created once and never touched again. --- templates/repo/view_list.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 870bbb92e84e4..7f6891d62998e 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -34,7 +34,7 @@ {{end}} - {{if .LatestCommit}}{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}{{end}} + {{if .LatestCommit}}{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Committer.When $.Lang}}{{end}}{{end}} From 2270e1301561c793449980afe6f67f1de07ad721 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 23 Jan 2022 19:39:21 +0000 Subject: [PATCH 2/4] Update templates/repo/view_list.tmpl --- templates/repo/view_list.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 7f6891d62998e..b123096777e3a 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -34,7 +34,7 @@ {{end}} - {{if .LatestCommit}}{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Committer.When $.Lang}}{{end}}{{end}} + {{if .LatestCommit}}{{if .LatestCommit.Committer}}{{TimeSince .LatestCommit.Committer.When $.Lang}}{{end}}{{end}} From 21a9e9efc86c155e78b988f52bd87d0838200bd8 Mon Sep 17 00:00:00 2001 From: Gusted Date: Sun, 23 Jan 2022 20:44:53 +0100 Subject: [PATCH 3/4] Commmt unstaged --- templates/repo/commits_list.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 7bc37175c2b88..d9547c1522bb1 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -75,7 +75,7 @@ {{end}} - {{TimeSince .Author.When $.Lang}} + {{TimeSince .Committer.When $.Lang}} {{end}} From 9a8665c629d4a9d935fccae702b562006939701a Mon Sep 17 00:00:00 2001 From: Gusted Date: Mon, 24 Jan 2022 20:47:44 +0100 Subject: [PATCH 4/4] Add fallback --- templates/repo/commits_list.tmpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index d9547c1522bb1..e8ac4020f44e0 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -75,7 +75,11 @@ {{end}} - {{TimeSince .Committer.When $.Lang}} + {{if .Committer}} + {{TimeSince .Committer.When $.Lang}} + {{else}} + {{TimeSince .Author.When $.Lang}} + {{end}} {{end}}