Pipeline Git.hs: typed git operations

t-603.3·WorkTask·
·
·
·Omni/Pipeline.hs
Parent:t-603·Created4 days ago·Updated4 days ago

Description

Edit

Create Omni/Pipeline/Git.hs - typed git operations wrapper.

Thin wrapper around git process calls. Each function calls git via System.Process.readProcessWithExitCode and returns Either GitError a.

data GitError = GitError { geCommand :: Text, geExitCode :: Int, geStderr :: Text }

Functions:

  • createWorktree :: FilePath -> Text -> Text -> IO (Either GitError FilePath)

-- (repoRoot, path, branch)

  • removeWorktree :: FilePath -> FilePath -> IO (Either GitError ())
  • checkoutBranch :: FilePath -> Text -> IO (Either GitError ())
  • createBranch :: FilePath -> Text -> Text -> IO (Either GitError ())

-- (workspace, branchName, startPoint)

  • deleteBranch :: FilePath -> Text -> IO (Either GitError ())
  • cherryPick :: FilePath -> Text -> IO (Either GitError Text)

-- returns commit hash on success

  • abortCherryPick :: FilePath -> IO (Either GitError ())
  • commitCountBetween :: FilePath -> Text -> Text -> IO (Either GitError Int)
  • currentBranchSha :: FilePath -> Text -> IO (Maybe Text)
  • isCleanWorkspace :: FilePath -> IO Bool
  • worktreeExists :: FilePath -> IO Bool
  • revertLastCommit :: FilePath -> IO (Either GitError ())

Include a helper: runGit :: FilePath -> [String] -> IO (Either GitError String)

No tests needed for this module - it's a thin wrapper. Verified by typecheck.

Verify: typecheck.sh Omni/Pipeline/Git.hs

Timeline (2)

🔄[human]Open → InProgress4 days ago
🔄[human]InProgress → Done4 days ago