Skip to content

pjullrich/pushin-cli

Back Import GitHub organizations, not just their repos

Commit details

Import GitHub organizations, not just their repos

Description

`pun import` can now create the destination organization on pushin.eu and file repositories under it, rather than always writing into the token user's own namespace. - `--into <namespace>` sets the destination for a single-repo import, creating the organization (handle, name, description) with you as its owner if it isn't there yet. - `--org <ORG>` now doubles as the destination: it already selected which GitHub repos to list, and filing those under your own login is almost never what was meant. Pass `--into <your own login>` for the old behaviour. A `Destination` type owns every path and push URL the import builds, so the user- and org-namespace flows can't drift apart. Safety properties, each covered by a test: - Nothing is created until the import is committed — a cancelled picker, an unreadable source repo or an illegal handle all leave the namespace untouched. - An organization that already exists is never edited. A matching handle is no evidence it is the same organization, so its profile stays as its owners wrote it. - A repository name already taken inside an organization is left alone entirely: metadata, issues and comments are all skipped, since it may be a colleague's. Git data still pushes, non-force. - Handles are normalized the way `Forgit.Handles` does (trim, downcase), so `--org Netflix` works; one that can never be legal (`rust-lang`, reserved words) is reported up front with a suggestion. - Only a 404 degrades: a GitHub rate limit or 5xx stops the run instead of creating a permanent profile-less organization, and a flaky membership check is no longer reported as a taken handle. `GitHubError` carries the status so those 404s can be told apart from transient failures.

Metadata

Author
Peter Ullrich PJUllrich@users.noreply.github.com
Committed
Commit

Contributors

  • Peter Ullrich PJUllrich@users.noreply.github.com Author
  • Claude Opus 4.8 (1M context) noreply@anthropic.com Co-author