Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Dec 1, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

For a few releases, `git status` would output a message like
"You are in a partially-hydrated checkout with 1% of tracked files present."

However, this implementation only measured files that had been modified; files
that were hydrated but unmodified were not included, so the change was reverted.

This change adds a line to the start of `git status` similar to
"1% of files and 1% of folders hydrated. Run 'gvfs health' for details."

I decided to show separate %s for files and folders  because I think there is a
meaningful difference between "0% files and 100% folders" and
"10% files and 10% folders", but if combined both could display as
"11% total hydration" (with ~1:10 ratio of folders to files).

** Changes **

1. A new option is added to `gvfs health` verb, `--status`, to display the new
output line.
2. Gvfs.Hooks.exe will call `gvfs health --status` on pre-command hook for
`git status` except when called with --serialize.
3. The hydration %s are calculated from:
   - the number of files/folders in placeholder database
   - the number of files/folders in modified database
   - the total number of files, from git index header
   - the total number of folders, from `git ls-tree -r -d HEAD`
4. Because the git ls-tree command can be slow for large repos, its result is
cached.
   - GitStatusCache is modified log the hydration stats to telemetry, which
   ensures the cache is up-to-date.
   - The new cache file is stored in a new file TreeCountCache.dat next to
   the existing GitStatusCache.dat.
   - The cache is keyed off the tree ID of HEAD.
5. Refactoring: Reading the placeholder, modified DB file/folder lists, and
   index file/folder lists are moved from HealthVerb to EnlistmentPathData
6. If the repo is not mounted, `gvfs health [--status]` will attempt to read the
modified file list directly instead of getting it from the current mount process.
Add hydration percentages to git status hook
@pull pull bot locked and limited conversation to collaborators Dec 1, 2025
@pull pull bot added the ⤵️ pull label Dec 1, 2025
@pull pull bot merged commit 45d0405 into cgallred:master Dec 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant