Files
gitea-MIRROR/services/gitdiff
silverwind b08f5fad30 fix(activity): count pulse code stats from the branch's net diff (#40573)
The activity page summed per-commit `git log --numstat`, so a renamed
file counted as an extra `old => new` path and changes that landed
through merge commits were missed. Like GitHub's Pulse, the changed
files, additions and deletions now come from the default branch's net
diff over the period, so git detects renames and changes reverted within
the period no longer count.

`GetCodeActivityStats` on an M3 Max, median of 6 runs:

| Repo | Period | Before | After |
|---|---|---|---|
| gitea | week | 40 ms | 40 ms |
| gitea | year | 2.06 s | 0.51 s |
| golang/go | week | 524 ms | 155 ms |
| golang/go | year | 4.54 s | 0.75 s |

Refs:
https://github.com/go-gitea/gitea/pull/40569#issuecomment-7231088642

Assisted-by: Claude Code:claude-opus-5-5
2026-11-28 19:10:44 +00:00
..