Repository navigation
[November 26] - Embeddable fsmonitor #3232
Sebastian Thiel (Byron)
announced in
Progress Update
Replies: 0 comments
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.
Another crazy month with crazy hours: 170h in open source, 131 of these for Gitoxide and only 10h for GitPython, which is calming down after the last push towards the next release.
dua-cliandRusttysaw 5h each and are both calming down as well, for a total of 222h worked, with 2 more days to go as I'm writing this early.Maybe at some point I should also change the date for the monthly report to be the last day of the month to make dates line up more easily.
Watching repositories and linked worktrees
This month's headline feature clearly must be native filesystem monitoring support coming in via
gix-notify. It provides 4 backends: kqueue and FSEvents for macOS, inotify on Linux, and whatever Windows calls theirs (it's the longest name of them all). And everywhere else, thenotifycrate is used to bring validated support for FreeBSD, for instance.With the primitives in
gix-notify, the equally newgix-fsmonitorcrate provides a client for the fsmonitor server for its IPC protocol, and the server implementation itself, and also a daemon implementation for good measure. With it, it's easy to implement your own daemon or embedded fsmonitor-compatible servers. The latter will be very useful forstarship, which very soon can daemonize itself to provide fsmonitor services to… itself and Git, making for far faster prompts in huge repositories, even if these aren't officially configured for it. This has the potential to greatly speed up Windows as well, and I am looking forward to trying it there. That, of course, would be unfeasible if you ended up with 10starshipdaemons hanging around forever, so they will shut down automatically after a given idle time, a feature that the Git fsdaemon doesn't seem to have.And finally, based on
gix-notify, there now isRepository::monitor(), which allows you to watch all files relevant to a repository. It can be used, for instance, to auto-reload configuration when it changes, or to watch files change in the main and linked worktrees, with built-in gitignore support so one won't get overwhelmed with massive amounts of changes in fully ignored directories.And what's best is that based on this, incremental git status is coming, to give long-running applications the benefits of the git fsmonitor, more efficiently and without actually needing it.
gix-merge, finally with Git index compatibility.There were a couple of PRs with fixes to
gix-mergeby people who encountered issues and differences from Git. While that was to be expected, once these start to trickle in, they usually won't stop until one does something drastic, like… changing the last portions of code that affectedgix-mergeand led to differences with Git:gix-mergefor trees would do two tree diffs, and then try to reconcile the change from each pair of trees while rebuilding the destination tree. This had many problems, and would probably never lead to equivalency. So it was rewritten to do its own Git tree-walk across all three trees at the same time, collecting all needed data while at it.gix-diffgeneric rename tracker now tracks only file renames, without gathering additional data for directory renames, which probably never really worked all that well. Thus,gix-mergeextracts its own directory rename information which is needed as it has more information.git statusfast after such a merge completes.Oh, and submodule merges are now supported as well, so it really does seem like this could be the definitive version of
gix-merge(maybe with a future bugfix here and there).Preparations for a stable
gixreleaseHere it comes: I am pushing for incremental stability now. The general plan is to leave most, but not all, plumbing crates in major-zero land, but elevate parts of foundational plumbing crates into stability.
This works with
gix-macros's ability to selectively remove annotated functions, methods, and types that are marked#[unstable(since = "YY-MM-DD")]. This way, only the needed portion of a crate will be exposed.This doesn't work for plumbing crates if they expose types with unstable fields or methods, but it will work with care.
The plan is to use
unstableto gate most of thegixAPI alongside stabilizing portions of a few foundational crates. With the firstgix1.0 release, it will support stable usage of exactly one downstream consumer (the one which uses the smallest API surface). Then each month, a new downstream consumer should follow.The minor release of
gix1.X means "0 or more new features" for those who don't set the "unstable" feature forgix, and "possibly breaking changes" for consumers who do. This also means thatgix = "~1.0"allows only patch updates, which is needed for those who use "unstable", but don't want to be broken outside of their control.Alongside this machinery, I have improved
cargo smart-releaseto be able to perform actual API compatibility checks withcargo semver, so version bumps don't have to be conservative anymore. Instead, they can be done when needed, without letting accidental breakage slide.This is the best I could come up with, and I think it will work. Feedback is welcome.
Realistically, the first stable release will happen in March next year though as I expect most consumers to require
gix-ref, and that will see a lot of changes when reftable support lands.Trust improvements
The notion of
Trustis special in Gitoxide as it allows you to open any repository even without its mention insafe.directory. On the flip side, this also means that this better be implemented correctly so untrusted configuration and data can't sneak through.Trust is based on ownership, so non-owned repositories aren't trusted as long as one of the important directories (common-dir, git-dir, or the worktree dir) isn't owned by the current user.
However, these checks also take time, so if performance matters to this point, it's now possible to open with
gix::open::Options::default().with_enforced_trust(Trust::Full), and no check will be performed.The same is true when reducing trust, of course.
Lastly, there now is a way to register a callback to configure which options sub-repositories like linked worktrees or submodules are opened with, returning full control to the user.
gix-encoding, at lastWhen working with LLMs on pre-LLM code, they tend to poke a lot of holes into it as a side-effect of their exhaustive approach to everything.
Then one has a choice: spot-fix or fix it properly.
As with the
working-tree-encodingattribute an external crate was involved, a spot-fix wasn't exactly feasible or time-efficient. What was more efficient was to rewrite the Git-style encoding from scratch which resulted in…gix-encoding.The API is trivial, but what's a bit special is that it extracted mapping tables from
iconvby running it, which are stored as is in the repo. Thebuild.rsscript, based on feature toggles, will select a subset of them to compress withgix-zliband embed into the crate itself. This does increase the binary size of everyone who compiles in support, but applications have control over that viagixfeature forwarding directly.These filters are also very fast, while being exactly what Git does, so I'd hope that future LLM passes won't be poking holes into that quite as easily.
Community
Sirocco now writes, too
In October, Sam Reis provided us with much faster decompression using
Sirocco, and now he did it again by optimizing write compression to be up to 40% faster!In an experiment,
Omnidiffand its single-threaded census got sped up 3.1x by using Gitoxide.Faster
packed-refsrewritesYilin Chen added an optimisation that avoids an unnecessary revalidation when deleting from a
packed-refsbuffer. They showed how the deletion of a single ref in a one-million-refs file took 13.57 seconds, and then went down to 141 milliseconds.Fast object database lookups
Mark Blum improved tree-diff lookups in repositories with many packs by keeping recently used indexes near the front.
This is similar to an optimisation that Git received. This will benefit each thread that accesses the object database individually.
Gix in Cargo
There is nothing new here, but let's keep the horizon active. I still don't have
reseton my radar as other features and improvements must take priority.Cheers,
Sebastian
PS: The latest timesheets can be found here (2026).
All reactions