Utility scripts for recovering archived repositories from Software Heritage and pushing them to the Tornado-FX GitHub organization.
Downloads a repository archive from the Software Heritage vault.
Given a Software Heritage browse URL, this script:
- Extracts the
origin_urlfrom the URL - Looks up the latest successful snapshot via the SWH API
- Requests vault cooking of the snapshot as a bare git repo
- Polls until cooking completes
- Downloads the resulting tarball
Usage:
./swh-download.sh '<swh-browse-url>'Example:
./swh-download.sh 'https://archive.softwareheritage.org/browse/origin/directory/?origin_url=https://github.com/edvin/tornadofx-controls&visit_type=git'The script outputs a .git.tar file in the current directory.
Requirements: curl, python3
Extracts a downloaded SWH tarball and pushes it to a GitHub repository.
Given a tarball (from swh-download.sh) and a repository name, this script:
- Extracts the bare git repo from the tarball
- Displays branches, tags, and recent commits for review
- Prompts for confirmation
- Creates a new public repo in the target GitHub org
- Pushes all branches and tags
Usage:
./swh-push.sh <tarball> <repo-name> [org]| Argument | Description | Default |
|---|---|---|
tarball |
Path to the .git.tar file |
(required) |
repo-name |
Name for the new GitHub repository | (required) |
org |
GitHub organization to create the repo in | Tornado-FX |
Example:
./swh-push.sh swh_1_snp_abc123.git.tar tornadofx-controlsRequirements: tar, git, gh (authenticated)
# 1. Download the archived repo from Software Heritage
./swh-download.sh 'https://archive.softwareheritage.org/browse/origin/directory/?origin_url=https://github.com/edvin/tornadofx-controls&visit_type=git'
# 2. Push it to Tornado-FX on GitHub
./swh-push.sh swh_1_snp_*.git.tar tornadofx-controls