module GitHUD.Git.Types (
  GitLocalRepoChanges(..)
  , zeroLocalRepoChanges
  , GitRepoState(..)
  , zeroGitRepoState
  , mergeGitLocalRepoChanges
  ) where

data GitLocalRepoChanges = GitLocalRepoChanges { GitLocalRepoChanges -> Int
localMod :: Int
                                 , GitLocalRepoChanges -> Int
localAdd :: Int
                                 , GitLocalRepoChanges -> Int
localDel :: Int
                                 , GitLocalRepoChanges -> Int
indexMod :: Int
                                 , GitLocalRepoChanges -> Int
indexAdd :: Int
                                 , GitLocalRepoChanges -> Int
indexDel :: Int
                                 , GitLocalRepoChanges -> Int
renamed  :: Int
                                 , GitLocalRepoChanges -> Int
conflict :: Int
                                 } deriving (Int -> GitLocalRepoChanges -> ShowS
[GitLocalRepoChanges] -> ShowS
GitLocalRepoChanges -> String
(Int -> GitLocalRepoChanges -> ShowS)
-> (GitLocalRepoChanges -> String)
-> ([GitLocalRepoChanges] -> ShowS)
-> Show GitLocalRepoChanges
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GitLocalRepoChanges] -> ShowS
$cshowList :: [GitLocalRepoChanges] -> ShowS
show :: GitLocalRepoChanges -> String
$cshow :: GitLocalRepoChanges -> String
showsPrec :: Int -> GitLocalRepoChanges -> ShowS
$cshowsPrec :: Int -> GitLocalRepoChanges -> ShowS
Show, GitLocalRepoChanges -> GitLocalRepoChanges -> Bool
(GitLocalRepoChanges -> GitLocalRepoChanges -> Bool)
-> (GitLocalRepoChanges -> GitLocalRepoChanges -> Bool)
-> Eq GitLocalRepoChanges
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GitLocalRepoChanges -> GitLocalRepoChanges -> Bool
$c/= :: GitLocalRepoChanges -> GitLocalRepoChanges -> Bool
== :: GitLocalRepoChanges -> GitLocalRepoChanges -> Bool
$c== :: GitLocalRepoChanges -> GitLocalRepoChanges -> Bool
Eq)

zeroLocalRepoChanges :: GitLocalRepoChanges
zeroLocalRepoChanges :: GitLocalRepoChanges
zeroLocalRepoChanges = GitLocalRepoChanges :: Int
-> Int
-> Int
-> Int
-> Int
-> Int
-> Int
-> Int
-> GitLocalRepoChanges
GitLocalRepoChanges { localMod :: Int
localMod = Int
0
                             , localAdd :: Int
localAdd = Int
0
                             , localDel :: Int
localDel = Int
0
                             , indexMod :: Int
indexMod = Int
0
                             , indexAdd :: Int
indexAdd = Int
0
                             , indexDel :: Int
indexDel = Int
0
                             , renamed :: Int
renamed  = Int
0
                             , conflict :: Int
conflict = Int
0
                             }

mergeGitLocalRepoChanges :: GitLocalRepoChanges -> GitLocalRepoChanges -> GitLocalRepoChanges
mergeGitLocalRepoChanges :: GitLocalRepoChanges -> GitLocalRepoChanges -> GitLocalRepoChanges
mergeGitLocalRepoChanges GitLocalRepoChanges
a GitLocalRepoChanges
b =
  GitLocalRepoChanges :: Int
