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/components.html +10−9
| @@ -32,11 +32,12 @@ | |||
| 32 | 32 | {{end}} | |
| 33 | 33 | {{end}} | |
| 34 | 34 | ||
| 35 | {{/* One tree for both browsers. A code row opens a blob and carries the file | ||
| 36 | icon for its language; a review row opens the file's diff and carries the | ||
| 37 | A/M/D/R mark instead. The context says which is which: Review empty means | ||
| 38 | the code browser. This template lives here because the code browser owns | ||
| 39 | the tree; request_files.html renders it with a Review id. */}} | ||
| 35 | {{/* One tree for every browser. A code row opens a blob and carries the file | ||
| 36 | icon for its language; a changed-file row opens the file's diff and carries | ||
| 37 | the A/M/D/R mark instead. The context says which is which: with Review and | ||
| 38 | Commit both empty this is the code browser. This template lives here | ||
| 39 | because the code browser owns the tree; request_files.html and commit.html | ||
| 40 | render it with a change or a commit. */}} | ||
| 40 | 41 | {{define "tree_nodes"}} | |
| 41 | 42 | <ul class="tree-list"> | |
| 42 | 43 | {{range .Nodes}} | |
| @@ -48,12 +49,12 @@ | |||
| 48 | 49 | <span class="tree-icon">{{icon "folder"}}</span> | |
| 49 | 50 | <span class="tree-name" title="{{.Path}}">{{.Name}}</span> | |
| 50 | 51 | </summary> | |
| 51 | <div class="tree-children">{{template "tree_nodes" (treeContext $.Name $.Ref $.Review .Children)}}</div> | ||
| 52 | <div class="tree-children">{{template "tree_nodes" ($.Branch .Children)}}</div> | ||
| 52 | 53 | </details> | |
| 53 | 54 | {{else}} | |
| 54 | {{$href := treeHref $.Name $.Ref $.Review .Path}} | ||
| 55 | <a class="tree-row tree-file{{if .Active}} active{{end}}" data-path="{{.Path}}" href="{{$href}}" hx-get="{{$href}}" hx-target="{{if $.Review}}#review-main{{else}}#code-main{{end}}" hx-swap="outerHTML" hx-push-url="true" title="{{.Path}}"> | ||
| 56 | {{if $.Review}}<span class="review-mark" data-status="{{.Status}}">{{.Status}}</span>{{else}}<span class="tree-icon {{fileclass .Name}}">{{icon (fileicon .Name)}}</span>{{end}} | ||
| 55 | {{$href := $.Href .Path}} | ||
| 56 | <a class="tree-row tree-file{{if .Active}} active{{end}}" data-path="{{.Path}}" href="{{$href}}" hx-get="{{$href}}" hx-target="{{if $.Diff}}#review-main{{else}}#code-main{{end}}" hx-swap="outerHTML" hx-push-url="true" title="{{.Path}}"> | ||
| 57 | {{if $.Diff}}<span class="review-mark" data-status="{{.Status}}">{{.Status}}</span>{{else}}<span class="tree-icon {{fileclass .Name}}">{{icon (fileicon .Name)}}</span>{{end}} | ||
| 57 | 58 | <span class="tree-name">{{.Name}}</span> | |
| 58 | 59 | </a> | |
| 59 | 60 | {{end}} | |