Skip to content

How it maps onto git

For a game on git. Large files and locks have pages of their own, and a game on Saturn Rings works another way.

  • Finished work is the main branch on the server. Nobody works on it directly, and none of the verbs ever check it out, so they behave the same in a worktree.
  • git log --first-parent main lists one line per ship. That is the list who and undo number.
  • start makes a branch named <your first name>/<the name>. Any branch other than main counts as a piece of work, including one an agent session created. A branch is finished when it has had something saved on it and merging it into main would change nothing, which covers a ship, a teammate’s ship of a branch you both saved to, and a pull request merged in any of GitHub’s three ways. What is started after finished work begins from the latest main.
  • start with the name of a branch that is already part of main, here and on the server, does not switch to where that branch was left. It moves the branch to the latest main, as if the work were new. A branch whose own commits a squashed pull request left off main gets main merged into it instead.
  • save commits everything (git add -A), merges the latest main into the branch, and pushes the branch. It refuses new files that look like secrets or are over 50 MB unless given --force, including when it is finishing a clash. A large file is refused only past 2 GB.
  • save --keep settles a file with git merge-file --ours or --theirs on the three versions the paused merge holds, which decides only the conflicting hunks. A file with no base version, a binary file, or one a side deleted is taken whole, as git checkout --ours or --theirs would.
  • A clashing file with lines to fix is settled once no marker lines are left in it: none of the named ones, and no more ======= lines than the file had of its own when the clash began.
  • ship does a save, runs the checks on the result, then pushes one merge commit to main: main as it is plus the branch. Its message is the title, any text given with the title and then the description, one line per save, and then the trailers: credits given with the title or the description, Saturn-Agent for an agent’s work, and Saturn-Branch. The push is never forced. The main it goes on top of is the one the checks ran against, read before they start. If a teammate shipped while the checks ran, the push is refused, and ship brings their work in, checks again and retries. The commit that ships is read before the checks as well: if something is saved in the folder while they run, ship checks again with that in. After a ship, the branch’s copy on the server is deleted, unless it holds a save that was not part of the ship.
  • undo builds a revert of the ship in a temporary worktree and pushes it to main. It then puts the work back on its branch: the branch takes in main as it was just before the revert, and on top of that goes a merge of the revert that keeps the branch’s own files, as git merge -s ours would make. The revert then counts as dealt with there. Without that, merging main would delete the work from its author’s folder too. The branch is the one in the ship’s Saturn-Branch line. A pull request merged on GitHub has no such line, so its branch is the one GitHub’s merge message names or, failing that, the one that holds the merge’s second parent.
  • An agent’s work is marked by branch.<name>.saturn-agent in the folder’s git settings, set when the agent starts or saves on the branch, and by a Saturn-Agent: <name> trailer on each commit it saves, which is how teammates see it. A branch is the agent’s while either is there for commits not yet on main.
  • Every git command is run with merge.ff=true, rerere.enabled=false and merge.conflictStyle=merge, whatever the person’s own git is set to. Fast-forward only would refuse each merge that brings in a teammate’s ship. rerere would settle a clash it remembers on its own, and leave a merge that nothing could finish. And the marker lines Saturn describes are the two-sided kind.
  • In a game made with an engine that has scenes and prefabs, each kind is given merge=binary in a file of defaults, saturn-attributes in the project’s .git folder, and every git command is pointed at it with core.attributesFile. Git reads that file after the project’s own .gitattributes, which is why a line there still decides. Git reads one such file, so the person’s own, if they have one, is copied in under Saturn’s lines, where its lines win. The file is written again only when what it should say has changed.
  • What macOS leaves in folders is named in saturn-ignore in the project’s .git folder, and every git command is pointed at it with core.excludesFile. Git reads it after the project’s own .gitignore, and the person’s own such file is copied in under Saturn’s lines.
  • The window’s Get the latest is a save on a piece of work. On main, or anywhere that is not work in progress, it is git merge --ff-only of the server’s main (a plain merge on a branch whose pull request was squashed), which git refuses without changing anything when a file it would write has changes that are not saved. The ships it counts are those git log --first-parent HEAD..origin/main lists, and none when merging them would change nothing in the folder, as after a squashed pull request of the folder’s own work.
  • A file’s history in the window is git log --first-parent --raw for that one path: on main for the ships, the last 60 that changed it, and on main..HEAD for the saves of the work in hand. A save that brought a ship in is left out when it holds what the ship holds. A teammate’s version is the file on their branch, when it differs from the file where their branch left main.
  • What a version held is read with git cat-file. For a large file that is the pointer, and the content is read from .git/lfs/objects. Content that is not there is fetched by handing git lfs fetch a commit made for the purpose, on no branch, with that pointer as its only file.
  • Bring back is git restore --source=<commit> --worktree for the one file, so it comes out as git would have written it then, and git’s own note of the file is left alone, which is why it shows as changed. For a large file the content is then copied over the pointer, as after any checkout. Nothing is committed.