drop incremental json object display; clean up code

This gets rid of quite a lot of ugly hacks around json generation.

I doubt that any real-world json parsers can parse incomplete objects, so
while it's not as nice to need to wait for the complete object, especially
for commands like `git annex info` that take a while, it doesn't seem worth
the added complexity.

This also causes the order of fields within the json objects to be
reordered. Since any real json parser shouldn't care, the only possible
problem would be with ad-hoc parsers of the old json output.
This commit is contained in:
Joey Hess 2016-09-09 18:13:55 -04:00
parent 61faf240d5
commit d7ea6a5684
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
6 changed files with 70 additions and 141 deletions

View file

@ -10,7 +10,7 @@
module Types.Messages where
import Data.Default
import qualified Data.ByteString.Lazy as B
import qualified Data.Aeson as Aeson
#ifdef WITH_CONCURRENTOUTPUT
import System.Console.Regions (ConsoleRegion)
@ -31,7 +31,7 @@ data MessageState = MessageState
, consoleRegion :: Maybe ConsoleRegion
, consoleRegionErrFlag :: Bool
#endif
, jsonBuffer :: B.ByteString
, jsonBuffer :: Maybe Aeson.Object
}
instance Default MessageState
@ -45,5 +45,5 @@ instance Default MessageState
, consoleRegion = Nothing
, consoleRegionErrFlag = False
#endif
, jsonBuffer = B.empty
, jsonBuffer = Nothing
}