feat(core): install git-lfs and register its filters system-wide - #10
Merged
Conversation
The image had the `git` package but not `git-lfs`, so a bind-mounted repo that tracks files with LFS was broken inside the container in two ways, both silent: LFS-tracked files checked out as bare pointer stubs, and `git worktree add` failed in its post-checkout hook. Installing the package alone isn't enough. Git LFS's smudge/clean/ pre-push/post-checkout filters are registered in config, and a bind-mounted workspace's .git/config was written on the host, before this image existed — so a repo cloned there has no filter entries this image can rely on. `git lfs install --system` writes them to /etc/gitconfig instead, which covers every repo mounted in without a per-project step. Git treats a missing filter as a no-op rather than an error, which is why both failures surfaced as wrong content rather than as a build or checkout failure. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The core image ships
gitbut notgit-lfs, so any bind-mounted repo that tracks files with LFS is broken inside the container — silently, in two ways:git worktree addfails in itspost-checkouthook.Installing the package alone doesn't fix it. LFS's smudge/clean/pre-push/post-checkout filters are registered in config, and a bind-mounted workspace's
.git/configwas written on the host, before this image existed — so there are no filter entries the image can count on.git lfs install --systemwrites them to/etc/gitconfig, covering every repo mounted in with no per-project step.Git treats a missing filter as a no-op rather than an error, which is why both failures show up as wrong content rather than as a failed checkout.
Origin
Found while migrating a consumer repo (
jvsl.ai.agents.kotodori, which uses LFS for large lexicon data) onto the submodule layout. It had been carrying this as a local patch to the vendoredcore/Dockerfile.frag; with.code-servernow a submodule that patch has nowhere to live downstream, so it belongs here.Verification
Not built locally — the environment this was written in runs the previous image and a full
docker buildwasn't feasible there. Relying on this repo's CI (docker buildper stack) to validate.🤖 Generated with Claude Code