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): blank ignore lines no longer omit checkpoint files by voltcrash · Pull Request #32373 · pingdotgg/t3code

fix(server): blank ignore lines no longer omit checkpoint files #32373

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

Closed
voltcrash wants to merge 1 commit into pingdotgg:main from voltcrash:t3/fix-ignore-pattern-checkpoint-capture
+146 −38
Closed

fix(server): blank ignore lines no longer omit checkpoint files #32373

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
ec602a3
fix(server): blank ignore lines no longer omit checkpoint files
voltcrash Nov 7, 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): blank ignore lines no longer omit checkpoint files
  • Loading branch information

Uh oh!

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

@voltcrash
voltcrash committed Nov 7, 2026
commit ec602a3af468e5cc9d41bbcb7beb66170cf8b276

There are no files selected for viewing

152 changes: 115 additions & 37 deletions 152 apps/server/src/vcs/GitVcsDriver.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -367,43 +367,120 @@ it.effect("checkpoint capture refuses a truncated nested repository listing", ()
}).pipe(Effect.scoped, Effect.provide(layerGitContract)),
);

it.effect("checkpoint capture skips an ignored project while keeping its allowed sibling", () =>
Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const driver = yield* GitVcsDriver.makeVcsDriverShape();
const parent = yield* fs.makeTempDirectoryScoped({ prefix: "t3-checkpoint-ignored-" });
const { git } = yield* makeCheckpointFixture(driver, parent);
yield* fs.writeFileString(
path.join(parent, ".gitignore"),
"*\n!.gitignore\n!file.txt\n!keep/\n!keep/**\n",
);
const ignoredCwd = path.join(parent, "ignored");
const keepCwd = path.join(parent, "keep");
yield* fs.makeDirectory(ignoredCwd);
yield* fs.makeDirectory(keepCwd);
yield* fs.writeFileString(path.join(ignoredCwd, "secret.txt"), "private\n");
yield* fs.writeFileString(path.join(keepCwd, "new.txt"), "new\n");
const originalIndex = yield* fs.readFile(path.join(parent, ".git", "index"));
const ignoredRef = CheckpointRef.make("refs/t3/checkpoints/ignored");
const keepRef = CheckpointRef.make("refs/t3/checkpoints/keep");

const ignored = yield* Effect.result(
driver.checkpoints.captureCheckpoint({ cwd: ignoredCwd, checkpointRef: ignoredRef }),
);
yield* driver.checkpoints.captureCheckpoint({ cwd: keepCwd, checkpointRef: keepRef });
it.effect.each([
{ cwdName: ".", source: "root", patterns: "a.txt\r\n\r\nb.txt\r\n" },
{ cwdName: ".", source: "root", patterns: " \n" },
{ cwdName: ".", source: "info", patterns: "\r\n" },
{ cwdName: ".", source: "global", patterns: "\r\n" },
{ cwdName: "sub", source: "root", patterns: "\r\n" },
{ cwdName: "sub", source: "workspace", patterns: "\r\n" },
{ cwdName: "sub", source: "root", patterns: "sub/\n\r\n!sub/\n" },
{ cwdName: "sub", source: "root", patterns: "sub/\n!sub/\n\r\n" },
])(
"checkpoint captures and restores untracked files with blank $source ignore patterns in $cwdName: $patterns",
({ cwdName, source, patterns }) =>
Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const driver = yield* GitVcsDriver.makeVcsDriverShape();
const sandbox = yield* fs.makeTempDirectoryScoped({ prefix: "t3-checkpoint-blank-ignore-" });
const repo = path.join(sandbox, "repo");
yield* fs.makeDirectory(repo);
const { git, checkpointRef } = yield* makeCheckpointFixture(driver, repo);
const cwd = path.join(repo, cwdName);
yield* fs.makeDirectory(cwd, { recursive: true });
const prefix = cwdName === "." ? "" : `${cwdName}/`;
yield* fs.writeFileString(path.join(cwd, "staged.txt"), "staged\n");
yield* git(["add", `${prefix}staged.txt`]);
yield* fs.writeFileString(path.join(cwd, "staged.txt"), "working\n");
yield* fs.writeFileString(path.join(cwd, "notes.md"), "before turn\n");
yield* fs.writeFileString(path.join(cwd, ".gitignore"), "ignored.txt\n");
const ignoreFile =
source === "info"
? path.join(repo, ".git", "info", "exclude")
: source === "global"
? path.join(sandbox, "excludes")
: path.join(source === "root" ? repo : cwd, ".gitignore");
yield* fs.writeFileString(ignoreFile, `${patterns}ignored.txt\n`);
if (source === "global") yield* git(["config", "core.excludesFile", ignoreFile]);
yield* fs.writeFileString(path.join(cwd, "ignored.txt"), "private\n");
const originalIndex = yield* fs.readFile(path.join(repo, ".git", "index"));

assert.strictEqual((yield* git(["show", `${keepRef}:keep/new.txt`])).stdout, "new\n");
assert.strictEqual((yield* git(["ls-tree", "-r", keepRef, "--", "ignored"])).stdout, "");
assert.isFalse(
yield* driver.checkpoints.hasCheckpointRef({ cwd: parent, checkpointRef: ignoredRef }),
);
assert.deepEqual(yield* fs.readFile(path.join(parent, ".git", "index")), originalIndex);
assert.strictEqual(ignored._tag, "Failure");
if (ignored._tag === "Failure") {
assert.strictEqual(ignored.failure._tag, "VcsUnsupportedOperationError");
}
}).pipe(Effect.scoped, Effect.provide(layerGitContract)),
yield* driver.checkpoints.captureCheckpoint({ cwd, checkpointRef });

