diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-03-29 14:27:38 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-03-29 14:27:49 -0400 |
commit | 278f84fe6458a2ac8e12ecab8f2b4f4bb7d0122c (patch) | |
tree | 7f3d4c930dc828a610d605bbc97a65ba5518a4d0 /Command | |
parent | 495fad0cad63e9712b0236e57759f49565b7b70c (diff) |
log: Display time with time zone.
Also cleaned up ugliness with zombies.
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Log.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Command/Log.hs b/Command/Log.hs index 94c085adc..4a680111e 100644 --- a/Command/Log.hs +++ b/Command/Log.hs @@ -86,9 +86,9 @@ start -> Key -> CommandStart start m zone o file key = do - showLog output =<< readLog <$> getLog key (passthruOptions o) - -- getLog produces a zombie; reap it - liftIO reapZombies + (ls, cleanup) <- getLog key (passthruOptions o) + showLog output (readLog ls) + void $ liftIO cleanup stop where output @@ -150,13 +150,13 @@ compareChanges format changes = concatMap diff $ zip changes (drop 1 changes) - once the location log file is gone avoids it checking all the way back - to commit 0 to see if it used to exist, so generally speeds things up a - *lot* for newish files. -} -getLog :: Key -> [CommandParam] -> Annex [String] +getLog :: Key -> [CommandParam] -> Annex ([String], IO Bool) getLog key os = do top <- fromRepo Git.repoPath p <- liftIO $ relPathCwdToFile top config <- Annex.getGitConfig let logfile = p </> locationLogFile config key - inRepo $ pipeNullSplitZombie $ + inRepo $ pipeNullSplit $ [ Param "log" , Param "-z" , Param "--pretty=format:%ct" @@ -196,4 +196,5 @@ parseTimeStamp = utcTimeToPOSIXSeconds . fromMaybe (error "bad timestamp") . #endif showTimeStamp :: TimeZone -> POSIXTime -> String -showTimeStamp zone = show . utcToLocalTime zone . posixSecondsToUTCTime +showTimeStamp zone = formatTime defaultTimeLocale rfc822DateFormat + . utcToZonedTime zone . posixSecondsToUTCTime |