Skip to content

Conversation

tyrielv and others added 19 commits September 12, 2025 09:16
The verbs 'clone', 'mount', 'prefetch', and 'cache-server' each perform
a query to gvfs/config endpoint for two purposes: to get the list of
allowed client versions for the server, and to get the list of
preconfigured cache servers. Currently, if the query fails then the
verb fails.

The most common reason for the query to fail appears to be transient
network/authentication issues, making automount in particular more flaky
than desired.

Mount and Prefetch verbs should always have a cache server configuration
available already, and Clone and Cache-Server both have command-line
options to allow specifying the cache server configuration.

This change modifies the verbs so that if a cache server url is already
available (from local config or command-line option) then the verb will
warn that the version could not be checked and continue instead of
failing if the query to gvfs/config fails.
Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](actions/github-script@v7...v8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
…ions/github-script-8

build(deps): bump actions/github-script from 7 to 8
Currently, CodeQL mis-identifies a couple instances of the
usually-legitimate "User-controlled data may not be null terminated"
problem.

In these instances, CodeQL thinks that `packet_txt_read()` fails to
NUL-terminate (not actually "null"... tsk, tsk) the string. But it
totally does! Here is the current definition of that function:

	size_t packet_txt_read(char *buf, size_t count, FILE *stream)
	{
		size_t len;

		len = packet_bin_read(buf, count, stream);
		if (len && buf[len - 1] == '\n')
		{
			len--;
		}

		buf[len] = 0;
		return len;
	}

The `buf[len] = 0` statement guarantees that the string is
NUL-terminated.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In some environments "gvfs" may not be properly resolved by the shell
when running the background prefetch process, so this change uses the
current process path instead.

If the background prefetch process fails to start, the error is now
displayed to the user with remediation steps and clone continues to the
next step.
Git uses SHA-1 as its hashing algorithm, and therefore VFSforGit must
use the same.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Suppress false positives about Git's usage of SHA-1
Handle errors on background prefetch start
Warn-and-continue if gvfs/config download fails
This change is intended to improve the heuristic for loading commits
when a prefetch has not completed, either because the clone was run with
`--no-prefetch` or because `gvfs.trustPackIndexes` is set to `false`.

Previously the heuristic for loading commits before prefetch has
completed is:
- When a commit is requested to be downloaded, record the tree it points
to.
- At most once per 5 minutes
- When a tree is requested to be downloaded that was previously
recorded and it has been at least 5 minutes since the last time a
commit
- Then download the commit.

This works for the most basic case where a user clones a repo, then
checks out a branch other than the default. It also limits
over-downloading when history or commands are run that load many commits
but need few objects from them.

However, it doesn't work well when these are combined (eg a history
command is run first, then a checkout), or when multiple
commands are run in far-apart sections of the commit graph in less than
a 5-minute period.

The new heuristic is:
- When a commit is requested to be downloaded, record the tree it points
to, associated with the commit.
- When a tree is downloaded that was previously recorded, record the
subtrees that it references that have not been downloaded yet and
associate them with the same commit.
- When a tree is requested to be downloaded, if the number of trees
associated with a commit is greater than N, then download the commit.

N is currently set to 200, which is approximately the number of trees
that are downloaded in the first 3 seconds of attempting to checkout a
branch where many trees would be downloaded without batching.

Downloading the entire tree graph for a commit as a pack takes about
1 second, so this should limit the amount of time to download all trees
for a commit to about 4 seconds, but also be unlikely to download the
commit packs for history/blame operations that only need a few trees per
commit.
Minor changes to asynchronous prefetch workflow:
* Use the current executable's location instead of relying on environment to find it.
* Launch the process minimized instead of hidden.
Update heuristic for pre-prefetch commit loading
@mjcheetham mjcheetham requested review from dscho and tyrielv November 10, 2025 14:41
@mjcheetham mjcheetham enabled auto-merge November 10, 2025 14:42
@mjcheetham mjcheetham merged commit a79b8b8 into releases/shipped Nov 10, 2025
108 checks passed
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.

4 participants