如何在gitweb上禁用相对日期显示?
如何阻止gitweb显示所有相关日期,例如:3天前、2周前、3天前、11天前、21小时前?当我想浏览一下,看看某个日期前后发生了什么变化,如果它们都是相对的,这会让我非常恼火。我找到的唯一方法就是破解源代码:如何在gitweb上禁用相对日期显示?,git,gitweb,git-config,Git,Gitweb,Git Config,如何阻止gitweb显示所有相关日期,例如:3天前、2周前、3天前、11天前、21小时前?当我想浏览一下,看看某个日期前后发生了什么变化,如果它们都是相对的,这会让我非常恼火。我找到的唯一方法就是破解源代码: --- gitweb.cgi.orig 2015-05-05 16:19:45.341774512 +0200 +++ gitweb.cgi 2015-05-05 16:22:53.437428996 +0200 @@ -3518,13 +3518,14 @@ $
--- gitweb.cgi.orig 2015-05-05 16:19:45.341774512 +0200
+++ gitweb.cgi 2015-05-05 16:22:53.437428996 +0200
@@ -3518,13 +3518,14 @@
$co{'age'} = $age;
$co{'age_string'} = age_string($age);
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = gmtime($co{'committer_epoch'});
- if ($age > 60*60*24*7*2) {
- $co{'age_string_date'} = sprintf "%4i-%02u-%02i", 1900 + $year, $mon+1, $mday;
- $co{'age_string_age'} = $co{'age_string'};
- } else {
- $co{'age_string_date'} = $co{'age_string'};
- $co{'age_string_age'} = sprintf "%4i-%02u-%02i", 1900 + $year, $mon+1, $mday;
- }
+# never use relative dates
+# if ($age > 60*60*24*7*2) {
+ $co{'age_string_date'} = sprintf "%4i-%02u-%02i", 1900 + $year, $mon+1, $mday;
+ $co{'age_string_age'} = $co{'age_string'};
+# } else {
+# $co{'age_string_date'} = $co{'age_string'};
+# $co{'age_string_age'} = sprintf "%4i-%02u-%02i", 1900 + $year, $mon+1, $mday;
+# }
return %co;
}
我不再让gitweb运行了。如果其他人想确认这项工作,我会标记它接受。