assert.include(
(yield* git(["ls-tree", "-r", "--name-only", checkpointRef])).stdout.split("\n"),
`${prefix}notes.md`,
);
assert.strictEqual(
(yield* git(["show", `${checkpointRef}:${prefix}notes.md`])).stdout,
"before turn\n",
);
assert.strictEqual(
(yield* git(["show", `${checkpointRef}:${prefix}staged.txt`])).stdout,
"working\n",
);
yield* fs.writeFileString(path.join(cwd, "notes.md"), "after turn\n");
yield* fs.writeFileString(path.join(cwd, "new.txt"), "created during turn\n");
const afterRef = CheckpointRef.make("refs/t3/checkpoints/after");
yield* driver.checkpoints.captureCheckpoint({ cwd, checkpointRef: afterRef });
assert.strictEqual(
(yield* git(["show", `${afterRef}:${prefix}new.txt`])).stdout,
"created during turn\n",
);
assert.strictEqual(
(yield* git(["ls-tree", "-r", afterRef, "--", `${prefix}ignored.txt`])).stdout,
"",
);
assert.deepEqual(yield* fs.readFile(path.join(repo, ".git", "index")), originalIndex);

assert.isTrue(yield* driver.checkpoints.restoreCheckpoint({ cwd, checkpointRef }));
assert.strictEqual(yield* fs.readFileString(path.join(cwd, "notes.md")), "before turn\n");
assert.strictEqual(yield* fs.readFileString(path.join(cwd, "staged.txt")), "working\n");
assert.isFalse(yield* fs.exists(path.join(cwd, "new.txt")));
assert.strictEqual(yield* fs.readFileString(path.join(cwd, "ignored.txt")), "private\n");
}).pipe(Effect.scoped, Effect.provide(layerGitContract)),
);

