hk hangs when GIT_WORK_TREE=$HOME due to git status --untracked-files=all #860
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
When using hk with a bare-repo dotfile manager (YADM) where
GIT_WORK_TREE=$HOME, hk hangs for ~45 seconds on every invocation because it runsgit status --porcelain --untracked-files=all -z, which scans the entire home directory.Environment
GIT_DIR=~/.local/share/yadm/repo.gitandGIT_WORK_TREE=~status.showUntrackedFiles = noin its git configReproduction
Root Cause
With
--trace -v, hk shows:The
--untracked-files=allflag overrides the repo'sstatus.showUntrackedFiles = nosetting. When the work tree is$HOME, this scans hundreds of thousands of files and produces ~214MB of output.Expected Behavior
hk should respect the repo's
status.showUntrackedFilessetting, or at least not force--untracked-files=allwhen the work tree is a home directory. Alternatively, a config option likestash_untracked = falsecould skip untracked file discovery.Workaround Attempted
HK_LIBGIT2=false— same behavior (shell git also called with--untracked-files=all)HK_STASH_UNTRACKED=falseenv var — no effect on thegit statuscallstatus.showUntrackedFiles = no— overridden by the explicit--untracked-files=allflagContext
This was discovered during migration from pre-commit to hk for a YADM dotfiles repo. #831 added
GIT_DIR/GIT_WORK_TREEsupport in v1.44.0, which works for repo discovery, but the status scan makes it impractical for$HOMEwork trees.Beta Was this translation helpful? Give feedback.
All reactions