Skip to main content

Module sync

Module sync 

Source
Expand description

Keeping one library across machines, through a git repository the user owns.

lore keeps its own clone of the repository in its data directory and never touches git state anywhere else. The library file stays where it always was; a sync reads it, merges it by entry with what the repository holds, writes the result back, and commits and pushes it from the clone.

Git is only the transport. It never merges anything itself, because it merges by line and two machines that each saved a command have both appended to the same list, which git reports as a conflict although nothing clashes. See merge.

lore never sees a password or a token. It runs the user’s own git, which already knows their SSH key or stored login.

Modules§

merge
Combining two copies of a library that changed apart.

Structs§

Report
What a sync did.

Enums§

Mode
How a sync was started, which decides how it may fail.

Functions§

disconnect
Stops syncing on this machine. The library stays, and so does the repository.
init
Connects this machine to a repository, creating one first when no address is given and the GitHub CLI can do it.
is_configured
Whether this machine has sync set up.
last_error
Why the last background sync failed, if it did.
refresh_if_stale
Starts a background sync if the last one was long enough ago that other machines may have changed something.
run
Merges this machine’s library with the repository’s and pushes the result.
spawn
Starts a sync in the background, when sync is set up, and returns at once.
status
Prints where this machine syncs, when it last did, and why it last failed.