cmiles - info

Life, Tech and Unimportant Minutiae

Pointless Fossil - A Simple Fossil GUI - Month 1 - 3/13/2025

Created by Charles on 3/11/2025. Updated on 3/19/2025.

Recently I moved my personal projects to Fossil. The move has been fun and interesting!

I'm newer to Fossil and so far for my reasonably simple use cases the cli + built in website have been an easy to work with combination.

But I miss Fork - a fast and friendly git client for Mac and Windows...

What I miss:

So with a distinct lack of Fossil tooling out in the world I thought it would be fun to write my own helper program! Goals:

After about 4 weeks of personal time effort this is what Pointless Fossil - a Fossil SCM Windows Gui Helper looks like:

2025 March Pointless Fossil Main Window
2025 March Pointless Fossil Main Window.

It is very new but I'm actively using and enjoying it. This is very much a work in progress - not enough time to develop any interesting insights - but a few details that might be of interest are below.

Avalonia UI

Avalonia UI is one of several interesting cross-platform options for building desktop applications with .NET. Pointless Fossil is already the largest program I have ever built with Avalonia and overall it has been a positive experience. It seems to me that vs WPF you gain cross-platform potential and occasional syntax/framework improvements - you lose the large body of online help, there are fewer packages/less code available and there is not a great embedded web view.

Fossil JSON API

Fossil has a JSON API that allows you to retrieve information about the state of a repository - VERY useful!! But in the official binaries the json api is not available... To access the JSON API you will have to compile a custom version of Fossil - there is good documentation available, but this was an unexpected todo on the way to getting a working program!

Reading Standard Output

A requirement for the program was allowing the user to respond if Fossil asked a question on the command line. I hadn't written a similar feature before and I assumed that writing to stdin was going to be the messy part. It turned out that stdin wasn't the problem - many of the questions Fossil asks don't end with a new line and I was surprised by the code needed to read stdout in characters rather than lines! GitHub Copilot was very helpful in working out the details - the start of my code is below, I still can't help but wonder if there is a better/simpler way...

        var buffer = new byte[1024];
        var charBuffer = new char[1024];
        var decoder = Encoding.UTF8.GetDecoder();
        int bytesRead;

        while ((bytesRead = await reader.BaseStream.ReadAsync(buffer, 0, buffer.Length)) > 0)
        {
            var charsDecoded = decoder.GetChars(buffer, 0, bytesRead, charBuffer, 0);
            for (var i = 0; i < charsDecoded; i++)

DiffPlex

DiffPlex is Netstandard 1.0+ C# library to generate textual diffs - in addition to the core functionality WinUI, WPF, WinForms and Avalonia (via BAndysc's DiffPlex.Avalonia) controls are available. This MIT licensed library is definitely worth being aware of!


Tags:
Posts Before/After: