processGitCommandHandlers ::
  Maybe [GitHandlerCommandSpec] ->
  ([ConfigError], CustomGitHandlers)
processGitCommandHandlers maybeCmdSpecs =
  let
    cmdSpecs :: [GitHandlerCommandSpec]
    cmdSpecs = fromMaybe [] maybeCmdSpecs

    hasRightNumChars spec = (List.length $ T.unpack $ (gitCmdKey spec) ) > 0

    (rightNumCharsCmds, wrongNumCharsCmds) = List.partition hasRightNumChars cmdSpecs

    errors =
      (ErrorGitCmdHandlerKeyWrongNumChars <$> wrongNumCharsCmds)

    toPair spec = (gitCmdKey spec, spec)

    successes = toPair <$> rightNumCharsCmds
  in
    (errors, M.fromList successes)
processGitCommandHandlers ::
  Maybe [GitHandlerCommandSpec] ->
  ([ConfigError], CustomGitHandlers)
processGitCommandHandlers maybeCmdSpecs =
  let
    cmdSpecs :: [GitHandlerCommandSpec]
    cmdSpecs = fromMaybe [] maybeCmdSpecs

    hasRightNumChars spec = (List.length $ T.unpack $ (gitCmdKey spec) ) > 0

    (rightNumCharsCmds, wrongNumCharsCmds) = List.partition hasRightNumChars cmdSpecs

    errors =
      (ErrorGitCmdHandlerKeyWrongNumChars <$> wrongNumCharsCmds)

    toPair spec = (gitCmdKey spec, spec)

    successes = toPair <$> rightNumCharsCmds
  in
    (errors, M.fromList successes)
processGitCommandHandlers maybeCmdSpecs =
  let
    cmdSpecs :: [GitHandlerCommandSpec]
    cmdSpecs = fromMaybe [] maybeCmdSpecs

    hasRightNumChars spec = (List.length $ T.unpack $ (gitCmdKey spec) ) > 0

    (rightNumCharsCmds, wrongNumCharsCmds) = List.partition hasRightNumChars cmdSpecs

    errors =
      (ErrorGitCmdHandlerKeyWrongNumChars <$> wrongNumCharsCmds)

    toPair spec = (gitCmdKey spec, spec)

    successes = toPair <$> rightNumCharsCmds
  in
    (errors, M.fromList successes)