log: Display time with time zone.

Also cleaned up ugliness with zombies.
This commit is contained in:
Joey Hess 2016-03-29 14:27:38 -04:00
parent 2fd7cc4bfe
commit 1d848a45d2
Failed to extract signature
2 changed files with 8 additions and 6 deletions

View file

@ -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

1
debian/changelog vendored
View file

@ -2,6 +2,7 @@ git-annex (6.20160319) UNRELEASED; urgency=medium
* ddar remote: fix ssh calls
Thanks, Robie Basak
* log: Display time with time zone.
-- Joey Hess <id@joeyh.name> Wed, 23 Mar 2016 11:42:36 -0400