-> Int
-> Int
-> Int
-> Int
-> Int
-> Int
-> Int
-> GitLocalRepoChanges
GitLocalRepoChanges {
    localMod :: Int
localMod   = (GitLocalRepoChanges -> Int
localMod GitLocalRepoChanges
a) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (GitLocalRepoChanges -> Int
localMod GitLocalRepoChanges
b)
    , localAdd :: Int
localAdd = (GitLocalRepoChanges -> Int
localAdd GitLocalRepoChanges
a) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (GitLocalRepoChanges -> Int
localAdd GitLocalRepoChanges
b)
    , localDel :: Int
localDel = (GitLocalRepoChanges -> Int
localDel GitLocalRepoChanges
a) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (GitLocalRepoChanges -> Int
localDel GitLocalRepoChanges
b)
    , indexMod :: Int
indexMod = (GitLocalRepoChanges -> Int
indexMod GitLocalRepoChanges
a) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (GitLocalRepoChanges -> Int
indexMod GitLocalRepoChanges
b)
    , indexAdd :: Int
indexAdd = (GitLocalRepoChanges -> Int
indexAdd GitLocalRepoChanges
a) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (GitLocalRepoChanges -> Int
indexAdd GitLocalRepoChanges
b)
    , indexDel :: Int
indexDel = (GitLocalRepoChanges -> Int
indexDel GitLocalRepoChanges
a) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (GitLocalRepoChanges -> Int
indexDel GitLocalRepoChanges
b)
    , renamed :: Int
renamed  = (GitLocalRepoChanges -> Int
renamed GitLocalRepoChanges
a) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (GitLocalRepoChanges -> Int
renamed GitLocalRepoChanges
b)
    , conflict :: Int
conflict = (GitLocalRepoChanges -> Int
conflict GitLocalRepoChanges
a) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (GitLocalRepoChanges -> Int
conflict GitLocalRepoChanges
b)
  }

data GitRepoState =
  GitRepoState {
    GitRepoState -> GitLocalRepoChanges
gitLocalRepoChanges :: GitLocalRepoChanges
    , GitRepoState -> String
gitLocalBranch :: String
    , GitRepoState -> String
gitCommitShortSHA :: String
    , GitRepoState -> String
gitCommitTag :: String
    , GitRepoState -> String
gitRemote :: String
    , GitRepoState -> String
gitRemoteTrackingBranch :: String
    , GitRepoState -> Int
gitStashCount :: Int
    , GitRepoState -> Int
gitCommitsToPull :: Int
    , GitRepoState -> Int
gitCommitsToPush :: Int
    , GitRepoState -> Int
gitMergeBranchCommitsToPull :: Int
    , GitRepoState -> Int
gitMergeBranchCommitsToPush :: Int
  }
  deriving (GitRepoState -> GitRepoState -> Bool
(GitRepoState -> GitRepoState -> Bool)
-> (GitRepoState -> GitRepoState -> Bool) -> Eq GitRepoState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GitRepoState -> GitRepoState -> Bool
$c/= :: GitRepoState -> GitRepoState -> Bool
== :: GitRepoState -> GitRepoState -> Bool
$c== :: GitRepoState -> GitRepoState -> Bool
Eq, Int -> GitRepoState -> ShowS
[GitRepoState] -> ShowS
GitRepoState -> String
(Int -> GitRepoState -> ShowS)
-> (GitRepoState -> String)
-> ([GitRepoState] -> ShowS)
-> Show GitRepoState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GitRepoState] -> ShowS
$cshowList :: [GitRepoState] -> ShowS
show :: GitRepoState -> String
$cshow :: GitRepoState -> String
showsPrec :: Int -> GitRepoState -> ShowS
$cshowsPrec :: Int -> GitRepoState -> ShowS
Show)

zeroGitRepoState :: GitRepoState
zeroGitRepoState :: GitRepoState
zeroGitRepoState =
  GitRepoState :: GitLocalRepoChanges
-> String
-> String
-> String
-> String
-> String
-> Int
-> Int
-> Int
-> Int
-> Int
-> GitRepoState
GitRepoState {
    gitLocalRepoChanges :: GitLocalRepoChanges
gitLocalRepoChanges = GitLocalRepoChanges
zeroLocalRepoChanges
    , gitLocalBranch :: String
gitLocalBranch = String
""
    , gitCommitShortSHA :: String
gitCommitShortSHA = String
""
    , gitCommitTag :: String
gitCommitTag = String
""
    , gitRemote :: String
gitRemote = String
""
    , gitRemoteTrackingBranch :: String
gitRemoteTrackingBranch = String
""
    , gitStashCount :: Int
gitStashCount = Int
0
    , gitCommitsToPull :: Int
gitCommitsToPull = Int
0
    , gitCommitsToPush :: Int
gitCommitsToPush = Int
0
    , gitMergeBranchCommitsToPull :: Int
gitMergeBranchCommitsToPull = Int
0
    , gitMergeBranchCommitsToPush :: Int
gitMergeBranchCommitsToPush = Int
0
  }