Skip to content

feat(core): install git-lfs and register its filters system-wide - #10

Merged
TheHefty merged 1 commit into
mainfrom
feat/git-lfs
Aug 3, 2026
Merged

feat(core): install git-lfs and register its filters system-wide#10
TheHefty merged 1 commit into
mainfrom
feat/git-lfs

Conversation

@TheHefty

@TheHefty TheHefty commented Aug 3, 2026

Copy link
Copy Markdown
Owner

The core image ships git but not git-lfs, so any bind-mounted repo that tracks files with LFS is broken inside the container — silently, in two ways:

  • LFS-tracked files check out as bare pointer stubs instead of real content.
  • git worktree add fails in its post-checkout hook.

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/config was written on the host, before this image existed — so there are no filter entries the image can count on. git lfs install --system writes 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 vendored core/Dockerfile.frag; with .code-server now 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 build wasn't feasible there. Relying on this repo's CI (docker build per stack) to validate.

🤖 Generated with Claude Code

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>
@TheHefty
TheHefty merged commit 55ea5ee into main Aug 3, 2026
15 checks passed
@TheHefty
TheHefty deleted the feat/git-lfs branch August 3, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant