Feature: Import collections from a Git URL #97
Labels
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_slides#97
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Currently there is no way to pull a set of slides into hero_slides from an external Git repository. Users need a way to import and sync slide collections.
Proposed solution
Add a command (or UI flow) that takes a Git URL, clones/pulls the repo into the correct local location, and registers it as a collection in hero_slides.
We already have hero_lib code for Git operations (clone, pull, resolve to the right path), so the implementation can lean on that rather than rolling our own.
Acceptance criteria
pull/syncNotes
hero_lib already provides Git helpers — look for the existing module before implementing anything custom.
Investigated reusing
herolib_os::githere — it's a net regression for this feature, so we keep our own moduleThe issue says to lean on hero_lib's git helpers "rather than rolling our own" with "no new auth surface." I checked the actual
herolib_os::gitmodule (crates/os/src/git/, lockedmainrev) against ourhero_slides_lib/src/git.rs. Two blockers make a switch worse, not better:1.
GitRepocan't authenticate a private repo. Itspull/push/fetch/commitare baregit -C <path> ...— nohttp.extraHeadertoken and noGIT_TERMINAL_PROMPT=0. A private Forgejo collection would fail auth, and on a tty-less server it would hang on the credential prompt. Token injection in herolib lives only in theForgelayer, which is hard-wired to the flat$PATH_CODE/{name}layout and can't operate on an arbitrary collection root the way our code (andGitRepo::new(path)) does.2. herolib has zero Git-LFS support. Not a single
lfsreference in the module. Our collections are image-heavy/LFS-backed, and our module's whole reason for existing is the native HTTP LFS batch-API download (nogit-lfsbinary required), pointer parsing + sha256 verify,GIT_LFS_SKIP_SMUDGE=1on clone,--skip-worktreemarking, andlfs_countsfor the progress bar. None of that has an equivalent.What a switch would map to:
git_status→GitRepo::status()(clean);clone_collection→GitTree::clone_repo().branch().execute()(but loses token auth + skip-smudge + dest-cleanup-on-failure);pull/push→repo.pull()/repo.commit().push()(unauthenticated → breaks private collections); LFS → no replacement, kept regardless. We'd delete working, tested code to lose auth + LFS.Decision: keep
hero_slides_lib/src/git.rsas-is. herolib is the broader library in general, but it's missing exactly the two things this feature needs most.Filed the upstream gap so
GitRepocan eventually become reusable for private repos: lhumina_code/hero_lib#150 (token-injected pull/push, optional LFS). If/when Gap 1 there lands, we can optionally lean onGitRepofor richer read-only introspection (log/diff/blame) while keeping our clone/sync/LFS path.