Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

tfx

Utility scripts for recovering archived repositories from Software Heritage and pushing them to the Tornado-FX GitHub organization.

Scripts

swh-download.sh

Downloads a repository archive from the Software Heritage vault.

Given a Software Heritage browse URL, this script:

  1. Extracts the origin_url from the URL
  2. Looks up the latest successful snapshot via the SWH API
  3. Requests vault cooking of the snapshot as a bare git repo
  4. Polls until cooking completes
  5. 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


swh-push.sh

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:

  1. Extracts the bare git repo from the tarball
  2. Displays branches, tags, and recent commits for review
  3. Prompts for confirmation
  4. Creates a new public repo in the target GitHub org
  5. 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-controls

Requirements: tar, git, gh (authenticated)

Typical Workflow

# 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

About

Utility scripts for recovering archived repos from Software Heritage

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages