Git integration — GitCore operations #8
Labels
No labels
area:config
area:contracts
area:engine
area:eventsourcing
area:frontend
area:git
area:ipc
area:persistence
area:provider
area:scaffold
area:terminal
type:user-story
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/peon#8
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?
User story
As a backend developer, I want a
GitCoremodule that wrapsgit2-rsto provide repository status, diff, commit, branch listing, and log operations, so that the checkpoint system and the frontend git panel have a reliable git abstraction.Acceptance criteria
GitCore (
git/core.rs)open_repo(path: &str) -> Result<git2::Repository, GitError>— discovers and opens a git repostatus(repo) -> Result<GitStatus, GitError>— lists staged, unstaged, untracked files and current branch usinggit2::StatusOptionsdiff(repo, from: Option<&str>, to: Option<&str>) -> Result<Vec<FileDiff>, GitError>— computes diff between refs (or working tree) and returns structuredFileDiffwith hunks and linescommit(repo, message, signature) -> Result<String, GitError>— stages all changes and commits, returns the commit hashbranches(repo) -> Result<Vec<BranchInfo>, GitError>— lists all branches with current indicator and upstreamlog(repo, limit: usize) -> Result<Vec<CommitInfo>, GitError>— returns recent commitscreate_branch(repo, name: &str) -> Result<(), GitError>— creates a new branch from HEADcheckout_branch(repo, name: &str) -> Result<(), GitError>— switches to an existing branchGitManager (
git/manager.rs)GitCoreand handlesGitCommandvariants from IPChandle_command(&self, cmd: GitCommand) -> Result<AppEvent, GitError>— dispatches to GitCore and returns appropriateAppEvent::GitStatusError types
GitErrorenum wrappinggit2::Errorand custom variants (RepoNotFound, BranchAlreadyExists, etc.)Tests
tempdirwithgit2::Repository::init()Out of scope
References
Dependencies
GitManager.handle_commandusesGitCommandfrom #6 but can be stubbed behind a feature gate and wired once #6 lands)main