it.effect.each(["", "\r\n", " \n"])(
"checkpoint capture skips an ignored project while keeping its allowed sibling with blank pattern %j",
(blank) =>
Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const driver = yield* GitVcsDriver.makeVcsDriverShape();
const parent = yield* fs.makeTempDirectoryScoped({ prefix: "t3-checkpoint-ignored-" });
const { git } = yield* makeCheckpointFixture(driver, parent);
yield* fs.writeFileString(
path.join(parent, ".gitignore"),
`*\n!.gitignore\n!file.txt\n!keep/\n!keep/**\n${blank}`,
);
const ignoredCwd = path.join(parent, "ignored");
const keepCwd = path.join(parent, "keep");
yield* fs.makeDirectory(ignoredCwd);
yield* fs.makeDirectory(keepCwd);
yield* fs.writeFileString(path.join(ignoredCwd, "secret.txt"), "private\n");
yield* fs.writeFileString(path.join(keepCwd, "new.txt"), "new\n");
const originalIndex = yield* fs.readFile(path.join(parent, ".git", "index"));
const ignoredRef = CheckpointRef.make("refs/t3/checkpoints/ignored");
const keepRef = CheckpointRef.make("refs/t3/checkpoints/keep");

const ignored = yield* Effect.result(
driver.checkpoints.captureCheckpoint({ cwd: ignoredCwd, checkpointRef: ignoredRef }),
);
yield* driver.checkpoints.captureCheckpoint({ cwd: keepCwd, checkpointRef: keepRef });

assert.strictEqual((yield* git(["show", `${keepRef}:keep/new.txt`])).stdout, "new\n");
assert.strictEqual((yield* git(["ls-tree", "-r", keepRef, "--", "ignored"])).stdout, "");
assert.isFalse(
yield* driver.checkpoints.hasCheckpointRef({ cwd: parent, checkpointRef: ignoredRef }),
);
assert.deepEqual(yield* fs.readFile(path.join(parent, ".git", "index")), originalIndex);
assert.strictEqual(ignored._tag, "Failure");
if (ignored._tag === "Failure") {
assert.strictEqual(ignored.failure._tag, "VcsUnsupportedOperationError");
}
}).pipe(Effect.scoped, Effect.provide(layerGitContract)),
);

it.effect.each([
Expand Down Expand Up @@ -433,7 +510,8 @@ it.effect.each([
yield* git(["add", `sub/${file}`]);
}
const tracked = [...committed, ...staged];
yield* fs.writeFileString(path.join(parent, ".gitignore"), "sub/\n");
yield* fs.writeFileString(path.join(parent, ".gitignore"), "\r\nsub/\n\r\n");
yield* fs.writeFileString(path.join(cwd, ".gitignore"), "\r\n");
for (const file of tracked) {
yield* fs.writeFileString(path.join(cwd, file), `${file} working\n`);
}
Expand Down
32 changes: 31 additions & 1 deletion 32 apps/server/src/vcs/GitVcsDriver.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,37 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
}
}

const workspaceIgnored = (yield* filterIgnoredPaths(input.cwd, ["."])).length === 0;
const ignoreMatch = yield* execute({
operation,
cwd: input.cwd,
args: [
...WORKSPACE_GIT_HARDENED_CONFIG_ARGS,
"check-ignore",
"--no-index",
"--verbose",
"-z",
"--stdin",
],
stdin: ".\0",
allowNonZeroExit: true,
timeoutMs: 20_000,
maxOutputBytes: WORKSPACE_FILES_MAX_OUTPUT_BYTES,
outputMode: "error",
});
if (ignoreMatch.exitCode !== 0 && ignoreMatch.exitCode !== 1) {
return yield* new VcsProcessExitError({
operation,
command: "git check-ignore",
cwd: input.cwd,
exitCode: ignoreMatch.exitCode,
detail: ignoreMatch.stderr.trim() || "git check-ignore failed",
});
}
// Blank CRLF or spaces-only ignore lines can match '.' as an empty pattern.
// Verbose NUL output preserves that pattern and distinguishes negated matches.
const pattern = ignoreMatch.stdout.split("\0")[2];
const workspaceIgnored =
pattern !== undefined && pattern.length > 0 && !pattern.startsWith("!");
if (workspaceIgnored) {
// HEAD omits staged-only paths. Seed just this workspace's additions, keeping
// unrelated staged changes and the scratch index's sparse flags untouched.
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.