feat(git): install and initialize git-lfs - #20
Merged
Conversation
git/config.template wires filter.lfs into every generated global git config, but nothing installed the git-lfs executable, so LFS checkouts failed on machines without it already present. Manage git-lfs the same way as git-credential-manager and git-filter-repo: install via Homebrew and run `git lfs install --skip-repo` as the one-time init step, idempotently. Closes #11 Co-Authored-By: lsimons-bot <bot@leosimons.com> Assisted-by: Claude:claude-sonnet-5
`git lfs install --skip-repo` used the default check=True, so any non-zero exit (e.g. PATH not yet refreshed after a fresh brew install) raised CalledProcessError and crashed with a bare traceback instead of the error()/return 1 convention every other step in main() follows. Also stopped reporting init success unconditionally regardless of the actual command result. Co-Authored-By: lsimons-bot <bot@leosimons.com> Assisted-by: Claude:claude-sonnet-5
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.
Summary
git/config.templatealready wiresfilter.lfs(clean/smudge/process) into every generated global git config, but nothing installed thegit-lfsexecutable or ran the one-time init — so LFS checkouts failed on a machine without git-lfs already present.git/install.pynow managesgit-lfsas an installed, initialized dependency, following the same install/verify/report pattern already used forgit-credential-managerandgit-filter-repo: install via Homebrew, then rungit lfs install --skip-repo(idempotent — safe to run every time since the filter config is already fully specified by the template).Closes #11
Test plan
python3 script/check.pypasses (py_compile, ruff, json, tests,install.py --dry-runacross all topics)python3 git/install.py --dry-runshows git-lfs probed as absent, installed, and initializedgit lfs install --skip-repois a genuine no-op once the template-generated config is in place (confirmed via config file diff before/after)Assisted-by: Claude:claude-sonnet-5