Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Open one file at a time on the commit page

628d45239eb09af4e46c9dc779d30144e96c7e6f · Keenan Nemetz · 11d ago · parent 816cc543

Open one file at a time on the commit page

A commit page rendered every patch it contained, so a broad commit turned one
page load into every blob it touched. It now opens the file tree beside the diff
of a single file, the same shape a change request's Files tab uses: the tree is
built from `git show --name-status`, only the selected path's patch is read, and
a tree click swaps the pane over HTMX. `/commit/{sha}/{path}` deep-links a file
and a 512 KiB cap still bounds one file's patch.

The file tree became one widget for three surfaces rather than two, so its
context gained a Commit field and its href/target/status rules moved onto the
view (Branch, Diff, Href).

The pane's header is now one row: the file's name on the left and its line
counts on the right, with the separate "1 file changed" summary line dropped
when a single file fills the pane. The total-line remains for the multi-file
diff a compare renders.

server/web/templates/commit.html +29−3

@@ -1,5 +1,7 @@
1 {{/* Commit history for a ref, and one commit with its patch. The code browser
2 links here; commit.go and the Commits handler render these. */}}
1 {{/* Commit history for a ref, and one commit with the files it touched. The code
2 browser links here; commit.go and the Commits handler render these. A commit
3 opens one file's diff at a time, in the same tree-and-pane shape as a
4 change's Files tab, so a broad commit does not render every patch at once. */}}
3 5 {{define "commits"}}
4 6 {{template "header" .}}
5 7 {{template "repohead" (nav .Name "code" .CanAdmin .CloneURL .SSHURL .Site)}}
@@ -28,6 +30,30 @@
28 30 </div>
29 31 </div>
30 32 {{if and .Body (ne .Body .Commit.Subject)}}<pre>{{.Body}}</pre>{{end}}
31 {{template "diff" .}}
33 <div class="code-browser review-browser">
34 <aside class="file-tree review-tree" id="review-tree" aria-label="Changed files">
35 <div class="tree-head">
36 <span>{{icon "file"}}Changes</span>
37 <span class="muted">{{.FileCount}} changed</span>
38 </div>
39 {{if .Tree}}
40 <div class="tree-scroll">{{template "tree_nodes" (commitTreeContext .Name .Commit.SHA .Tree)}}</div>
41 {{if .FilesTruncated}}<p class="tree-note">Showing the first 4,000 files.</p>{{end}}
42 {{else}}
43 <p class="tree-empty muted">This commit changed no files.</p>
44 {{end}}
45 </aside>
46 {{template "commit_main" .Main}}
47 </div>
32 48 {{template "footer" .}}
33 49 {{end}}
50
51 {{define "commit_main"}}
52 <section id="review-main" class="review-main" data-path="{{.Path}}">
53 {{if .Files}}
54 {{template "diff" .}}
55 {{else}}
56 <p class="muted">This commit changed no files against its parent.</p>
57 {{end}}
58 </section>
59 {{end}}