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.
Branches and main
Section titled “Branches and main”- Finished work is the
mainbranch 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 mainlists one line per ship. That is the listwhoandundonumber.
startmakes a branch named<your first name>/<the name>. Any branch other thanmaincounts 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 intomainwould 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 latestmain.startwith the name of a branch that is already part ofmain, here and on the server, does not switch to where that branch was left. It moves the branch to the latestmain, as if the work were new. A branch whose own commits a squashed pull request left offmaingetsmainmerged into it instead.
savecommits everything (git add -A), merges the latestmaininto 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 --keepsettles a file withgit merge-file --oursor--theirson 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, asgit checkout --oursor--theirswould.- 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.
shipdoes a save, runs the checks on the result, then pushes one merge commit tomain:mainas 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-Agentfor an agent’s work, andSaturn-Branch. The push is never forced. Themainit 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, andshipbrings 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,shipchecks 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.
undobuilds a revert of the ship in a temporary worktree and pushes it tomain. It then puts the work back on its branch: the branch takes inmainas it was just before the revert, and on top of that goes a merge of the revert that keeps the branch’s own files, asgit merge -s ourswould make. The revert then counts as dealt with there. Without that, mergingmainwould delete the work from its author’s folder too. The branch is the one in the ship’sSaturn-Branchline. 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
Section titled “An agent’s work”- An agent’s work is marked by
branch.<name>.saturn-agentin the folder’s git settings, set when the agent starts or saves on the branch, and by aSaturn-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 onmain.
Settings git is run with
Section titled “Settings git is run with”- Every git command is run with
merge.ff=true,rerere.enabled=falseandmerge.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.rererewould 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=binaryin a file of defaults,saturn-attributesin the project’s.gitfolder, and every git command is pointed at it withcore.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-ignorein the project’s.gitfolder, and every git command is pointed at it withcore.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
Section titled “The window”- 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 isgit merge --ff-onlyof the server’smain(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 thosegit log --first-parent HEAD..origin/mainlists, 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 --rawfor that one path: onmainfor the ships, the last 60 that changed it, and onmain..HEADfor 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 leftmain. - 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 handinggit lfs fetcha commit made for the purpose, on no branch, with that pointer as its only file. - Bring back is
git restore --source=<commit> --worktreefor 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.