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.

Add repository code search

aef992843b95fd107327b103c12d135cd708c11e · Keenan Nemetz · 15d ago · parent 5cab7b18

Add repository code search

The Code tab now searches file names and plain-text contents at the selected branch. Contents go through git grep with fixed strings, case-insensitive matching, binary skipping, and a capped result set; there is no second index to drift. Results group by file and link to line anchors in the blob view. Also highlights a targeted line and adds the remaining polish notes to the UI plan.

core/git/git.go +19

@@ -622,6 +622,25 @@ func parseCommits(out []byte) []Commit {
622 622 return cs
623 623 }
624 624
625 // Grep returns fixed-string, case-insensitive, non-binary matches as raw
626 // path:line:text records. It stops reading after maxBytes, so a broad query
627 // cannot make the server hold an unbounded result set.
628 func (r *Repo) Grep(rev, pattern string, maxBytes int) ([]byte, bool, error) {
629 if maxBytes < 1 {
630 maxBytes = 1
631 }
632 out, _, err := r.runHead(maxBytes+1,
633 "grep", "-n", "-I", "-i", "-F", "-e", pattern, rev, "--")
634 if err != nil {
635 return nil, false, fmt.Errorf("grep %q: %w", pattern, err)
636 }
637 truncated := len(out) > maxBytes
638 if truncated {
639 out = out[:maxBytes]
640 }
641 return out, truncated, nil
642 }
643
625 644 func (r *Repo) CountCommits(rev string) (int, error) {
626 645 out, _, err := r.run(nil, "rev-list", "--count", rev)
627 646 if err != nil {