From cde081a025110f74d6fa94abc17d35238e85ef4e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 13 Nov 2023 15:06:04 -0400 Subject: [PATCH] guard against wrong timestamps in git log For example, my sound repo has in the git-annex branch a commit from 2036, which is followed by one from 2034, in amoung commits from 2013. Clearly there was a problem with the clock. Since git log --date-order has a behavior of "Show no parents before all of its children are shown", the data still gets processed ok. The future timestamp just prevented displaying data after that commit. It seems better, when the clock was wrong, to display a wrong date, and then return to right dates. It would be nice to filter out the wrong dates from display entirely, but that seems it would need to buffer the whole output. This command is too slow to buffer it all before displaying anything, and anyway this kind of problem is probably rare. Sponsored-by: Joshua Antonishen on Patreon --- Command/Log.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/Command/Log.hs b/Command/Log.hs index 0aea7dc771..78190f28fb 100644 --- a/Command/Log.hs +++ b/Command/Log.hs @@ -408,6 +408,7 @@ sizeHistoryInfo mu o = do && (prevoutput /= Just output) = do displayts zone t output return (zone, True, t, Just output) + | t < prevt = return (zone, displayedyet, t, Just output) | otherwise = return (zone, displayedyet, prevt, Just output) where output = intercalate "," (map showsize sizes)