Urgent.News

What's breaking now, across thousands of outlets.

Tech

Two Dimensional Version Control

During a summer Roguelike development event, I experimented with two-dimensional version control while writing a Roguelike game. My goal was to create a history of changes made while following the tutorial (horizontal axis) and the changes readers should make (vertical axis). I used Git branches, with each branch representing a chapter and pointing to the previous chapter as its parent.

This way, when I added changes to chapter 1, those changes were automatically pushed forward to chapters 2, 3, and so on. However, Jujutsu, a version control system, can do this automatically without managing branches and merges. I decided to try Jujutsu for this project, which would allow me to focus on the "writeup" column and edit any chapter at any time.

Jujutsu would then roll forward the changes from one chapter to the others. I used Jujutsu to improve the tile data structure while working on the dungeon generation chapter and found myself frequently going back and forth between chapters. I embraced the idea that commits were not set in stone but could be fixed if needed. Most of the changes were to the most recent chapters, but occasionally I went back and made improvements to earlier chapters, occasionally encountering merge conflicts.

To propagate changes both forwards and backwards, I used a combination of regular jj edit and jj absorb commands, but occasionally had to make certain changes manually to ensure the code compiled after the changes were made. I appreciated the ability to retrospectively improve version control change descriptions, as I spent time formatting them consistently.

Overall, Jujutsu proved to be a reasonable tool for this project, allowing me to develop the game while producing 50 intermediate versions with clean code for a tutorial series. The game was playable on the web, and I wrote notes but did not create a tutorial this time. I encouraged readers to reach out to me for any inquiries.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at redblobgames.com →

More in Tech

Pillow fades a P3 photo, sharp clips it: picking the JPEG default per target

The same Display P3 image went through Pillow 11.3 and sharp 0.34.5 with no color options set, and the two JPEGs went wrong in opposite directions. Pillow's copy came out washed out.

  • Pillow and sharp produce different results on P3 images
  • Pillow retains P3 numbers but loses profile
  • Sharp converts to sRGB, dropping profile

The Matrix Blue-Pill Syndrome

What if an artificial intelligence, while trying to protect us from danger, unintentionally helped bring that very danger about? It's been a while since I last wrote something.

  • AI amplifying misinformation poses dangers
  • Feedback loops turn minor errors into distortions
  • AI-generated fabrications hard to distinguish

More from Saturday 7 November →