← HOME - a blog about
xit RSS
██╗ ██╗██╗████████╗██╗ ██████╗ ██████╗
╚██╗██╔╝██║╚══██╔══╝██║ ██╔═══██╗██╔════╝
╚███╔╝ ██║ ██║ ██║ ██║ ██║██║ ███╗
██╔██╗ ██║ ██║ ██║ ██║ ██║██║ ██║
██╔╝ ██╗██║ ██║ ███████╗╚██████╔╝╚██████╔╝
╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═════╝
DEVLOG - OPTIONAL PATCHES, FORCE PUSH, SYMLINKS AND MORE -
March 13, 2025
I got my first couple bug reports...mama, we made it! In
#2 I forgot that in
xitdb, data made in a transaction is
temporarily mutable (an important perf optimization). It's
fun forgetting how my own database works. In
#4 I forgot
that when you merge, the base commit might not actually
contain the conflicting file. Oops.
Shortly after that, I made patch-based merging
optional.
It no longer generates patches during the clone, so cloning
repos with large histories won't outlast the heat death of
the universe. It still takes more time than git, because it
is decompressing and chunking each object...I'm working on
making it faster.
The next morning I woke up feeling particularly
masochistic, so I decided to work on the pack file code. I
noticed that some fetches were failing because the pack file
from the server contained a
REF_DELTA object, which is an
deltified object whose base object is not in the pack and is
expected to already be in the object store. I
fixed the
pack object reader to read these objects correctly, and then
told my therapist all about it later that day.
After recovering from that eldritch horror I implemented
--abort for merge and cherry-pick. This would normally be
easy because it's essentially just `git reset --hard`, which
xit already has in the form of `xit reset-dir`, but it
wasn't correctly cleaning up the merge state. Now it is, and
you can --abort all you want.
The next day I turned to `push`, because there was an
issue that I doubt people would enjoy: all pushes were force
pushes. This is because the server does not check if you're
about to obliterate any commits...that check is done
client-side by git! I
added the check to xit, along with a
-f flag to bypass it.
I had to get away from networking for a while so the next
day I turned to the TUI. I added an obvious optimization
that I should've added long ago:
buffered writing. The TUI
on windows was particularly slow but now it's actually
usable. I also made the TUI exit cleanly when
ctrl+c is
entered.
And that brings me to yesterday, when I added support for
symlinks. That was WAY more annoying than I thought it
would be. Fuck symlinks. Apparently windows agrees, because
it doesn't even let you make them without admin
privileges...so xit is forced to just make a normal file,
just like git does. Speaking of windows, I also added a nice
fix to prevent windows users from accidentally overwriting
the file mode in a repo.
That was just one week of work! Oh...and this blog is no
longer wrapping every single character in span tags. That
really triggered a lot of web developers. This is what
happens when you put a Zig programmer in charge of HTML. I
hope you all learned a valuable lesson.