{"thread":{"id":"52166","subject":"git fsck, badDate: invalid author/committer line - bad date","startedAt":"2019-10-31T08:28:09Z","lastAt":"2019-10-31T19:30:28Z","messageCount":6,"participants":["Olaf Hering","SZEDER Gábor","Eric Sunshine","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"385203","messageId":"20191031092749.074ed112.olaf@aepfle.de","threadId":"52166","inReplyTo":null,"subject":"git fsck, badDate: invalid author/committer line - bad date","fromName":"Olaf Hering","fromEmail":"olaf@aepfle.de","sentAt":"2019-10-31T08:27:49Z","receivedAt":"2019-10-31T08:28:09Z","isPatch":false,"sender":{"key":"olaf@aepfle.de","avatar":"https://avatars.githubusercontent.com/u/942324?v=4"},"body":"While preparing changes for git://git.annexia.org/virt-top.git, git push to github complains:\n\nremote: error: object c609265ccce27a902b850f5d62e6628710ee2928: badDate: invalid author/committer line - bad date\n\nAlso 'git fsck' is unhappy about a number of commits.\n\nWhat is wrong with these commits, and how can the maintainer of virt-top.git repository fix his repo?\n\n$  git  --no-pager  log -p -M --stat --pretty=fuller c609265ccce27a902b850f5d62e6628710ee2928^! | head\ncommit c609265ccce27a902b850f5d62e6628710ee2928\nAuthor:     Richard W.M. Jones <rjones@redhat.com>\nAuthorDate: Mon Oct 5 11:39:28 2009 +0100\nCommit:     Richard W.M. Jones <rjones@redhat.com>\nCommitDate: Mon Oct 5 11:39:28 2009 +0100\n\nOlaf\n"},{"id":"385209","messageId":"20191031101539.GY4348@szeder.dev","threadId":"52166","inReplyTo":"20191031092749.074ed112.olaf@aepfle.de","subject":"Re: git fsck, badDate: invalid author/committer line - bad date","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-10-31T10:15:39Z","receivedAt":"2019-10-31T10:15:47Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Thu, Oct 31, 2019 at 09:27:49AM +0100, Olaf Hering wrote:\n> While preparing changes for git://git.annexia.org/virt-top.git, git push to github complains:\n> \n> remote: error: object c609265ccce27a902b850f5d62e6628710ee2928: badDate: invalid author/committer line - bad date\n> \n> Also 'git fsck' is unhappy about a number of commits.\n> \n> What is wrong with these commits, and how can the maintainer of virt-top.git repository fix his repo?\n> \n> $  git  --no-pager  log -p -M --stat --pretty=fuller c609265ccce27a902b850f5d62e6628710ee2928^! | head\n> commit c609265ccce27a902b850f5d62e6628710ee2928\n> Author:     Richard W.M. Jones <rjones@redhat.com>\n> AuthorDate: Mon Oct 5 11:39:28 2009 +0100\n> Commit:     Richard W.M. Jones <rjones@redhat.com>\n> CommitDate: Mon Oct 5 11:39:28 2009 +0100\n\n'git log' doesn't show the commit object's headers as-is, but 'git\ncat-file' does:\n\n  $ git cat-file -p c609265ccce27a902b850f5d62e6628710ee2928\n  tree ea8e3bd64e67d159e706b8feccfc169f6ac0829d\n  parent db4e80ee11a4e212a97efc1761ed237c7da72cb1\n  author Richard W.M. Jones <rjones@redhat.com> <\"Richard W.M. Jones <rjones@redhat.com>\"> 1254739168 +0100\n  committer Richard W.M. Jones <rjones@redhat.com> <\"Richard W.M. Jones <rjones@redhat.com>\"> 1254739168 +0100\n  \n  New translations.\n\nAnd now you don't need me to tell you what triggers those errors.\n\nYou can tell 'git fsck' to ignore those badly formatted commits\nlocally using the 'fsck'skipList' configuration variable:\n\n  $ echo \"# Commits with bogus author/committer lines\" >.git-fsck-skiplist\n  $ git fsck 2>&1 |cut -d' ' -f4 |sed -e 's/://' >>.git-fsck-skiplist\n  $ git config fsck.skipList .git-fsck-skiplist\n  $ git fsck\n  Checking object directories: 100% (256/256), done.\n  Checking objects: 100% (1803/1803), done.\n  $ echo $?\n  0\n\nIt might be worth to commit this file, so other devs can easily start\nusing it as well, and don't have to maintain such a list themselves.\n(Note, however, that if this file is committed and the config variable\nis set, then attempting to run 'git fsck' while an older revision is\nchecked out will result in a 'fatal: could not open object name list:\n.git-fsck-skiplist' error; I think that's an acceptable trade-off.)\n\nHowever, I don't know how to tell about the skiplist file to GitHub,\nor any other Git hosting service for that matter.\n\n"},{"id":"385219","messageId":"20191031142118.747693c1.olaf@aepfle.de","threadId":"52166","inReplyTo":"20191031101539.GY4348@szeder.dev","subject":"Re: git fsck, badDate: invalid author/committer line - bad date","fromName":"Olaf Hering","fromEmail":"olaf@aepfle.de","sentAt":"2019-10-31T13:21:18Z","receivedAt":"2019-10-31T13:27:32Z","isPatch":false,"sender":{"key":"olaf@aepfle.de","avatar":"https://avatars.githubusercontent.com/u/942324?v=4"},"body":"Am Thu, 31 Oct 2019 11:15:39 +0100\nschrieb SZEDER Gábor <szeder.dev@gmail.com>:\n\n> However, I don't know how to tell about the skiplist file to GitHub,\n> or any other Git hosting service for that matter.\n\nThanks for all the details.\n\nIs there a way to \"replay\" a git repository, so that all the commit contents\nand author/committer data are preserved? I think it is more important to have\na clean repository than to preserve irrelevant commit hashes.\n\nOlaf\n"},{"id":"385224","messageId":"20191031165632.GA4348@szeder.dev","threadId":"52166","inReplyTo":"20191031142118.747693c1.olaf@aepfle.de","subject":"Re: git fsck, badDate: invalid author/committer line - bad date","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-10-31T16:56:32Z","receivedAt":"2019-10-31T16:56:39Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Thu, Oct 31, 2019 at 02:21:18PM +0100, Olaf Hering wrote:\n> Am Thu, 31 Oct 2019 11:15:39 +0100\n> schrieb SZEDER Gábor <szeder.dev@gmail.com>:\n> \n> > However, I don't know how to tell about the skiplist file to GitHub,\n> > or any other Git hosting service for that matter.\n> \n> Thanks for all the details.\n> \n> Is there a way to \"replay\" a git repository, so that all the commit contents\n> and author/committer data are preserved? I think it is more important to have\n> a clean repository than to preserve irrelevant commit hashes.\n\nThose commits can be fixed by simply transforming the fast-export\nstream, e.g.:\n\n  $ git init new\n  $ git -C virt-top/ fast-export --all |\n    sed -e '/^\\(author\\|committer\\) Richard W\\.M\\. Jones <rjones@redhat.com> </ s/<\"Richard W\\.M\\. Jones <rjones@redhat.com>\"> //' |\n    git -C new fast-import\n\nBUT!\n\nAll the usual warnings about rewriting already published history\napply.  The hash of a couple of commits from 2009 might seem\nirrelevant now, a decade later, but after correcting those author and\ncommitter lines the hashes of all subsequent commits will inherently\nchange as well.  This is, in general, upsetting for everyone who have\ncloned the repo and built their own work on top.  Furthermore, some\ncommit messages refer to older commits by their hash (e.g. in\n431dbd98ba: \"Simplifies and updates commit\ndbef8dd3bf00417e75a12c851b053e49c9e1a79e\"); those references will go\nstale after rewriting history, unless you put in extra work to update\nthem.\n\nI would advise against rewriting history.\n\n"},{"id":"385225","messageId":"CAPig+cTNq_gPxECZks7sNde4Q758Vixgpy9eL2B3xrKO-O+qNQ@mail.gmail.com","threadId":"52166","inReplyTo":"20191031165632.GA4348@szeder.dev","subject":"Re: git fsck, badDate: invalid author/committer line - bad date","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2019-10-31T17:12:10Z","receivedAt":"2019-10-31T17:12:24Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Oct 31, 2019 at 12:56 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n> All the usual warnings about rewriting already published history\n> apply.  The hash of a couple of commits from 2009 might seem\n> irrelevant now, a decade later, but after correcting those author and\n> committer lines the hashes of all subsequent commits will inherently\n> change as well.  This is, in general, upsetting for everyone who have\n> cloned the repo and built their own work on top.  Furthermore, some\n> commit messages refer to older commits by their hash (e.g. in\n> 431dbd98ba: \"Simplifies and updates commit\n> dbef8dd3bf00417e75a12c851b053e49c9e1a79e\"); those references will go\n> stale after rewriting history, unless you put in extra work to update\n> them.\n\nFor completeness for future readers of this thread who have cases when\nrewriting history is a valid option, a tool such as Elijah's\ngit-filter-repo[1] can not only fix the \"broken\" email addresses, but\nalso can adjust hash references in commit messages so they don't go\nstale.\n\n[1]: https://github.com/newren/git-filter-repo\n"},{"id":"385232","messageId":"20191031193018.GB12834@sigill.intra.peff.net","threadId":"52166","inReplyTo":"20191031101539.GY4348@szeder.dev","subject":"Re: git fsck, badDate: invalid author/committer line - bad date","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-10-31T19:30:18Z","receivedAt":"2019-10-31T19:30:28Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Oct 31, 2019 at 11:15:39AM +0100, SZEDER Gábor wrote:\n\n> However, I don't know how to tell about the skiplist file to GitHub,\n> or any other Git hosting service for that matter.\n\nYou can contact GitHub support. The usual procedure is:\n\n  1. Find out if rewriting is an option (i.e., if the history isn't\n     already widely published), and walk the user through cleaning up\n     the history if that's an option.\n\n  2. For established history, we'll sometimes relax the fsck checks\n     temporarily to allow it to be pushed (it depends on the exact\n     failing check, but this one is mostly cosmetic and would be OK).\n\n-Peff\n"}]}