summaryrefslogtreecommitdiff
path: root/Command.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2020-09-14 16:49:33 -0400
committerJoey Hess <joeyh@joeyh.name>2020-09-15 15:41:13 -0400
commit3a05d5376119f555a9ce23f05af3c3a5cdaaf06e (patch)
tree8c9d630e82c314d62ce889bf6f4e162c562aa924 /Command.hs
parenta1accac084f23a40e86119ee1a4131c0c6c4873b (diff)
add SeekInput (not yet used)
No behavior changes (hopefully), just adding SeekInput and plumbing it through to the JSON display code for later use. Over the course of 2 grueling days. withFilesNotInGit reimplemented in terms of seekHelper should be the only possible behavior change. It seems to test as behaving the same. Note that seekHelper dummies up the SeekInput in the case where segmentPaths' gives up on sorting the expanded paths because there are too many input paths. When SeekInput later gets exposed as a json field, that will result in it being a little bit wrong in the case where 100 or more paths are passed to a git-annex command. I think this is a subtle enough problem to not matter. If it does turn out to be a problem, fixing it would require splitting up the input parameters into groups of < 100, which would make git ls-files run perhaps more than is necessary. May want to revisit this, because that fix seems fairly low-impact.
Diffstat (limited to 'Command.hs')
-rw-r--r--Command.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/Command.hs b/Command.hs
index 54415d026a..b9f02d1684 100644
--- a/Command.hs
+++ b/Command.hs
@@ -74,13 +74,15 @@ withGlobalOptions :: [[GlobalOption]] -> Command -> Command
withGlobalOptions os c = c { cmdglobaloptions = cmdglobaloptions c ++ concat os }
{- For start stage to indicate what will be done. -}
-starting:: MkActionItem t => String -> t -> CommandPerform -> CommandStart
-starting msg t a = next (StartMessage msg (mkActionItem t), a)
+starting:: MkActionItem actionitem => String -> actionitem -> SeekInput -> CommandPerform -> CommandStart
+starting msg ai si a = next
+ (StartMessage msg (mkActionItem ai) si, a)
{- Use when noMessages was used but the command is going to output
- usual messages after all. -}
-startingUsualMessages :: MkActionItem t => String -> t -> CommandPerform -> CommandStart
-startingUsualMessages msg t a = next (StartUsualMessages msg (mkActionItem t), a)
+startingUsualMessages :: MkActionItem t => String -> t -> SeekInput -> CommandPerform -> CommandStart
+startingUsualMessages msg t si a = next
+ (StartUsualMessages msg (mkActionItem t) si, a)
{- When no message should be displayed at start/end, but messages can still
- be displayed when using eg includeCommandAction. -}