Skip to main content

The Joy of Forking

Β· 5 min read

I've recently gotten back into forking (more precisely, hard forking) multiple projects on GitHub.

This can, undeniably, pose a fun experience of which I'd like to give some short examples as well as the reasoning behind the fork.

NeoCatclock​

NeoCatclock is a fork of the venerable catclock by BarkyTheDog which itself is a slight update from the X10 original to work on modern X11 *nix systems.

To better understand the code, I condensed the original by removing the digital and analog modes
and, finally, the mode code itself.
This alone saved me about 950 lines of code.

The current process makes me study the GTK3+ documentation in-depth,
as the ultimate goal is to port catclock from Motif to GTK to make it portable.

Eventually, I plan on rewriting the application in Go, using my CoreGraphics framework
I originally wrote for Anima OS but now plan on bringing to all modern desktop platforms.

catclock

Yggdrasil​

Yggdrasil is a fork of trizbort.io
which itself is a re-implementation of trizbort, porting the latter from C# to the web.

Yggdrasil contains two fixes that have since been upstreamed.

What separates my fork from the original project is that I turned the web app into a desktop app
while also adding translation support.
Finally, my fork contains an exporter for my own Middangeard engine.

I have not actively worked on the project since 2019 but intend to revive it very soon,
just as I'm reviving Middangeard itself.

yggdrasil

Hippo Player Next (Working Title)​

Hippo Player Next (will probably be renamed to something else, to establish an original persona)
is a fork of media-player that removes both the Electron and the web app part
to focus solely on the desktop.

To achieve this desktop transformation, my fork utilizes go-astilectron,
a modern Electron binding to Go that uses a TCP socket as an IPC mechanism between the
Go application and the Electron renderer.

In order to better facilitate go-astilectron,
I upstreamed changes that enable more fine grained window control
without having to fall back on the Electron Remote module,
which can normally be used inside go-astilectron like the following
(if, like me, you're utilizing go-astilectron-bootstrap)

Code
Windows: []*bootstrap.Window{{
Homepage: "index.html",
MessageHandler: desktop.HandleMessages,
Options: &astilectron.WindowOptions{
BackgroundColor: astikit.StrPtr("#333"),
Center: astikit.BoolPtr(true),
Width: astikit.IntPtr(800),
Height: astikit.IntPtr(600),
WebPreferences: &astilectron.WebPreferences{
EnableRemoteModule: astikit.BoolPtr(true),
},
},
}},

Instead of the above and writing windowing code in JS, a window can now be set as Always on Top
by accessing the astilectron.Window struct and calling SetAlwaysOnTop(enable) on it.

I also removed the CSD (Client Side Decorations) of the original Electron implementation
in favor of re-using the OS' own window decorations.

Once baseline media support (which is utterly broken upstream) is established
and the app uses a proper SQLite database to save playlists,
I plan on adding support for classic MOD files and better support for theming.

hippo player

ScummC​

ScummC and SCUMM itself are something I've been fascinated with for quite a while.

The original by Alban Bedel has not been in active development since 2018.
However, there has been a slight update in the music department, courtesy of Masami Komuro

I lost my original local changes (mostly documentation) to a hard drive wipe at my old workplace,
but I plan on revisiting this project very soon.

Possible changes​

  • A modern, portable set of GUI tools (taking mild inspiration from Lebostein)
  • Slight syntactic changes (while producing identical byte-code).
  • A fork of the VSCode Extension with changes and additions.
  • Updates to the Wiki and, possibly, a dedicated website.
  • Improved debugging, taking pointers from MixNMojo.
  • A more thorough example (including iMuse audio).
  • Proper branding.

How to​

The following is a quick and simple step-by-step guide on how to create a fork of an existing project:

  1. On the top right of a GitHub repository, locate the fork button.
  2. Fork the repository into an account/organization of your choice.
  3. Locate and copy the link to your fork.
  4. Open a terminal shell.
  5. CD to a directory of your choice.
  6. git clone <Fork URL>
  7. Now type git remote add upstream <URL to original repository> to link back to the original project.
  8. You can now fetch upstream changes by typing git fetch upstream followed by git pull upstream.
  9. git log upstream/<branch> provides you with an upstream view of the commit log.
  10. You can also cherry pick changes from upstream by providing a hash (i e git cherry pick <SHA>).
  11. If you want to create pull requests from your new fork back to the upstream repository,
    push those changes to your own fork first, then create a pull request from your repository on GitHub. pull request The Open pull request button is located under Contribute near your commit history.


That's it for today. If you'd like to donate to my work, I'm now on GitHub SponsorsπŸ’–