Skip to content

Conversation

@tyrielv
Copy link
Contributor

@tyrielv tyrielv commented Jan 13, 2026

As pointed out in #1895, starting a new git process just to read config isn't great for performance.

This PR addresses the specific call introduced in #1895 as well as the call for "Trust pack indexes" that I introduced recently.

  • Add support for "GIT_ENOTFOUND" result code in LibGit2Repo
  • Make LibGit2Repo easier to use when full GvfsContext isn't available
  • Add support for getting bools from config to LibGit2Repo
  • Replace GitProcess usage with LibGit2Repo for gvfs.show-hydration-status and gvfs.trust-pack-indexes

@tyrielv tyrielv requested a review from dscho January 13, 2026 19:45
{
bool trustPackIndexes = enlistment.GetTrustPackIndexesConfig();
bool trustPackIndexes;
using (var repo = new LibGit2RepoInvoker(NullTracer.Instance, enlistment.WorkingDirectoryBackingRoot))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can we not use a JsonTracer here?

using JsonTracer tracer = new JsonTracer(GVFSConstants.GVFSEtwProviderName, "GVFSClone")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would create a new log file just for this one operation, which feels wrong.
Instead I've moved this load up a few lines so it can use the Clone tracer.

@tyrielv tyrielv force-pushed the tyrielv/avoid-git-config-process branch from 06e7d5a to 80f5df6 Compare January 14, 2026 23:49
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.

3 participants