Commit c7ba3d3
authored
Avoid git subprocesses during sync project resolution (#590)
## Summary
- Prefer the cheap filesystem `.git` walk for sync-time project
extraction so normal repos and linked worktrees do not shell out to
`git` per session.
- Preserve the kit `gitrepo.MainRoot` fallback for rare live-repo
layouts when the local walk cannot resolve a root.
- Add regression coverage for both sides: plain repos must not invoke
`git`, and the git fallback remains available when local resolution
misses.
## Investigation
- Reproduced with isolated data dirs only
(`AGENTSVIEW_DATA_DIR=/tmp/...`, also set `AGENTSVIEW_HOME=/tmp/...`);
production DB was not touched.
- Same source session set: about 35.7k discovered sessions.
- `v0.31.1` cold sync: 1m12.7s.
- `v0.32.0` cold sync: 4m31.4s.
- Revised PR build cold sync: 1m14.2s.
- 0.32.0 CPU profile showed ~190s cumulative under
`go.kenn.io/kit/git/repo.MainRoot` / `os/exec` from
`ExtractProjectFromCwdWithBranch`; revised PR profile returns to
SQLite/file-read dominated work.
## Test Plan
- [x] `go test ./internal/parser ./internal/sync ./cmd/agentsview`
- [x] Isolated revised PR cold sync with
`AGENTSVIEW_DATA_DIR=/tmp/agentsview-prof-pr-fallback`: 1m14.2s1 parent 2e11aa7 commit c7ba3d3
2 files changed
Lines changed: 130 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
| 438 | + | |
446 | 439 | | |
447 | 440 | | |
448 | 441 | | |
| |||
466 | 459 | | |
467 | 460 | | |
468 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
469 | 475 | | |
470 | 476 | | |
471 | 477 | | |
472 | 478 | | |
473 | 479 | | |
474 | | - | |
| 480 | + | |
475 | 481 | | |
476 | 482 | | |
477 | 483 | | |
478 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
479 | 488 | | |
480 | 489 | | |
481 | 490 | | |
482 | | - | |
| 491 | + | |
483 | 492 | | |
484 | 493 | | |
485 | 494 | | |
486 | 495 | | |
487 | 496 | | |
488 | | - | |
| 497 | + | |
489 | 498 | | |
490 | 499 | | |
491 | 500 | | |
492 | 501 | | |
493 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
494 | 516 | | |
495 | 517 | | |
496 | 518 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
109 | 201 | | |
110 | 202 | | |
111 | 203 | | |
| |||
591 | 683 | | |
592 | 684 | | |
593 | 685 | | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
594 | 690 | | |
595 | 691 | | |
596 | 692 | | |
| |||
0 commit comments