GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): background git status fetches no longer fill the disk with failed repacks by t3dotgg · Pull Request #13812 · pingdotgg/t3code

fix(server): background git status fetches no longer fill the disk with failed repacks #13812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
t3dotgg merged 1 commit into main from t3code/background-fetch-no-auto-gc
Sep 26, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix(server): background git status fetches no longer fill the disk with failed repacks #13812

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
d6bc76e
fix(server): background git status fetches no longer fill the disk wi…
t3dotgg Sep 26, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
fix(server): background git status fetches no longer fill the disk wi…
…th failed repacks

The status poller's `git fetch` also started `git gc --auto`. When that gc
fails (here, a repository with missing objects), Git retries it on every
fetch and leaves a full-size tmp_pack_* each time. Pass --no-auto-gc so the
background poll never starts repository maintenance.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@t3dotgg @claude
t3dotgg and claude committed Sep 26, 2026
commit d6bc76e804d7c95b8354d54fff2df85aaee7a9f8

There are no files selected for viewing

29 changes: 29 additions & 0 deletions 29 apps/server/src/vcs/GitVcsDriverCore.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1918,6 +1918,35 @@ it.layer(TestLayer)("GitVcsDriver core integration", (it) => {
}),
);

it.effect("does not start Git auto-maintenance from background upstream fetches", () =>
Effect.gen(function* () {
const cwd = yield* makeTmpDir();
const remote = yield* makeTmpDir("git-vcs-driver-remote-");
const { initialBranch } = yield* initRepoWithCommit(cwd);
yield* git(remote, ["init", "--bare"]);
yield* git(cwd, ["remote", "add", "origin", remote]);
yield* git(cwd, ["push", "-u", "origin", initialBranch]);
yield* git(cwd, ["repack", "-d"]);
yield* writeTextFile(cwd, "second.txt", "second\n");
yield* git(cwd, ["add", "second.txt"]);
yield* git(cwd, ["commit", "-m", "second commit"]);
yield* git(cwd, ["push"]);
yield* git(cwd, ["repack", "-d"]);
// Two packs make `git gc --auto` due, and without detaching it would run inside the fetch.
yield* git(cwd, ["config", "gc.autoPackLimit", "1"]);
yield* git(cwd, ["config", "gc.autoDetach", "false"]);
yield* git(cwd, ["config", "maintenance.autoDetach", "false"]);
const packCount = git(cwd, ["count-objects", "-v"]).pipe(
Effect.map((stdout) => stdout.match(/^packs: (\d+)$/m)?.[1]),
);
assert.equal(yield* packCount, "2");

yield* (yield* GitVcsDriver.GitVcsDriver).statusDetailsRemote(cwd);

assert.equal(yield* packCount, "2");
}),
);

it.effect("uses origin HEAD for default-branch detection with a non-origin upstream", () =>
Effect.gen(function* () {
const cwd = yield* makeTmpDir();
Expand Down
6 changes: 5 additions & 1 deletion 6 apps/server/src/vcs/GitVcsDriverCore.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1127,10 +1127,14 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
): Effect.Effect<void, GitCommandError> => {
const fetchCwd =
path.basename(gitCommonDir) === ".git" ? path.dirname(gitCommonDir) : gitCommonDir;
// `--no-auto-gc` (a synonym of `--no-auto-maintenance` that older Git also knows) keeps
// this poll from starting `git gc --auto`. When that gc fails, for example on a repository
// with missing objects, Git retries it on every fetch and leaves a full-size `tmp_pack_*`
// behind each time, so a background poll could fill the disk.
return executeGit(
"GitVcsDriver.fetchRemoteForStatus",
fetchCwd,
["--git-dir", gitCommonDir, "fetch", "--quiet", "--no-tags", remoteName],
["--git-dir", gitCommonDir, "fetch", "--quiet", "--no-tags", "--no-auto-gc", remoteName],
{
env: STATUS_UPSTREAM_REFRESH_ENV,
fallbackErrorDetail: "Background Git fetch exited with a non-zero status.",
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.