aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/html
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-03-21 09:28:25 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-03-21 09:32:46 +0100
commitf6094a8c64442f7933534128c20f03b726cfed5d (patch)
treee5cc766209634fef7c93998363e8f932883418c2 /pkg/html
parent2cc9698b581838c88ccc6ca36fe3bbd1c458ec4d (diff)
dashboard/app: use 12-char hash in Fixes tags
@ebiggers pointed out that Fixes tags should use 12-char hash: https://groups.google.com/d/msg/syzkaller-bugs/yUhRrLD6T6A/3TMwOWvWAgAJ I can't find any documentation on this, but it looks like most existing tags follow this convention so use 12-char hashes.
Diffstat (limited to 'pkg/html')
-rw-r--r--pkg/html/html.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/html/html.go b/pkg/html/html.go
index a07de81d2..1c48f6d51 100644
--- a/pkg/html/html.go
+++ b/pkg/html/html.go
@@ -47,6 +47,7 @@ var Funcs = template.FuncMap{
"formatReproLevel": formatReproLevel,
"formatStat": formatStat,
"formatShortHash": formatShortHash,
+ "formatTagHash": formatTagHash,
"formatCommitTableTitle": formatCommitTableTitle,
"formatList": formatStringList,
}
@@ -142,6 +143,15 @@ func formatShortHash(v string) string {
return v[:hashLen]
}
+func formatTagHash(v string) string {
+ // Note: Fixes/References commit tags should include 12-char hash. Don't change this const.
+ const hashLen = 12
+ if len(v) <= hashLen {
+ return v
+ }
+ return v[:hashLen]
+}
+
func formatCommitTableTitle(v string) string {
// This function is very specific to how we format tables in text emails.
// Truncate commit title so that whole line fits into 78 chars.