From: Jeff King Date: Mon, 17 Apr 2023 07:41:36 GMT Subject: Re: Weird behavior of 'git log --before' or 'git log --date-order': Commits from 2011 are treated to be before 1980 Message-ID: <20230417074136.GB39931@coredump.intra.peff.net> In-Reply-To: On Mon, Apr 17, 2023 at 08:20:30AM +0200, Kristoffer Haugsbakk wrote: > > The problem with repairing them is that it rewrites history, changing > > the object id of every commit which comes after. So you'd want to do it > > once centrally for the project, and declare a flag day that everybody is > > moving over to the new, fixed history. > > I wasn’t interested in fixing the repo for future development. Just to > see if that weird git-log(1) behavior went away. It’s like the inverse > of a minimal example to reproduce a bug; repair the corrupt object so > that future askers can be convinced that it’s not a bug. ;) Ah, OK. Carry on, then. ;) I'm 99% sure it would indeed go away, since the patch I showed earlier (to make the parsing more lenient) worked. But if you want to try, I suspect you could do it with git-filter-repo's --commit-callback option. Or if you don't mind being a little loose with the parsing, probably just piping fast-export through sed, and then back to fast-import. -Peff