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.

Read one request, or one commit, instead of resolving twice

c9202f7f0ba5904af798e7f55bb91079aa774bf5 · Keenan Nemetz · 10d ago · parent 73ec800b

Read one request, or one commit, instead of resolving twice

The index and the change page both paid for reads they did not need:

- GetRequest read every request on the branch to return one. It now reads
  that request's files.
- The index resolves the metadata commit once and then handed the ref to
  loaders that resolved it again. LoadIssuesAt, LoadNumbersAt and
  LoadRequestAt take the commit they were given.
- Release artifacts get a batched loader: one tree listing and one
  cat-file for the whole set, instead of one process per file per tag.

These are the loaders the index needs to derive its rows from one commit
at a time.

metadata/request_write.go +10−7

@@ -145,18 +145,21 @@ func CreateRequest(g *git.Repo, r *Request, actor string) error {
145 145 return err
146 146 }
147 147
148 // Get returns one request by id.
148 // Get returns one request by id. It reads that request's files, not the whole
149 // branch: a page about one change should not pay for every other change.
149 150 func GetRequest(g *git.Repo, id string) (*Request, error) {
150 list, err := LoadRequests(g, Ref)
151 commit, err := g.RevParse(Ref)
151 152 if err != nil {
152 153 return nil, err
153 154 }
154 for _, r := range list {
155 if r.ID == id {
156 return r, nil
157 }
155 req, found, err := LoadRequestAt(g, commit, id)
156 if err != nil {
157 return nil, err
158 158 }
159 return nil, fmt.Errorf("requests: no request %s", id)
159 if !found {
160 return nil, fmt.Errorf("requests: no request %s", id)
161 }
162 return req, nil
160 163 }
161 164
162 165 // SetRequestHead repoints an open request at a commit and, optionally, at the