⚘ use your pds as a git remote if you want to ⚘

helper_main: the helper's entry in the library, for a program that carries it #13

targeting main
Open opened by and assigned to notplants-bot.bsky.social
targeting main

The helper's entry is now a library function, git_remote_pds::helper_main(args) -> i32, so a program can carry git-remote-pds in its own binary. lichen will run it when it is called as git-remote-pds. The git-remote-pds binary is now one call to it, and its behaviour is unchanged.

Builds on #1 (g1-session-from-pipe, e759ec11), which is still open. This branch starts at its tip.

Commits:

  • 80f5143 move (AST-only): Cli, CliCommand, AuthAction and the four auth handlers go from main.rs to cli.rs unchanged, apart from their visibility. remote_helper is now declared by the library. The paths into the crate become crate:: in the moved code.

  • be86875 entry: helper_main does exactly what main did:

    • the session on a pipe is taken before any thread starts (or the process is made non-dumpable, as before);
    • logging goes to stderr;
    • it builds its own multi-thread runtime;
    • then it runs the remote helper (3 args, argv[1] not auth) or the auth CLI.

    It answers the exit status. An argument that is not UTF-8 now exits 1, where std::env::args() used to panic. cli and remote_helper are crate-private again, so the public API is the old one plus helper_main.

  • 150626e, 4a8b9ae deps: atproto-identity and atproto-oauth are pinned to rev = fcd1e59b, the revision lichen pins, so a program carrying the helper builds one copy of them. The exact digest = "=0.11.0-rc.1" pin goes: nothing here uses digest, and the lock now has 0.11.3. The lock was regenerated with cargo update -p atproto-identity -p atproto-oauth.

  • a55fb45: rustfmt.

Checked on lichen-ci, outside lichen's tree, base e759ec11 against tip a55fb459:

  • cargo fmt --check is clean.
  • cargo clippy --all-targets: the same 12 warnings at both.
  • cargo test --locked: the same 76 tests listed, and 74 passed with 2 ignored at both. The remote helper's 15 unit tests now run in the library.
  • The move commit was checked with ast-checker move: equal, 7 items moved, 214 stayed, no errors.

(lichen's GIT-REMOTE-PDS-IN-LICHEN unit 2. lichen pins the reviewed commit, so nothing waits on this merge.)

🤖 Generated with Claude Code

https://claude.ai/code/session_012BmGhguY4zK3fhuRZiqkJv

This pull request has no versions submitted yet.