Skip to content

Feature: pluggable issue backends (local git refs for offline mode) #72

@remenoscodes

Description

@remenoscodes

Hey, nice project! I noticed gitv's architecture already separates the GitHub API layer (src/github/) from the UI (src/ui/). That separation makes it possible to support alternative issue backends without touching the TUI code.

One backend worth considering: issues stored locally as Git refs. There's an open format for this — issues live under refs/issues/* as commit chains with Git trailers for metadata:

refs/issues/<uuid>
  → commit: "Close issue"       State: closed
    → commit: "Reproduced"      (comment body)
      → commit: "Fix login"     State: open, Labels: bug, Priority: high

With the git2 crate, reading them is straightforward:

let repo = Repository::open(".")?;

// List all issues (like for-each-ref over refs/issues/*)
for reference in repo.references_glob("refs/issues/*")? {
    let reference = reference?;
    let commit = reference.peel_to_commit()?;
    let subject = commit.summary().unwrap_or("");
    let message = commit.message().unwrap_or("");
    // Parse trailers (State, Labels, Priority) from message
}

// Walk issue history (comments, state changes)
let mut revwalk = repo.revwalk()?;
revwalk.push(issue_commit_id)?;
for oid in revwalk {
    let commit = repo.find_commit(oid?)?;
    // Each commit is an event: comment, state change, edit
}

No HTTP client needed — pure local reads. What this would give gitv users:

  • Offline mode — full read/write without network
  • Platform independence — same TUI for GitHub, GitLab, Gitea, or no platform
  • Unique angle — no other issue TUI supports local-first workflows

The format spec is here: https://github.com/remenoscodes/git-native-issue/blob/main/ISSUE-FORMAT.md

A read-only implementation would be minimal — just git2 ref iteration + commit walking. Happy to help if you're interested.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions