Gitea: a push to an open PR's branch can take 1.75 GB (patch test and diff statistics) #152

Open
opened 2026-11-08 00:38:40 +00:00 by rajames · 1 comment
Owner

Found (2026-11-08)

During a burst of pushes to #148's branch (with large log directories), Gitea rose to 1.75 GiB (docker stats), running git format-patch, git diff --shortstat and git log --numstat -- the pull request's patch test and diff statistics, redone on every push. With the server at 3.8 GiB, swap filled.

Done when

  • [git] MAX_GIT_DIFF_FILES and MAX_GIT_DIFF_LINES (and MAX_GIT_DIFF_LINE_CHARACTERS) in app.ini, set so a large PR stops early
  • Practice: while a PR is open, commit locally and push once (one patch test, not several); the developer protocol (#135) says so
  • Verified: a push of a large log directory to an open PR, Gitea's peak under the limit

🤖 Filed with Claude Code

### Found (2026-11-08) During a burst of pushes to #148's branch (with large log directories), Gitea rose to **1.75 GiB** (`docker stats`), running `git format-patch`, `git diff --shortstat` and `git log --numstat` -- the pull request's patch test and diff statistics, redone on every push. With the server at 3.8 GiB, swap filled. ### Done when - [ ] `[git] MAX_GIT_DIFF_FILES` and `MAX_GIT_DIFF_LINES` (and `MAX_GIT_DIFF_LINE_CHARACTERS`) in `app.ini`, set so a large PR stops early - [ ] Practice: while a PR is open, commit locally and push once (one patch test, not several); the developer protocol (#135) says so - [ ] Verified: a push of a large log directory to an open PR, Gitea's peak under the limit 🤖 Filed with [Claude Code](https://claude.com/claude-code)
rajames added this to the v4.0.0-alpha.4 milestone 2026-11-08 00:38:40 +00:00
rajames added the
kind
ci
priority
should
status
backlog
labels 2026-11-08 00:38:40 +00:00
Author
Owner

Done on the server (Captain Bob, 2026-11-08), in app.ini:

  • [git] MAX_GIT_DIFF_LINES = 300 (was 1000), MAX_GIT_DIFF_FILES = 30 (was 100), MAX_GIT_DIFF_LINE_CHARACTER_COUNT = 2000 (was 5000)
  • [git.timeout] DEFAULT = 300 (5 minutes per git operation), GC = 60

A runaway diff now stops instead of eating the memory. Left: the practice (push once per open PR, written into #135) and the check against the next large push.

Done on the server (Captain Bob, 2026-11-08), in `app.ini`: - `[git]` `MAX_GIT_DIFF_LINES = 300` (was 1000), `MAX_GIT_DIFF_FILES = 30` (was 100), `MAX_GIT_DIFF_LINE_CHARACTER_COUNT = 2000` (was 5000) - `[git.timeout]` `DEFAULT = 300` (5 minutes per git operation), `GC = 60` A runaway diff now stops instead of eating the memory. Left: the practice (push once per open PR, written into #135) and the check against the next large push.
Sign in to join this conversation.