feat: git-lfs as a managed tool (+ fix the 1.13.2 tmux config regression) - #61
Merged
Merged
Conversation
1.13.2 added `if ! has tmux` before linking tmux config. `has` is command -v,
and ~/.local/bin is NOT on PATH while install.sh runs - so on a no-sudo host
the guard fired immediately after _install_tmux had installed tmux there:
tmux installed -> ~/.local/bin/tmux (tmux 3.5a)
tmux not found - skipping tmux config and plugins
Exactly the hosts 1.12.0 exists to serve lost their tmux config. Caught by
ci-local.sh nosudo-auto, which failed with .tmux.conf, .tmux.conf.local and
tmux-status-rows all missing.
Both entry points now use one _tmux_present helper that probes the absolute
path as well as PATH - the repo's standing rule about command -v at install
time, which 1.13.2 did not follow.
git-lfs joins the managed tools: apt where available, GitHub binary otherwise, with an update block and test coverage. Its assets use DEBIAN arch names (git-lfs-linux-amd64-*), not the Rust triples bat/fd/rg use, so it maps through _deb_arch instead of copying their case statement. _deb_arch moves from modules/base.sh to lib/utils.sh because update.sh needs it and does not source that module - caught by ci-local.sh, which failed with `_deb_arch: command not found`. The config half deliberately does NOT use `git lfs install`. That writes to the global config, and ~/.gitconfig here is a SYMLINK to the tracked git/.gitconfig - so it would edit a tracked file and leave every host's checkout dirty, which then blocks its own next update. Instead the filters go to ~/.gitconfig.local, the same way install.sh already writes zdiff3, and only when the binary is actually present: they carry `required = true`, so shipping them without git-lfs would make every LFS checkout fail. Verified in clean no-sudo containers: git-lfs 3.8.0 installs, the four filters land in ~/.gitconfig.local, `git config --get filter.lfs.process` resolves, and the tracked git/.gitconfig stays clean. Red-proofed by pointing the installer at a nonexistent repo - no binary, and NO filters written. Idempotent: a second run reports "already configured" and the filter count stays 1. ci-local.sh nosudo-auto and minimal both PASS 1/1.
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.
What
git-lfsbecomes a managed tool (apt where available, GitHub binary otherwise, withan update block and test coverage) — and a regression I shipped in 1.13.2 is
fixed, which this work uncovered.
The 1.13.2 regression (first commit, fix to shipped code)
1.13.2 added
if ! has tmuxbefore linking tmux config.hasiscommand -v, and~/.local/binis not on PATH while install.sh runs — so on a no-sudo host theguard fired immediately after
_install_tmuxhad installed tmux there:Exactly the hosts 1.12.0 exists to serve lost their tmux config.
ci-local.sh nosudo-autocaught it:.tmux.conf,.tmux.conf.localandtmux-status-rowsallmissing. Both entry points now share a
_tmux_presenthelper that probes theabsolute path as well as PATH — the repo's own standing rule, which 1.13.2 did not
follow. This is live on master and on all 14 fleet hosts, so it wants merging
regardless of the git-lfs half.
git-lfs install
Assets use Debian arch names (
git-lfs-linux-amd64-*), not the Rust triplesbat/fd/rg use, so it maps through
_deb_arch. That helper moves frommodules/base.shtolib/utils.shbecauseupdate.shneeds it and does not sourcethat module — caught by ci-local.sh failing with
_deb_arch: command not found.git-lfs config: deliberately NOT
git lfs installTwo measured reasons:
git lfs installwrites to the global config, and~/.gitconfighere is asymlink to the tracked
git/.gitconfig. It would edit a tracked file and leaveevery host's checkout dirty — which then blocks its own next update, via the same
clash guard the rollout job uses.
required = true, so shipping them where git-lfs is absent makesevery LFS checkout fail. Config must follow the tool, not precede it.
So the filters go to
~/.gitconfig.local, exactly as install.sh already writeszdiff3, and only when the binary is present. A value the user already set is leftalone.
Verified
Clean no-sudo containers:
Red-proof — installer pointed at a nonexistent repo:
Idempotency — second run:
git-lfs filters already configured, filter countstays 1.
ci-local.sh --ubuntu 24.04 --profile nosudo-autoPASS 1/1;--profile minimal --skip-nosudoPASS 1/1;test.sh workstation63/64, 0 failures;lint-workflows, config-needs-tool, no-fixture-masking, ci-gate-covers-all all PASSED.
Note on my own red-proof
My first attempt at the "unobtainable" arm was invalid — I broke
https://github.com/git-lfs/git-lfs, but the code fetches through_gh_release_info, which builds an api.github.com URL. git-lfs installednormally and the arm proved nothing. The corrected arm points the installer at a
nonexistent repo, which does reach the failure path.