Skip to content
zit A mirror the repository knows about
Login

A mirror the repository knows about

Keeping a GitHub copy of a zit repository used to mean a script and a timer: clone, pull, zit export-git, git push, on a schedule, somewhere only its author could see. 0.3.34 makes the mirror a property of the repository, the way Fossil does it.

zit git export ../mirror --autopush [email protected]:someone/project.git

exports every check-in into a Git repository at ../mirror, pushes the main branch to main on GitHub, and remembers both. After that a bare zit git export, from a hook, a cron job, or a forge running against a bare store, does the whole round trip, and zit git status says where the mirror is and whether it is current. The push is fast-forward only, so a mirror never overwrites or deletes anything on the remote.

The part a script never got right was identity. A Git host decides whose commit it is from the email address, and a zit login need not be anyone's username there, so every mirrored commit used to land as an unknown [email protected]. Each user in the repository now has a contact, as in Fossil, set with zit users contact LOGIN INFO, and the export takes the address from it.

The URL is stored in the repository's config, so zit refuses one that carries a password. Credentials belong to Git: a credential helper, or an SSH remote.

The release also brings landing accept --expect-target, which lets a forge refuse an accept once the target it tested against has moved, and an fsync that makes a successful pack or shun --force survive a power cut.