gitHUD 1.2.0 → 1.3.0
raw patch · 10 files changed
+366/−203 lines, 10 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- GitHUD.Config.Types: [confNoUpstreamIndicatorColor] :: Config -> Color
- GitHUD.Config.Types: [confNoUpstreamIndicatorIntensity] :: Config -> ColorIntensity
- GitHUD.Config.Types: [confNoUpstreamIndicator] :: Config -> String
- GitHUD.Config.Types: [confNoUpstreamStringColor] :: Config -> Color
- GitHUD.Config.Types: [confNoUpstreamStringIntensity] :: Config -> ColorIntensity
- GitHUD.Config.Types: [confNoUpstreamString] :: Config -> String
- GitHUD.Config.Types: [confRemoteCommitsBothPullPush] :: Config -> String
- GitHUD.Config.Types: [confRemoteCommitsIndicator] :: Config -> String
- GitHUD.Config.Types: [confRemoteCommitsOnlyPull] :: Config -> String
- GitHUD.Config.Types: [confRemoteCommitsOnlyPush] :: Config -> String
- GitHUD.Git.Types: [gitRemoteCommitsToPull] :: GitRepoState -> Int
- GitHUD.Git.Types: [gitRemoteCommitsToPush] :: GitRepoState -> Int
- GitHUD.Terminal.Prompt: addRemoteCommits :: ShellOutput
- GitHUD.Terminal.Prompt: addUpstreamIndicator :: ShellOutput
- GitHUD.Types: getConfig :: MonadReader OutputConfig m => m Config
- GitHUD.Types: getRepoState :: MonadReader OutputConfig m => m GitRepoState
- GitHUD.Types: getShell :: MonadReader OutputConfig m => m Shell
+ GitHUD.Config.Types: [confMergeBranchCommitsBothPullPush] :: Config -> String
+ GitHUD.Config.Types: [confMergeBranchCommitsIndicator] :: Config -> String
+ GitHUD.Config.Types: [confMergeBranchCommitsOnlyPull] :: Config -> String
+ GitHUD.Config.Types: [confMergeBranchCommitsOnlyPush] :: Config -> String
+ GitHUD.Config.Types: [confNoTrackedUpstreamIndicatorColor] :: Config -> Color
+ GitHUD.Config.Types: [confNoTrackedUpstreamIndicatorIntensity] :: Config -> ColorIntensity
+ GitHUD.Config.Types: [confNoTrackedUpstreamIndicator] :: Config -> String
+ GitHUD.Config.Types: [confNoTrackedUpstreamStringColor] :: Config -> Color
+ GitHUD.Config.Types: [confNoTrackedUpstreamStringIntensity] :: Config -> ColorIntensity
+ GitHUD.Config.Types: [confNoTrackedUpstreamString] :: Config -> String
+ GitHUD.Config.Types: [confShowPartCommitsToOrigin] :: Config -> Bool
+ GitHUD.Config.Types: [confShowPartLocalBranch] :: Config -> Bool
+ GitHUD.Config.Types: [confShowPartLocalChangesState] :: Config -> Bool
+ GitHUD.Config.Types: [confShowPartMergeBranchCommitsDiff] :: Config -> Bool
+ GitHUD.Config.Types: [confShowPartRepoIndicator] :: Config -> Bool
+ GitHUD.Config.Types: [confShowPartStashes] :: Config -> Bool
+ GitHUD.Git.Types: [gitMergeBranchCommitsToPull] :: GitRepoState -> Int
+ GitHUD.Git.Types: [gitMergeBranchCommitsToPush] :: GitRepoState -> Int
+ GitHUD.Terminal.Prompt: addMergeBranchCommits :: ShellOutput
+ GitHUD.Terminal.Prompt: addNoTrackedUpstreamIndicator :: ShellOutput
+ GitHUD.Terminal.Prompt: buildPrompt :: ShellOutput
+ GitHUD.Types: askConfig :: MonadReader OutputConfig m => m Config
+ GitHUD.Types: askRepoState :: MonadReader OutputConfig m => m GitRepoState
+ GitHUD.Types: askShell :: MonadReader OutputConfig m => m Shell
- GitHUD.Config.Types: Config :: String -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> String -> String -> String -> String -> String -> String -> Color -> ColorIntensity -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> Config
+ GitHUD.Config.Types: Config :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> String -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> String -> String -> String -> String -> String -> String -> Color -> ColorIntensity -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> String -> Color -> ColorIntensity -> Config
Files
- gitHUD.cabal +1/−1
- src/GitHUD/Config/Parse.hs +60/−20
- src/GitHUD/Config/Types.hs +36/−22
- src/GitHUD/Git/Parse/Base.hs +10/−10
- src/GitHUD/Git/Types.hs +4/−4
- src/GitHUD/Terminal/Base.hs +1/−1
- src/GitHUD/Terminal/Prompt.hs +42/−40
- src/GitHUD/Types.hs +10/−10
- test/Test/GitHUD/Config/Parse.hs +73/−37
- test/Test/GitHUD/Terminal/Prompt.hs +129/−58
gitHUD.cabal view
@@ -1,5 +1,5 @@ name: gitHUD-version: 1.2.0+version: 1.3.0 synopsis: More efficient replacement to the great git-radar description: Please see README.md homepage: http://github.com/gbataille/gitHUD#readme
src/GitHUD/Config/Parse.hs view
@@ -74,29 +74,42 @@ return ErrorLine configItemsFolder :: Config -> ConfigItem -> Config+configItemsFolder conf (Item "show_part_repo_indicator" value) =+ conf { confShowPartRepoIndicator = boolConfigToIntensity value }+configItemsFolder conf (Item "show_part_merge_branch_commits_diff" value) =+ conf { confShowPartMergeBranchCommitsDiff = boolConfigToIntensity value }+configItemsFolder conf (Item "show_part_local_branch" value) =+ conf { confShowPartLocalBranch = boolConfigToIntensity value }+configItemsFolder conf (Item "show_part_commits_to_origin" value) =+ conf { confShowPartCommitsToOrigin = boolConfigToIntensity value }+configItemsFolder conf (Item "show_part_local_changes_state" value) =+ conf { confShowPartLocalChangesState = boolConfigToIntensity value }+configItemsFolder conf (Item "show_part_stashes" value) =+ conf { confShowPartStashes = boolConfigToIntensity value }+ configItemsFolder conf (Item "git_repo_indicator" repoIndicator) = conf { confRepoIndicator = repoIndicator } -configItemsFolder conf (Item "no_upstream_text" value) =- conf { confNoUpstreamString = value }-configItemsFolder conf (Item "no_upstream_text_color" value) =- conf { confNoUpstreamStringColor = colorConfigToColor value }-configItemsFolder conf (Item "no_upstream_text_intensity" value) =- conf { confNoUpstreamStringIntensity = intensityConfigToIntensity value }-configItemsFolder conf (Item "no_upstream_indicator" value) =- conf { confNoUpstreamIndicator = value }-configItemsFolder conf (Item "no_upstream_indicator_color" value) =- conf { confNoUpstreamIndicatorColor = colorConfigToColor value }-configItemsFolder conf (Item "no_upstream_indicator_intensity" value) =- conf { confNoUpstreamIndicatorIntensity = intensityConfigToIntensity value }+configItemsFolder conf (Item "no_tracked_upstream_text" value) =+ conf { confNoTrackedUpstreamString = value }+configItemsFolder conf (Item "no_tracked_upstream_text_color" value) =+ conf { confNoTrackedUpstreamStringColor = colorConfigToColor value }+configItemsFolder conf (Item "no_tracked_upstream_text_intensity" value) =+ conf { confNoTrackedUpstreamStringIntensity = intensityConfigToIntensity value }+configItemsFolder conf (Item "no_tracked_upstream_indicator" value) =+ conf { confNoTrackedUpstreamIndicator = value }+configItemsFolder conf (Item "no_tracked_upstream_indicator_color" value) =+ conf { confNoTrackedUpstreamIndicatorColor = colorConfigToColor value }+configItemsFolder conf (Item "no_tracked_upstream_indicator_intensity" value) =+ conf { confNoTrackedUpstreamIndicatorIntensity = intensityConfigToIntensity value } -configItemsFolder conf (Item "remote_commits_indicator" value) =- conf { confRemoteCommitsIndicator = value }-configItemsFolder conf (Item "remote_commits_pull_prefix" value) =- conf { confRemoteCommitsOnlyPull = value }-configItemsFolder conf (Item "remote_commits_push_prefix" value) =- conf { confRemoteCommitsOnlyPush = value }-configItemsFolder conf (Item "remote_commits_push_pull_infix" value) =- conf { confRemoteCommitsBothPullPush = value }+configItemsFolder conf (Item "merge_branch_commits_indicator" value) =+ conf { confMergeBranchCommitsIndicator = value }+configItemsFolder conf (Item "merge_branch_commits_pull_prefix" value) =+ conf { confMergeBranchCommitsOnlyPull = value }+configItemsFolder conf (Item "merge_branch_commits_push_prefix" value) =+ conf { confMergeBranchCommitsOnlyPush = value }+configItemsFolder conf (Item "merge_branch_commits_push_pull_infix" value) =+ conf { confMergeBranchCommitsBothPullPush = value } configItemsFolder conf (Item "local_branch_prefix" value) = conf { confLocalBranchNamePrefix = value }@@ -221,3 +234,30 @@ string "Dull" >> return Dull , string "Vivid" >> return Vivid ] <?> "intensity"++boolConfigToIntensity :: String -> Bool+boolConfigToIntensity str =+ either+ (const True)+ id+ (parse boolParser "" str)++boolParser :: Parser Bool+boolParser = choice [+ string "False" >> return False+ , string "F" >> return False+ , string "false" >> return False+ , string "f" >> return False+ , string "No" >> return False+ , string "N" >> return False+ , string "no" >> return False+ , string "n" >> return False+ , string "True" >> return True+ , string "T" >> return True+ , string "true" >> return True+ , string "t" >> return True+ , string "Yes" >> return True+ , string "Y" >> return True+ , string "yes" >> return True+ , string "y" >> return True+ ] <?> "bool"
src/GitHUD/Config/Types.hs view
@@ -6,20 +6,27 @@ import GitHUD.Terminal.Types data Config = Config {- confRepoIndicator :: String+ confShowPartRepoIndicator :: Bool+ , confShowPartMergeBranchCommitsDiff :: Bool+ , confShowPartLocalBranch :: Bool+ , confShowPartCommitsToOrigin :: Bool+ , confShowPartLocalChangesState :: Bool+ , confShowPartStashes :: Bool - , confNoUpstreamString :: String- , confNoUpstreamStringColor :: Color- , confNoUpstreamStringIntensity :: ColorIntensity- , confNoUpstreamIndicator :: String- , confNoUpstreamIndicatorColor :: Color- , confNoUpstreamIndicatorIntensity :: ColorIntensity+ , confRepoIndicator :: String - , confRemoteCommitsIndicator :: String- , confRemoteCommitsOnlyPush :: String- , confRemoteCommitsOnlyPull :: String- , confRemoteCommitsBothPullPush :: String+ , confNoTrackedUpstreamString :: String+ , confNoTrackedUpstreamStringColor :: Color+ , confNoTrackedUpstreamStringIntensity :: ColorIntensity+ , confNoTrackedUpstreamIndicator :: String+ , confNoTrackedUpstreamIndicatorColor :: Color+ , confNoTrackedUpstreamIndicatorIntensity :: ColorIntensity + , confMergeBranchCommitsIndicator :: String+ , confMergeBranchCommitsOnlyPush :: String+ , confMergeBranchCommitsOnlyPull :: String+ , confMergeBranchCommitsBothPullPush :: String+ , confLocalBranchNamePrefix :: String , confLocalBranchNameSuffix :: String , confLocalDetachedPrefix :: String@@ -70,19 +77,26 @@ defaultConfig :: Config defaultConfig = Config {- confRepoIndicator = "\57504"+ confShowPartRepoIndicator = True+ , confShowPartMergeBranchCommitsDiff = True+ , confShowPartLocalBranch = True+ , confShowPartCommitsToOrigin = True+ , confShowPartLocalChangesState = True+ , confShowPartStashes = True - , confNoUpstreamString = "upstream"- , confNoUpstreamStringColor = Red- , confNoUpstreamStringIntensity = Vivid- , confNoUpstreamIndicator = "\9889"- , confNoUpstreamIndicatorColor = Red- , confNoUpstreamIndicatorIntensity = Vivid+ , confRepoIndicator = "ᚴ" - , confRemoteCommitsIndicator = "\120366"- , confRemoteCommitsOnlyPush = "\8592"- , confRemoteCommitsOnlyPull = "\8594"- , confRemoteCommitsBothPullPush = "\8644"+ , confNoTrackedUpstreamString = "upstream"+ , confNoTrackedUpstreamStringColor = Red+ , confNoTrackedUpstreamStringIntensity = Vivid+ , confNoTrackedUpstreamIndicator = "\9889"+ , confNoTrackedUpstreamIndicatorColor = Red+ , confNoTrackedUpstreamIndicatorIntensity = Vivid++ , confMergeBranchCommitsIndicator = "\120366"+ , confMergeBranchCommitsOnlyPush = "\8592"+ , confMergeBranchCommitsOnlyPull = "\8594"+ , confMergeBranchCommitsBothPullPush = "\8644" , confLocalBranchNamePrefix = "[" , confLocalBranchNameSuffix = "]"
src/GitHUD/Git/Parse/Base.hs view
@@ -52,23 +52,23 @@ mvRemoteBranchName <- newEmptyMVar mvCommitsToPull <- newEmptyMVar mvCommitsToPush <- newEmptyMVar- mvRemoteCommitsToPull <- newEmptyMVar- mvRemoteCommitsToPush <- newEmptyMVar+ mvMergeBranchCommitsToPull <- newEmptyMVar+ mvMergeBranchCommitsToPush <- newEmptyMVar forkIO $ gitCmdRemoteBranchName (gitLocalBranch repoState) mvRemoteBranchName remoteBranch <- removeEndingNewline <$> (takeMVar mvRemoteBranchName) let fullRemoteBranchName = buildFullyQualifiedRemoteBranchName (gitRemote repoState) remoteBranch - forkIO $ gitCmdRevToPush "origin/master" fullRemoteBranchName mvRemoteCommitsToPush- forkIO $ gitCmdRevToPull "origin/master" fullRemoteBranchName mvRemoteCommitsToPull+ forkIO $ gitCmdRevToPush "origin/master" fullRemoteBranchName mvMergeBranchCommitsToPush+ forkIO $ gitCmdRevToPull "origin/master" fullRemoteBranchName mvMergeBranchCommitsToPull forkIO $ gitCmdRevToPush fullRemoteBranchName "HEAD" mvCommitsToPush forkIO $ gitCmdRevToPull fullRemoteBranchName "HEAD" mvCommitsToPull - rCommitsToMergeStr <- takeMVar mvRemoteCommitsToPush- let rCommitsToMerge = getCount rCommitsToMergeStr- rCommitsToRMasterStr <- takeMVar mvRemoteCommitsToPull- let rCommitsToRMaster = getCount rCommitsToRMasterStr+ mergeBranchCommitsToMergeStr <- takeMVar mvMergeBranchCommitsToPush+ let mergeBranchCommitsToMerge = getCount mergeBranchCommitsToMergeStr+ mergeBranchCommitsToRMasterStr <- takeMVar mvMergeBranchCommitsToPull+ let mergeBranchCommitsToRMaster = getCount mergeBranchCommitsToRMasterStr commitsToPushStr <- takeMVar mvCommitsToPush let commitsToPush = getCount commitsToPushStr@@ -79,6 +79,6 @@ gitRemoteTrackingBranch = remoteBranch , gitCommitsToPull = commitsToPull , gitCommitsToPush = commitsToPush- , gitRemoteCommitsToPull = rCommitsToRMaster- , gitRemoteCommitsToPush = rCommitsToMerge+ , gitMergeBranchCommitsToPull = mergeBranchCommitsToRMaster+ , gitMergeBranchCommitsToPush = mergeBranchCommitsToMerge }
src/GitHUD/Git/Types.hs view
@@ -50,8 +50,8 @@ , gitStashCount :: Int , gitCommitsToPull :: Int , gitCommitsToPush :: Int- , gitRemoteCommitsToPull :: Int- , gitRemoteCommitsToPush :: Int+ , gitMergeBranchCommitsToPull :: Int+ , gitMergeBranchCommitsToPush :: Int } deriving (Eq, Show) @@ -66,6 +66,6 @@ , gitStashCount = 0 , gitCommitsToPull = 0 , gitCommitsToPush = 0- , gitRemoteCommitsToPull = 0- , gitRemoteCommitsToPush = 0+ , gitMergeBranchCommitsToPull = 0+ , gitMergeBranchCommitsToPush = 0 }
src/GitHUD/Terminal/Base.hs view
@@ -16,7 +16,7 @@ -> String -- ^ The string to output -> ShellOutput tellStringInColor color intensity str = do- shell <- getShell+ shell <- askShell tell $ startColorMarker color intensity shell tell $ str tell $ endColorMarker shell
src/GitHUD/Terminal/Prompt.hs view
@@ -1,12 +1,13 @@ module GitHUD.Terminal.Prompt ( buildPromptWithConfig , addGitRepoIndicator- , addUpstreamIndicator- , addRemoteCommits+ , addNoTrackedUpstreamIndicator+ , addMergeBranchCommits , addLocalBranchName , addLocalCommits , addRepoState , addStashes+ , buildPrompt ) where import Control.Monad (when)@@ -27,64 +28,65 @@ buildPrompt :: ShellOutput buildPrompt = do- addGitRepoIndicator- addUpstreamIndicator- addRemoteCommits- addLocalBranchName- addLocalCommits- addRepoState- addStashes+ config <- askConfig+ when (confShowPartRepoIndicator config) $ addGitRepoIndicator+ when (confShowPartMergeBranchCommitsDiff config) $ addNoTrackedUpstreamIndicator+ when (confShowPartMergeBranchCommitsDiff config) $ addMergeBranchCommits+ when (confShowPartLocalBranch config) $ addLocalBranchName+ when (confShowPartCommitsToOrigin config) $ addLocalCommits+ when (confShowPartLocalChangesState config) $ addRepoState+ when (confShowPartStashes config) $ addStashes return () addGitRepoIndicator :: ShellOutput addGitRepoIndicator = do- config <- getConfig+ config <- askConfig tell $ confRepoIndicator config tell " " -addUpstreamIndicator :: ShellOutput-addUpstreamIndicator = do- repoState <- getRepoState- config <- getConfig+addNoTrackedUpstreamIndicator :: ShellOutput+addNoTrackedUpstreamIndicator = do+ repoState <- askRepoState+ config <- askConfig when (gitRemoteTrackingBranch repoState == "") $ do tellStringInColor- (confNoUpstreamStringColor config)- (confNoUpstreamStringIntensity config)- (confNoUpstreamString config)+ (confNoTrackedUpstreamStringColor config)+ (confNoTrackedUpstreamStringIntensity config)+ (confNoTrackedUpstreamString config) tell " " tellStringInColor- (confNoUpstreamIndicatorColor config)- (confNoUpstreamIndicatorIntensity config)- (confNoUpstreamIndicator config)+ (confNoTrackedUpstreamIndicatorColor config)+ (confNoTrackedUpstreamIndicatorIntensity config)+ (confNoTrackedUpstreamIndicator config) tell " " return () -addRemoteCommits :: ShellOutput-addRemoteCommits = do- repoState <- getRepoState- config <- getConfig- let push = gitRemoteCommitsToPush repoState- let pull = gitRemoteCommitsToPull repoState+addMergeBranchCommits :: ShellOutput+addMergeBranchCommits = do+ repoState <- askRepoState+ config <- askConfig+ let push = gitMergeBranchCommitsToPush repoState+ let pull = gitMergeBranchCommitsToPull repoState if (push > 0) && (pull > 0) then do- tell (confRemoteCommitsIndicator config)+ tell (confMergeBranchCommitsIndicator config) tell " " tell . show $ pull- tellStringInColor Green Vivid (confRemoteCommitsBothPullPush config)+ tellStringInColor Green Vivid (confMergeBranchCommitsBothPullPush config) tell . show $ push else ( if (pull > 0) then do- tell (confRemoteCommitsIndicator config)+ tell (confMergeBranchCommitsIndicator config) tell " "- tellStringInColor Green Vivid (confRemoteCommitsOnlyPull config)+ tellStringInColor Green Vivid (confMergeBranchCommitsOnlyPull config) tell " " tell . show $ pull else ( when (push > 0) $ do- tell (confRemoteCommitsIndicator config)+ tell (confMergeBranchCommitsIndicator config) tell " "- tellStringInColor Green Vivid (confRemoteCommitsOnlyPush config)+ tellStringInColor Green Vivid (confMergeBranchCommitsOnlyPush config) tell " " tell . show $ push )@@ -94,8 +96,8 @@ addLocalBranchName :: ShellOutput addLocalBranchName = do- repoState <- getRepoState- config <- getConfig+ repoState <- askRepoState+ config <- askConfig let localBranchName = gitLocalBranch repoState tell (confLocalBranchNamePrefix config) @@ -113,8 +115,8 @@ addLocalCommits :: ShellOutput addLocalCommits = do- repoState <- getRepoState- config <- getConfig+ repoState <- askRepoState+ config <- askConfig let push = gitCommitsToPush repoState let pull = gitCommitsToPull repoState if (pull > 0) && (push > 0)@@ -148,8 +150,8 @@ addRepoState :: ShellOutput addRepoState = do- repoState <- getRepoState- config <- getConfig+ repoState <- askRepoState+ config <- askConfig let repoChanges = gitLocalRepoChanges repoState let inda = indexAdd repoChanges@@ -225,8 +227,8 @@ addStashes :: ShellOutput addStashes = do- repoState <- getRepoState- config <- getConfig+ repoState <- askRepoState+ config <- askConfig let stashCount = gitStashCount repoState when (stashCount /= 0) $ do tell . show $ stashCount
src/GitHUD/Types.hs view
@@ -6,12 +6,12 @@ , Prompt , TerminalState , ShellOutput- , getShell- , getRepoState- , getConfig+ , askShell+ , askRepoState+ , askConfig ) where -import Control.Monad.Reader (Reader, MonadReader, ask, liftM)+import Control.Monad.Reader (Reader, MonadReader, asks) import Control.Monad.Writer (WriterT) import GitHUD.Config.Types@@ -34,14 +34,14 @@ , _config = config } -getShell :: MonadReader OutputConfig m => m Shell-getShell = liftM _shell $ ask+askShell :: MonadReader OutputConfig m => m Shell+askShell = asks _shell -getRepoState :: MonadReader OutputConfig m => m GitRepoState-getRepoState = liftM _repoState $ ask+askRepoState :: MonadReader OutputConfig m => m GitRepoState+askRepoState = asks _repoState -getConfig :: MonadReader OutputConfig m => m Config-getConfig = liftM _config $ ask+askConfig :: MonadReader OutputConfig m => m Config+askConfig = asks _config type Prompt = String
test/Test/GitHUD/Config/Parse.hs view
@@ -57,7 +57,43 @@ testConfigItemFolder :: TestTree testConfigItemFolder = testGroup "#configItemFolder"- [ testCase "Comment should have no impact on the config" $+ [ testCase "Key: show_part_repo_indicator" $+ expectValue False $+ toBeInField confShowPartRepoIndicator $+ forConfigItemKey "show_part_repo_indicator" $+ withValue "False"++ , testCase "Key: show_part_merge_branch_commits_diff" $+ expectValue False $+ toBeInField confShowPartMergeBranchCommitsDiff $+ forConfigItemKey "show_part_merge_branch_commits_diff" $+ withValue "False"++ , testCase "Key: show_part_local_branch" $+ expectValue False $+ toBeInField confShowPartLocalBranch $+ forConfigItemKey "show_part_local_branch" $+ withValue "False"++ , testCase "Key: show_part_commits_to_origin" $+ expectValue False $+ toBeInField confShowPartCommitsToOrigin $+ forConfigItemKey "show_part_commits_to_origin" $+ withValue "False"++ , testCase "Key: show_part_local_changes_state" $+ expectValue False $+ toBeInField confShowPartLocalChangesState $+ forConfigItemKey "show_part_local_changes_state" $+ withValue "False"++ , testCase "Key: show_part_stashes" $+ expectValue False $+ toBeInField confShowPartStashes $+ forConfigItemKey "show_part_stashes" $+ withValue "False"++ , testCase "Comment should have no impact on the config" $ configItemsFolder defaultConfig (Comment) @?= defaultConfig @@ -71,76 +107,76 @@ forConfigItemKey "git_repo_indicator" $ withValue "foo" - , testCase "Key: no_upstream_text" $+ , testCase "Key: no_tracked_upstream_text" $ expectValue "foo" $- toBeInField confNoUpstreamString $- forConfigItemKey "no_upstream_text" $+ toBeInField confNoTrackedUpstreamString $+ forConfigItemKey "no_tracked_upstream_text" $ withValue "foo" - , testCase "Key: no_upstream_text_color" $+ , testCase "Key: no_tracked_upstream_text_color" $ expectValue Green $- toBeInField confNoUpstreamStringColor $- forConfigItemKey "no_upstream_text_color" $+ toBeInField confNoTrackedUpstreamStringColor $+ forConfigItemKey "no_tracked_upstream_text_color" $ withValue "Green" - , testCase "Key: no_upstream_text_intensity" $+ , testCase "Key: no_tracked_upstream_text_intensity" $ expectValue Dull $- toBeInField confNoUpstreamStringIntensity $- forConfigItemKey "no_upstream_text_intensity" $+ toBeInField confNoTrackedUpstreamStringIntensity $+ forConfigItemKey "no_tracked_upstream_text_intensity" $ withValue "Dull" - , testCase "Key: no_upstream_indicator" $+ , testCase "Key: no_tracked_upstream_indicator" $ expectValue "foo" $- toBeInField confNoUpstreamIndicator $- forConfigItemKey "no_upstream_indicator" $+ toBeInField confNoTrackedUpstreamIndicator $+ forConfigItemKey "no_tracked_upstream_indicator" $ withValue "foo" - , testCase "Key: no_upstream_indicator_color" $+ , testCase "Key: no_tracked_upstream_indicator_color" $ expectValue Black $- toBeInField confNoUpstreamIndicatorColor $- forConfigItemKey "no_upstream_indicator_color" $+ toBeInField confNoTrackedUpstreamIndicatorColor $+ forConfigItemKey "no_tracked_upstream_indicator_color" $ withValue "Black" - , testCase "Key: no_upstream_indicator_color - invalid color" $+ , testCase "Key: no_tracked_upstream_indicator_color - invalid color" $ expectValue Blue $- toBeInField confNoUpstreamIndicatorColor $- forConfigItemKey "no_upstream_indicator_color" $+ toBeInField confNoTrackedUpstreamIndicatorColor $+ forConfigItemKey "no_tracked_upstream_indicator_color" $ withValue "FOO" - , testCase "Key: no_upstream_indicator_intensity" $+ , testCase "Key: no_tracked_upstream_indicator_intensity" $ expectValue Dull $- toBeInField confNoUpstreamIndicatorIntensity $- forConfigItemKey "no_upstream_indicator_intensity" $+ toBeInField confNoTrackedUpstreamIndicatorIntensity $+ forConfigItemKey "no_tracked_upstream_indicator_intensity" $ withValue "Dull" - , testCase "Key: no_upstream_indicator_intensity - invalid intensity" $+ , testCase "Key: no_tracked_upstream_indicator_intensity - invalid intensity" $ expectValue Vivid $- toBeInField confNoUpstreamIndicatorIntensity $- forConfigItemKey "no_upstream_indicator_intensity" $+ toBeInField confNoTrackedUpstreamIndicatorIntensity $+ forConfigItemKey "no_tracked_upstream_indicator_intensity" $ withValue "FOO" - , testCase "Key: remote_commits_indicator" $+ , testCase "Key: merge_branch_commits_indicator" $ expectValue "FOO" $- toBeInField confRemoteCommitsIndicator $- forConfigItemKey "remote_commits_indicator" $+ toBeInField confMergeBranchCommitsIndicator $+ forConfigItemKey "merge_branch_commits_indicator" $ withValue "FOO" - , testCase "Key: remote_commits_pull_prefix" $+ , testCase "Key: merge_branch_commits_pull_prefix" $ expectValue "FOO" $- toBeInField confRemoteCommitsOnlyPull $- forConfigItemKey "remote_commits_pull_prefix" $+ toBeInField confMergeBranchCommitsOnlyPull $+ forConfigItemKey "merge_branch_commits_pull_prefix" $ withValue "FOO" - , testCase "Key: remote_commits_push_prefix" $+ , testCase "Key: merge_branch_commits_push_prefix" $ expectValue "FOO" $- toBeInField confRemoteCommitsOnlyPush $- forConfigItemKey "remote_commits_push_prefix" $+ toBeInField confMergeBranchCommitsOnlyPush $+ forConfigItemKey "merge_branch_commits_push_prefix" $ withValue "FOO" - , testCase "Key: remote_commits_push_pull_infix" $+ , testCase "Key: merge_branch_commits_push_pull_infix" $ expectValue "FOO" $- toBeInField confRemoteCommitsBothPullPush $- forConfigItemKey "remote_commits_push_pull_infix" $+ toBeInField confMergeBranchCommitsBothPullPush $+ forConfigItemKey "merge_branch_commits_push_pull_infix" $ withValue "FOO" , testCase "Key: local_branch_prefix" $
test/Test/GitHUD/Terminal/Prompt.hs view
@@ -17,22 +17,23 @@ terminalPromptTests :: TestTree terminalPromptTests = testGroup "Terminal Prompt Test" [ testAddGitRepoIndicator- , testAddUpstreamIndicator- , testAddRemoteCommits+ , testAddNoTrackedUpstreamIndicator+ , testAddMergeBranchCommits , testAddLocalBranchName , testAddLocalCommits , testAddRepoState , testAddStashes+ , testPartialPrompt ] testAddGitRepoIndicator :: TestTree testAddGitRepoIndicator = testGroup "#addGitRepoIndicator" [ testGroup "Default Config" [ testCase "ZSH: default config: hardcoded character" $- testWriterWithConfig (zeroOutputConfig ZSH) addGitRepoIndicator @?= "\57504 "+ testWriterWithConfig (zeroOutputConfig ZSH) addGitRepoIndicator @?= "ᚴ " , testCase "Other: default config: hardcoded character" $- testWriterWithConfig (zeroOutputConfig Other) addGitRepoIndicator @?= "\57504 "+ testWriterWithConfig (zeroOutputConfig Other) addGitRepoIndicator @?= "ᚴ " ] , testGroup "Custom Config" [ testCase "ZSH: custom config: hardcoded character" $@@ -49,127 +50,127 @@ ] ] -customConfigUpstreamIndicator :: Config-customConfigUpstreamIndicator = defaultConfig {- confNoUpstreamString = "foo"- , confNoUpstreamStringColor = Cyan- , confNoUpstreamStringIntensity = Dull- , confNoUpstreamIndicator = "bar"- , confNoUpstreamIndicatorColor = Green- , confNoUpstreamIndicatorIntensity = Dull+customConfigNoTrackedUpstreamIndicator :: Config+customConfigNoTrackedUpstreamIndicator = defaultConfig {+ confNoTrackedUpstreamString = "foo"+ , confNoTrackedUpstreamStringColor = Cyan+ , confNoTrackedUpstreamStringIntensity = Dull+ , confNoTrackedUpstreamIndicator = "bar"+ , confNoTrackedUpstreamIndicatorColor = Green+ , confNoTrackedUpstreamIndicatorIntensity = Dull } -testAddUpstreamIndicator :: TestTree-testAddUpstreamIndicator = testGroup "#addUpstreamIndicator"+testAddNoTrackedUpstreamIndicator :: TestTree+testAddNoTrackedUpstreamIndicator = testGroup "#addTrackedUpstreamIndicator" [ testGroup "Default Config" [ testCase "ZSH: with an upstream" $ testWriterWithConfig (buildOutputConfig ZSH (zeroGitRepoState { gitRemoteTrackingBranch = "foo" }) defaultConfig)- addUpstreamIndicator+ addNoTrackedUpstreamIndicator @?= "" , testCase "Other: with an upstream" $ testWriterWithConfig (buildOutputConfig Other (zeroGitRepoState { gitRemoteTrackingBranch = "foo" }) defaultConfig)- addUpstreamIndicator+ addNoTrackedUpstreamIndicator @?= "" , testCase "ZSH: with no upstream" $ testWriterWithConfig- (zeroOutputConfig ZSH) addUpstreamIndicator+ (zeroOutputConfig ZSH) addNoTrackedUpstreamIndicator @?= "%{\x1b[1;31m%}upstream%{\x1b[0m%} %{\x1b[1;31m%}\9889%{\x1b[0m%} " , testCase "Other: with no upstream" $ testWriterWithConfig- (zeroOutputConfig Other) addUpstreamIndicator+ (zeroOutputConfig Other) addNoTrackedUpstreamIndicator @?= "\x1b[1;31mupstream\x1b[0m \x1b[1;31m\9889\x1b[0m " ] , testGroup "Custom Config" [ testCase "ZSH: with an upstream" $ testWriterWithConfig- (buildOutputConfig ZSH (zeroGitRepoState { gitRemoteTrackingBranch = "foo" }) customConfigUpstreamIndicator)- addUpstreamIndicator+ (buildOutputConfig ZSH (zeroGitRepoState { gitRemoteTrackingBranch = "foo" }) customConfigNoTrackedUpstreamIndicator)+ addNoTrackedUpstreamIndicator @?= "" , testCase "Other: with an upstream" $ testWriterWithConfig- (buildOutputConfig Other (zeroGitRepoState { gitRemoteTrackingBranch = "foo" }) customConfigUpstreamIndicator)- addUpstreamIndicator+ (buildOutputConfig Other (zeroGitRepoState { gitRemoteTrackingBranch = "foo" }) customConfigNoTrackedUpstreamIndicator)+ addNoTrackedUpstreamIndicator @?= "" , testCase "ZSH: with no upstream" $ testWriterWithConfig- (buildOutputConfig ZSH (zeroGitRepoState) customConfigUpstreamIndicator)- addUpstreamIndicator+ (buildOutputConfig ZSH (zeroGitRepoState) customConfigNoTrackedUpstreamIndicator)+ addNoTrackedUpstreamIndicator @?= "%{\x1b[36m%}foo%{\x1b[0m%} %{\x1b[32m%}bar%{\x1b[0m%} " , testCase "Other: with no upstream" $ testWriterWithConfig- (buildOutputConfig Other (zeroGitRepoState) customConfigUpstreamIndicator)- addUpstreamIndicator+ (buildOutputConfig Other (zeroGitRepoState) customConfigNoTrackedUpstreamIndicator)+ addNoTrackedUpstreamIndicator @?= "\x1b[36mfoo\x1b[0m \x1b[32mbar\x1b[0m " ] ] -customConfigRemoteCommits :: Config-customConfigRemoteCommits = defaultConfig {- confRemoteCommitsIndicator = "foo"- , confRemoteCommitsOnlyPull = "pull"- , confRemoteCommitsOnlyPush = "push"- , confRemoteCommitsBothPullPush = "pull-push"+customConfigMergeBranchCommits :: Config+customConfigMergeBranchCommits = defaultConfig {+ confMergeBranchCommitsIndicator = "foo"+ , confMergeBranchCommitsOnlyPull = "pull"+ , confMergeBranchCommitsOnlyPush = "push"+ , confMergeBranchCommitsBothPullPush = "pull-push" } -testAddRemoteCommits :: TestTree-testAddRemoteCommits = testGroup "#addRemoteCommits"+testAddMergeBranchCommits :: TestTree+testAddMergeBranchCommits = testGroup "#addMergeBranchCommits" [ testGroup "Default Config" [ testCase "ZSH: commits to pull" $- testRemoteCommitsToPull ZSH defaultConfig @?=+ testMergeBranchCommitsToPull ZSH defaultConfig @?= "\120366 %{\x1b[1;32m%}\8594%{\x1b[0m%} 2 " , testCase "ZSH: commits to push" $- testRemoteCommitsToPush ZSH defaultConfig @?=+ testMergeBranchCommitsToPush ZSH defaultConfig @?= "\120366 %{\x1b[1;32m%}\8592%{\x1b[0m%} 2 " , testCase "ZSH: commits to pull and to push" $- testRemoteCommitsToPushAndPull ZSH defaultConfig @?=+ testMergeBranchCommitsToPushAndPull ZSH defaultConfig @?= "\120366 4%{\x1b[1;32m%}\8644%{\x1b[0m%}4 " , testCase "Other: commits to pull" $- testRemoteCommitsToPull Other defaultConfig @?=+ testMergeBranchCommitsToPull Other defaultConfig @?= "\120366 \x1b[1;32m\8594\x1b[0m 2 " , testCase "Other: commits to push" $- testRemoteCommitsToPush Other defaultConfig @?=+ testMergeBranchCommitsToPush Other defaultConfig @?= "\120366 \x1b[1;32m\8592\x1b[0m 2 " , testCase "Other: commits to pull and to push" $- testRemoteCommitsToPushAndPull Other defaultConfig @?=+ testMergeBranchCommitsToPushAndPull Other defaultConfig @?= "\120366 4\x1b[1;32m\8644\x1b[0m4 " ] , testGroup "Custom Config" [ testCase "ZSH: commits to pull" $- testRemoteCommitsToPull ZSH customConfigRemoteCommits @?=+ testMergeBranchCommitsToPull ZSH customConfigMergeBranchCommits @?= "foo %{\x1b[1;32m%}pull%{\x1b[0m%} 2 " , testCase "ZSH: commits to push" $- testRemoteCommitsToPush ZSH customConfigRemoteCommits @?=+ testMergeBranchCommitsToPush ZSH customConfigMergeBranchCommits @?= "foo %{\x1b[1;32m%}push%{\x1b[0m%} 2 " , testCase "ZSH: commits to pull and to push" $- testRemoteCommitsToPushAndPull ZSH customConfigRemoteCommits @?=+ testMergeBranchCommitsToPushAndPull ZSH customConfigMergeBranchCommits @?= "foo 4%{\x1b[1;32m%}pull-push%{\x1b[0m%}4 " , testCase "Other: commits to pull" $- testRemoteCommitsToPull Other customConfigRemoteCommits @?=+ testMergeBranchCommitsToPull Other customConfigMergeBranchCommits @?= "foo \x1b[1;32mpull\x1b[0m 2 " , testCase "Other: commits to push" $- testRemoteCommitsToPush Other customConfigRemoteCommits @?=+ testMergeBranchCommitsToPush Other customConfigMergeBranchCommits @?= "foo \x1b[1;32mpush\x1b[0m 2 " , testCase "Other: commits to pull and to push" $- testRemoteCommitsToPushAndPull Other customConfigRemoteCommits @?=+ testMergeBranchCommitsToPushAndPull Other customConfigMergeBranchCommits @?= "foo 4\x1b[1;32mpull-push\x1b[0m4 " ] ]@@ -481,6 +482,76 @@ ] ] +localChangesForPartialPrompt :: GitLocalRepoChanges+localChangesForPartialPrompt = GitLocalRepoChanges {+ localMod = 1+ , localAdd = 2+ , localDel = 3+ , indexMod = 4+ , indexAdd = 5+ , indexDel = 6+ , renamed = 7+ , conflict = 8+ }++repoStateForPartialPrompt :: GitRepoState+repoStateForPartialPrompt = GitRepoState {+ gitLocalRepoChanges = localChangesForPartialPrompt+ , gitLocalBranch = "branch"+ , gitCommitShortSHA = "3de6ef"+ , gitRemote = "origin"+ , gitRemoteTrackingBranch = "origin/branch"+ , gitStashCount = 3+ , gitCommitsToPull = 5+ , gitCommitsToPush = 6+ , gitMergeBranchCommitsToPull = 2+ , gitMergeBranchCommitsToPush = 1+ }++{- For reference here, the full prompt would be++ "\5812 \120366 2%{\ESC[1;32m%}\8644%{\ESC[0m%}1 [%{\ESC[1;34m%}branch%{\ESC[0m%}] 5%{\ESC[1;32m%}\8645%{\ESC[0m%}6 5%{\ESC[1;32m%}A%{\ESC[0m%}6%{\ESC[1;32m%}D%{\ESC[0m%}4%{\ESC[1;32m%}M%{\ESC[0m%}7%{\ESC[1;32m%}R%{\ESC[0m%} 3%{\ESC[1;31m%}D%{\ESC[0m%}1%{\ESC[1;31m%}M%{\ESC[0m%} 2%{\ESC[1;37m%}A%{\ESC[0m%} 8%{\ESC[1;32m%}C%{\ESC[0m%} 3%{\ESC[1;32m%}\8801%{\ESC[0m%} "++-}+testPartialPrompt :: TestTree+testPartialPrompt = testGroup "Partial prompt display"+ [ testCase "w/out repo indicator" $+ testWriterWithConfig+ (buildOutputConfig ZSH repoStateForPartialPrompt defaultConfig { confShowPartRepoIndicator = False })+ buildPrompt+ @?= "\120366 2%{\ESC[1;32m%}\8644%{\ESC[0m%}1 [%{\ESC[1;34m%}branch%{\ESC[0m%}] 5%{\ESC[1;32m%}\8645%{\ESC[0m%}6 5%{\ESC[1;32m%}A%{\ESC[0m%}6%{\ESC[1;32m%}D%{\ESC[0m%}4%{\ESC[1;32m%}M%{\ESC[0m%}7%{\ESC[1;32m%}R%{\ESC[0m%} 3%{\ESC[1;31m%}D%{\ESC[0m%}1%{\ESC[1;31m%}M%{\ESC[0m%} 2%{\ESC[1;37m%}A%{\ESC[0m%} 8%{\ESC[1;32m%}C%{\ESC[0m%} 3%{\ESC[1;32m%}\8801%{\ESC[0m%} "++ , testCase "w/out merge branch commits info" $+ testWriterWithConfig+ (buildOutputConfig ZSH repoStateForPartialPrompt defaultConfig { confShowPartMergeBranchCommitsDiff = False })+ buildPrompt+ @?= "\5812 [%{\ESC[1;34m%}branch%{\ESC[0m%}] 5%{\ESC[1;32m%}\8645%{\ESC[0m%}6 5%{\ESC[1;32m%}A%{\ESC[0m%}6%{\ESC[1;32m%}D%{\ESC[0m%}4%{\ESC[1;32m%}M%{\ESC[0m%}7%{\ESC[1;32m%}R%{\ESC[0m%} 3%{\ESC[1;31m%}D%{\ESC[0m%}1%{\ESC[1;31m%}M%{\ESC[0m%} 2%{\ESC[1;37m%}A%{\ESC[0m%} 8%{\ESC[1;32m%}C%{\ESC[0m%} 3%{\ESC[1;32m%}\8801%{\ESC[0m%} "++ , testCase "w/out local branch info" $+ testWriterWithConfig+ (buildOutputConfig ZSH repoStateForPartialPrompt defaultConfig { confShowPartLocalBranch = False })+ buildPrompt+ @?= "\5812 \120366 2%{\ESC[1;32m%}\8644%{\ESC[0m%}1 5%{\ESC[1;32m%}\8645%{\ESC[0m%}6 5%{\ESC[1;32m%}A%{\ESC[0m%}6%{\ESC[1;32m%}D%{\ESC[0m%}4%{\ESC[1;32m%}M%{\ESC[0m%}7%{\ESC[1;32m%}R%{\ESC[0m%} 3%{\ESC[1;31m%}D%{\ESC[0m%}1%{\ESC[1;31m%}M%{\ESC[0m%} 2%{\ESC[1;37m%}A%{\ESC[0m%} 8%{\ESC[1;32m%}C%{\ESC[0m%} 3%{\ESC[1;32m%}\8801%{\ESC[0m%} "++ , testCase "w/out commits push/pull info" $+ testWriterWithConfig+ (buildOutputConfig ZSH repoStateForPartialPrompt defaultConfig { confShowPartCommitsToOrigin = False })+ buildPrompt+ @?= "\5812 \120366 2%{\ESC[1;32m%}\8644%{\ESC[0m%}1 [%{\ESC[1;34m%}branch%{\ESC[0m%}] 5%{\ESC[1;32m%}A%{\ESC[0m%}6%{\ESC[1;32m%}D%{\ESC[0m%}4%{\ESC[1;32m%}M%{\ESC[0m%}7%{\ESC[1;32m%}R%{\ESC[0m%} 3%{\ESC[1;31m%}D%{\ESC[0m%}1%{\ESC[1;31m%}M%{\ESC[0m%} 2%{\ESC[1;37m%}A%{\ESC[0m%} 8%{\ESC[1;32m%}C%{\ESC[0m%} 3%{\ESC[1;32m%}\8801%{\ESC[0m%} "++ , testCase "w/out local repo changes" $+ testWriterWithConfig+ (buildOutputConfig ZSH repoStateForPartialPrompt defaultConfig { confShowPartLocalChangesState = False })+ buildPrompt+ @?= "\5812 \120366 2%{\ESC[1;32m%}\8644%{\ESC[0m%}1 [%{\ESC[1;34m%}branch%{\ESC[0m%}] 5%{\ESC[1;32m%}\8645%{\ESC[0m%}6 3%{\ESC[1;32m%}\8801%{\ESC[0m%} "++ , testCase "w/out stashes" $+ testWriterWithConfig+ (buildOutputConfig ZSH repoStateForPartialPrompt defaultConfig { confShowPartStashes = False })+ buildPrompt+ @?= "\5812 \120366 2%{\ESC[1;32m%}\8644%{\ESC[0m%}1 [%{\ESC[1;34m%}branch%{\ESC[0m%}] 5%{\ESC[1;32m%}\8645%{\ESC[0m%}6 5%{\ESC[1;32m%}A%{\ESC[0m%}6%{\ESC[1;32m%}D%{\ESC[0m%}4%{\ESC[1;32m%}M%{\ESC[0m%}7%{\ESC[1;32m%}R%{\ESC[0m%} 3%{\ESC[1;31m%}D%{\ESC[0m%}1%{\ESC[1;31m%}M%{\ESC[0m%} 2%{\ESC[1;37m%}A%{\ESC[0m%} 8%{\ESC[1;32m%}C%{\ESC[0m%} "+ ]+ -- | Utility function to test a ShellOutput function and gets the prompt built testWriterWithConfig :: OutputConfig -- ^ Starting reader state -> ShellOutput -- ^ Function under test@@ -492,23 +563,23 @@ -> OutputConfig zeroOutputConfig shell = buildOutputConfig shell zeroGitRepoState defaultConfig -testRemoteCommitsToPull :: Shell -> Config -> String-testRemoteCommitsToPull shell config = testWriterWithConfig- (buildOutputConfig shell (zeroGitRepoState { gitRemoteCommitsToPull = 2 }) config)- addRemoteCommits+testMergeBranchCommitsToPull :: Shell -> Config -> String+testMergeBranchCommitsToPull shell config = testWriterWithConfig+ (buildOutputConfig shell (zeroGitRepoState { gitMergeBranchCommitsToPull = 2 }) config)+ addMergeBranchCommits -testRemoteCommitsToPush :: Shell -> Config -> String-testRemoteCommitsToPush shell config = testWriterWithConfig- (buildOutputConfig shell (zeroGitRepoState { gitRemoteCommitsToPush = 2 }) config)- addRemoteCommits+testMergeBranchCommitsToPush :: Shell -> Config -> String+testMergeBranchCommitsToPush shell config = testWriterWithConfig+ (buildOutputConfig shell (zeroGitRepoState { gitMergeBranchCommitsToPush = 2 }) config)+ addMergeBranchCommits -testRemoteCommitsToPushAndPull :: Shell -> Config -> String-testRemoteCommitsToPushAndPull shell config = testWriterWithConfig+testMergeBranchCommitsToPushAndPull :: Shell -> Config -> String+testMergeBranchCommitsToPushAndPull shell config = testWriterWithConfig (buildOutputConfig shell- (zeroGitRepoState { gitRemoteCommitsToPull = 4, gitRemoteCommitsToPush = 4 })+ (zeroGitRepoState { gitMergeBranchCommitsToPull = 4, gitMergeBranchCommitsToPush = 4 }) config )- addRemoteCommits+ addMergeBranchCommits testCommitsToPull :: Shell -> Config -> String testCommitsToPull shell config = testWriterWithConfig