git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git fsck, badDate: invalid author/committer line - bad date

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Oct 31, 2019, 10:15 UTC
Message-ID
<20191031101539.GY4348@szeder.dev>
In-Reply-To
<20191031092749.074ed112.olaf@aepfle.de>
On Thu, Oct 31, 2019 at 09:27:49AM +0100, Olaf Hering wrote:
Show 14 quoted lines
> While preparing changes for git://git.annexia.org/virt-top.git, git push to github complains:
> 
> remote: error: object c609265ccce27a902b850f5d62e6628710ee2928: badDate: invalid author/committer line - bad date
> 
> Also 'git fsck' is unhappy about a number of commits.
> 
> What is wrong with these commits, and how can the maintainer of virt-top.git repository fix his repo?
> 
> $  git  --no-pager  log -p -M --stat --pretty=fuller c609265ccce27a902b850f5d62e6628710ee2928^! | head
> commit c609265ccce27a902b850f5d62e6628710ee2928
> Author:     Richard W.M. Jones <rjones@redhat.com>
> AuthorDate: Mon Oct 5 11:39:28 2009 +0100
> Commit:     Richard W.M. Jones <rjones@redhat.com>
> CommitDate: Mon Oct 5 11:39:28 2009 +0100

'git log' doesn't show the commit object's headers as-is, but 'git cat-file' does:

  $ git cat-file -p c609265ccce27a902b850f5d62e6628710ee2928
  tree ea8e3bd64e67d159e706b8feccfc169f6ac0829d
  parent db4e80ee11a4e212a97efc1761ed237c7da72cb1
  author Richard W.M. Jones <rjones@redhat.com> <"Richard W.M. Jones <rjones@redhat.com>"> 1254739168 +0100
  committer Richard W.M. Jones <rjones@redhat.com> <"Richard W.M. Jones <rjones@redhat.com>"> 1254739168 +0100
  
  New translations.
And now you don't need me to tell you what triggers those errors.

You can tell 'git fsck' to ignore those badly formatted commits locally using the 'fsck'skipList' configuration variable:

  $ echo "# Commits with bogus author/committer lines" >.git-fsck-skiplist
  $ git fsck 2>&1 |cut -d' ' -f4 |sed -e 's/://' >>.git-fsck-skiplist
  $ git config fsck.skipList .git-fsck-skiplist
  $ git fsck
  Checking object directories: 100% (256/256), done.
  Checking objects: 100% (1803/1803), done.
  $ echo $?
  0

It might be worth to commit this file, so other devs can easily start using it as well, and don't have to maintain such a list themselves. (Note, however, that if this file is committed and the config variable is set, then attempting to run 'git fsck' while an older revision is checked out will result in a 'fatal: could not open object name list: .git-fsck-skiplist' error; I think that's an acceptable trade-off.)

However, I don't know how to tell about the skiplist file to GitHub, or any other Git hosting service for that matter.

Previous: Olaf HeringNext: Olaf Hering
Message 2 of 6 in “git fsck, badDate: invalid author/committer line - bad date”
  1. Olaf HeringOct 31, 2019
  2. SZEDER GáborOct 31, 2019
  3. Olaf HeringOct 31, 2019
  4. SZEDER GáborOct 31, 2019
  5. Eric SunshineOct 31, 2019
  6. Jeff KingOct 31, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.