Expand description
Repository archive discovery and safe refresh helpers for thesa.
Made by Trevor Knott for Knott Dynamics.
RepoForge is intentionally small: it knows how to find Git worktrees inside an
archive root, derive a stable owner/repo slug from a GitHub or Bitbucket remote or path
layout, and refresh those clones with git pull --ff-only.
It does not write manifests, own terminal UI, or mutate dirty worktrees.
The refresh path refuses dirty worktrees before pulling, so callers do not silently overwrite local archive edits.
use std::path::Path;
assert_eq!(
repoforge::parse_github_remote_slug("https://github.com/octocat/Hello-World.git"),
Some("octocat/Hello-World".to_string())
);
assert_eq!(
repoforge::fallback_archive_slug(
Path::new("archives"),
Path::new("archives/octocat/Hello-World"),
),
"octocat/Hello-World"
);Structs§
- GitArchive
Candidate - A discovered Git archive worktree.
- GitRefresh
Entry - Successful refresh result for one worktree.
- GitRefresh
Failure - Failed refresh result for one worktree.
- GitRefresh
Summary - Summary returned by
refresh_git_archives.
Enums§
- GitProvider
- Recognized Git hosting providers for archive remotes.
- GitRefresh
Status - Outcome for one successful archive refresh.
- Repo
Forge Error - Errors returned while discovering or refreshing Git archive worktrees.
Constants§
- AGENT_
GUIDE - Operational guide for autonomous agents using RepoForge.
Functions§
- discover_
git_ archives - Discover Git worktrees under an archive root.
- discover_
git_ archives_ for_ owner - Discover Git worktrees for one owner, organization, or workspace under an archive root.
- ensure_
clean_ git_ worktree - Fail if a worktree has local changes according to
git status --porcelain. - fallback_
archive_ slug - Derive a slug from archive path layout when no GitHub remote is available.
- git_
archive_ slug - Derive a stable archive slug from a remote URL or archive path layout.
- git_
head - Read the current
HEADcommit hash for a worktree. - git_
remote_ origin_ url - Read
remote.origin.urlfrom a Git worktree. - git_
web_ url_ for_ slug - Build a canonical provider web URL from an
owner/reposlug. - github_
web_ url_ for_ slug - Build a canonical
https://github.com/owner/repoURL from anowner/reposlug. - is_
git_ worktree - Return true when
pathlooks like a Git worktree. - parse_
bitbucket_ remote_ slug - Parse a Bitbucket Cloud remote URL into
workspace/repo. - parse_
git_ remote_ slug - Parse a recognized GitHub or Bitbucket remote into its provider and
owner/reposlug. - parse_
github_ remote_ slug - Parse a GitHub remote URL into
owner/repo. - refresh_
git_ archives - Refresh multiple Git archives with bounded concurrency.
- refresh_
one_ git_ archive - Refresh one Git archive with
git pull --ff-only. - run_
git_ capture - Run
gitinrepo_pathand capture stdout/stderr. - split_
owner_ repo_ slug - Split a normalized
owner/reposlug into borrowed owner and repo parts.
Type Aliases§
- Result
- Result type used by RepoForge APIs.