diff options
author | Joey Hess <joey@kitenet.net> | 2012-01-06 17:30:48 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-01-06 17:36:13 -0400 |
commit | 078788a9e755809ac050fd83eb19c4398d7366d7 (patch) | |
tree | f147bd8080256fcb263178466d718a5df2e0b7ae /Command/Log.hs | |
parent | 9fb5f3edc7e0aec79e38cf588b66e66e4a2bdd3c (diff) |
change log display
Including the file in the lines behaves better when limiting with --after,
since only files that changed in the time period are shown.
Still not fully happy with the line layout, but putting the +/- first
followed by the date seems a good change.
Diffstat (limited to 'Command/Log.hs')
-rw-r--r-- | Command/Log.hs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Command/Log.hs b/Command/Log.hs index 51bdbc74c..2651b14be 100644 --- a/Command/Log.hs +++ b/Command/Log.hs @@ -38,19 +38,17 @@ seek = [withField afterOption return $ \afteropt -> start :: Maybe String -> FilePath -> (Key, Backend) -> CommandStart start afteropt file (key, _) = do - showStart file "" let ps = case afteropt of Nothing -> [] Just date -> [Param "--after", Param date] - showLog =<< (readLog <$> getLog key ps) + showLog file =<< (readLog <$> getLog key ps) stop -showLog :: [(POSIXTime, (Git.Ref, Git.Ref))] -> Annex () -showLog ps = do +showLog :: FilePath -> [(POSIXTime, (Git.Ref, Git.Ref))] -> Annex () +showLog file ps = do zone <- liftIO getCurrentTimeZone sets <- mapM (getset snd) ps previous <- maybe (return genesis) (getset fst) (lastMaybe ps) - liftIO $ putStrLn "" mapM_ (diff zone) $ zip sets (drop 1 sets ++ [previous]) where genesis = (0, S.empty) @@ -70,11 +68,13 @@ showLog ps = do output time present s = do rs <- map (dropWhile isSpace) . lines <$> Remote.prettyPrintUUIDs "log" (S.toList s) - liftIO $ mapM_ (putStrLn . indent . format) rs + liftIO $ mapM_ (putStrLn . format) rs where format r = unwords - [ time - , if present then "+" else "-" + [ if present then "+" else "-" + , time + , file + , "|" , r ] |