From c2542645325fc9ff477aa8edf9805108a42a94d8 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 7 Oct 2026 08:49:56 -0700 Subject: [PATCH 1/5] [dashboard] Render vertical commit hash headers --- dashboard/dashboard.go | 55 +++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/dashboard/dashboard.go b/dashboard/dashboard.go index 3eae2cc3e..77abd2bda 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -142,7 +142,7 @@ func saveCache(path string, cache map[string]statusLine) { } } -func fetchCommits(repoPath string) map[string]int { +func fetchCommits(repoPath string) ([]string, map[string]int) { if _, err := os.Stat(filepath.Join(repoPath, "HEAD")); err == nil { cmd := exec.Command("git", "--git-dir="+repoPath, "fetch", "-u", "--no-tags", "--filter=tree:0", "origin", "+main:main") if out, err := cmd.CombinedOutput(); err != nil { @@ -153,13 +153,13 @@ func fetchCommits(repoPath string) map[string]int { cmd := exec.Command("git", "clone", "--bare", "--no-tags", "--filter=tree:0", "--depth=10000", "--single-branch", "-b", "main", "https://github.com/llvm/llvm-project.git", repoPath) if out, err := cmd.CombinedOutput(); err != nil { fmt.Fprintf(os.Stderr, "git clone failed: %v: %s\n", err, out) - return nil + return nil, nil } } out, err := exec.Command("git", "--git-dir="+repoPath, "rev-list", "-n", "10000", "main").Output() if err != nil { fmt.Fprintf(os.Stderr, "git rev-list failed: %v\n", err) - return nil + return nil, nil } hashes := strings.Fields(string(out)) topCommit := "" @@ -171,7 +171,7 @@ func fetchCommits(repoPath string) map[string]int { for i, h := range hashes { commits[h] = i } - return commits + return hashes, commits } func mergeStatusLine(fresh, cached statusLine) statusLine { @@ -499,6 +499,7 @@ h2 { margin: .25em 0 0 0; font-size: 110%; } .missing { color: #444; } .missing.symbol::before { content: "\00b7"; font-family: 'Inconsolata', monospace; font-weight: bold;} .symbol { display: inline-block; width: 1ch; text-align: center; } +.commit { display: inline-block; writing-mode: vertical-rl; font-size: 12px; line-height: 12px; color: #888; } table { width: 100%; } @@ -570,7 +571,7 @@ $(function() { errors[status.n] = status.err } saveCache(cachePath, cache) - commits := fetchCommits(filepath.Join(*cacheDir, "llvm-project.git")) + hashes, commits := fetchCommits(filepath.Join(*cacheDir, "llvm-project.git")) maxDist := 0 for i := range bots { @@ -588,25 +589,41 @@ $(function() { } } - for i := range bots { - if !statuses[i].Lastbuild.IsZero() && time.Since(statuses[i].Lastbuild) > 7*24*time.Hour { - continue - } + tr := func(s string) string { + return fmt.Sprintf("%s", s) + } - tr := func(s string) string { - return fmt.Sprintf("%s", s) - } + td := func(attrs string, s string) string { + return fmt.Sprintf("%s", attrs, s) + } - td := func(attrs string, s string) string { - return fmt.Sprintf("%s", attrs, s) - } + span := func(class string, s string) string { + return fmt.Sprintf("%s", class, s) + } - span := func(class string, s string) string { - return fmt.Sprintf("%s", class, s) + a := func(url string, text string) string { + return fmt.Sprintf("%s", url, text) + } + + if len(hashes) > 0 { + var header strings.Builder + for d := 0; d <= maxDist && d < len(hashes); d++ { + h := hashes[d] + short := h + if len(short) > 7 { + short = short[:7] + } + commitUrl := "https://github.com/llvm/llvm-project/commit/" + h + fmt.Fprintf(&header, "%s", + commitUrl, h, d, span("symbol", span("commit", short))) } + r := td("", "") + td("", "") + td("", "") + td("class=\"timeline\"", header.String()) + fmt.Println(tr(r)) + } - a := func(url string, text string) string { - return fmt.Sprintf("%s", url, text) + for i := range bots { + if !statuses[i].Lastbuild.IsZero() && time.Since(statuses[i].Lastbuild) > 7*24*time.Hour { + continue } class := func(s status) string { From e810ed8b441a4e2e6ff8fb29b9ce726450140f19 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 7 Oct 2026 09:11:53 -0700 Subject: [PATCH 2/5] fixup! [dashboard] Render vertical commit hash headers --- dashboard/dashboard.go | 93 ++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 39 deletions(-) diff --git a/dashboard/dashboard.go b/dashboard/dashboard.go index 77abd2bda..0d5e03215 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -142,7 +142,12 @@ func saveCache(path string, cache map[string]statusLine) { } } -func fetchCommits(repoPath string) ([]string, map[string]int) { +type commitInfo struct { + Hash string + Title string +} + +func fetchCommits(repoPath string) ([]commitInfo, map[string]int) { if _, err := os.Stat(filepath.Join(repoPath, "HEAD")); err == nil { cmd := exec.Command("git", "--git-dir="+repoPath, "fetch", "-u", "--no-tags", "--filter=tree:0", "origin", "+main:main") if out, err := cmd.CombinedOutput(); err != nil { @@ -156,22 +161,33 @@ func fetchCommits(repoPath string) ([]string, map[string]int) { return nil, nil } } - out, err := exec.Command("git", "--git-dir="+repoPath, "rev-list", "-n", "10000", "main").Output() + out, err := exec.Command("git", "--git-dir="+repoPath, "log", "-n", "10000", "--format=%H\t%s", "main").Output() if err != nil { - fmt.Fprintf(os.Stderr, "git rev-list failed: %v\n", err) + fmt.Fprintf(os.Stderr, "git log failed: %v\n", err) return nil, nil } - hashes := strings.Fields(string(out)) - topCommit := "" - if len(hashes) > 0 { - topCommit = hashes[0] + lines := strings.Split(strings.TrimSpace(string(out)), "\n") + var list []commitInfo + commits := make(map[string]int, len(lines)) + for _, line := range lines { + if line == "" { + continue + } + parts := strings.SplitN(line, "\t", 2) + h := parts[0] + title := "" + if len(parts) > 1 { + title = parts[1] + } + commits[h] = len(list) + list = append(list, commitInfo{Hash: h, Title: title}) } - fmt.Fprintf(os.Stderr, "Loaded %d commits from %s (top: %s)\n", len(hashes), repoPath, topCommit) - commits := make(map[string]int, len(hashes)) - for i, h := range hashes { - commits[h] = i + topCommit := "" + if len(list) > 0 { + topCommit = list[0].Hash } - return hashes, commits + fmt.Fprintf(os.Stderr, "Loaded %d commits from %s (top: %s)\n", len(list), repoPath, topCommit) + return list, commits } func mergeStatusLine(fresh, cached statusLine) statusLine { @@ -499,7 +515,8 @@ h2 { margin: .25em 0 0 0; font-size: 110%; } .missing { color: #444; } .missing.symbol::before { content: "\00b7"; font-family: 'Inconsolata', monospace; font-weight: bold;} .symbol { display: inline-block; width: 1ch; text-align: center; } -.commit { display: inline-block; writing-mode: vertical-rl; font-size: 12px; line-height: 12px; color: #888; } +.commit { display: inline-block; writing-mode: sideways-lr; font-size: 12px; line-height: 12px; color: #888; } +.symbol:has(.commit) { vertical-align: top; } table { width: 100%; } @@ -517,7 +534,6 @@ $(function() { - `) cachePath := filepath.Join(*cacheDir, "cache.json") @@ -571,7 +587,16 @@ $(function() { errors[status.n] = status.err } saveCache(cachePath, cache) - hashes, commits := fetchCommits(filepath.Join(*cacheDir, "llvm-project.git")) + commitList, commits := fetchCommits(filepath.Join(*cacheDir, "llvm-project.git")) + + fmt.Print(`

go/dynamic-tools-dashboard, `) + tz, err := time.LoadLocation("America/Los_Angeles") + if err != nil { + fmt.Println("err: ", err.Error()) + } + fmt.Println(time.Now().In(tz).Format("2006-Jan-2 15:04:05 MST")) + fmt.Println(`

+
`) maxDist := 0 for i := range bots { @@ -605,22 +630,6 @@ $(function() { return fmt.Sprintf("%s", url, text) } - if len(hashes) > 0 { - var header strings.Builder - for d := 0; d <= maxDist && d < len(hashes); d++ { - h := hashes[d] - short := h - if len(short) > 7 { - short = short[:7] - } - commitUrl := "https://github.com/llvm/llvm-project/commit/" + h - fmt.Fprintf(&header, "%s", - commitUrl, h, d, span("symbol", span("commit", short))) - } - r := td("", "") + td("", "") + td("", "") + td("class=\"timeline\"", header.String()) - fmt.Println(tr(r)) - } - for i := range bots { if !statuses[i].Lastbuild.IsZero() && time.Since(statuses[i].Lastbuild) > 7*24*time.Hour { continue @@ -709,15 +718,21 @@ $(function() { } fmt.Println(tr(r)) } - fmt.Println(`
`) - fmt.Println(`

go/dynamic-tools-dashboard, `) - tz, err := time.LoadLocation("America/Los_Angeles") - if err != nil { - fmt.Println("err: ", err.Error()) + + if len(commitList) > 0 { + var footer strings.Builder + for d := 0; d <= maxDist && d < len(commitList); d++ { + c := commitList[d] + escapedTitle := html.EscapeString(c.Title) + commitUrl := "https://github.com/llvm/llvm-project/commit/" + c.Hash + fmt.Fprintf(&footer, "%s", + commitUrl, c.Hash, d, escapedTitle, span("symbol", span("commit", escapedTitle))) + } + r := td("", "") + td("", "") + td("", "") + td("class=\"timeline\"", footer.String()) + fmt.Println(tr(r)) } - fmt.Println(time.Now().In(tz).Format("2006-Jan-2 15:04:05 MST")) - fmt.Println(` -

+ + fmt.Println(` `) From 3e62339de21d808e2541875ea76f9bd57589ecca Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 7 Oct 2026 09:22:04 -0700 Subject: [PATCH 3/5] fixup! [dashboard] Render vertical commit hash headers --- dashboard/dashboard.go | 53 +++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/dashboard/dashboard.go b/dashboard/dashboard.go index 0d5e03215..32750cd1f 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -497,7 +497,9 @@ func main() {