git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Anyone know what is creating commits with bogus dates?
Date: Thu, 21 May 2020 12:31:36 -0700	[thread overview]
Message-ID: <CABPp-BG+XdbeOgaL1Th6U8g-gRON41DCwZ-RDnN7CEgk2fvwDg@mail.gmail.com> (raw)
In-Reply-To: <20200521185753.GB1308489@coredump.intra.peff.net>

On Thu, May 21, 2020 at 11:57 AM Jeff King <peff@peff.net> wrote:
>
> On Thu, May 21, 2020 at 10:49:17AM -0700, Elijah Newren wrote:
>
> > I wanted to report that we seem to have a number of repos in the wild
> > with bogus (as in "won't even parse") dates.
> >
> > I first discovered such a repository in the wild a while ago with
> > rails.git.  It has a commit with a recorded timezone of "+051800" for
> > both author and committer.  Everything else about the commit looks
> > fine.  See https://github.com/rails/rails/commit/4cf94979c9f4d6683c9338d694d5eb3106a4e734.
> >
> > Some google searches at the time turned up a few other examples, all
> > with the same "+051800" issue.  I put a special workaround for it into
> > filter-repo because I figured it was slightly prominent but probably
> > limited to that special timezone.  The fact that it was six digits but
> > the last two were zeros made it seem not quite as bad as it could be.
>
> I can't remember the source of the bug, but we've had a workaround in
> GitHub's incoming fsck checks to allow 6-digit zones like this since
> August 2011. I'm almost certain that it came up because of that
> rails/rails commit, but I don't remember the culprit implementation. I'm
> sure we would have dug it up and fixed it at the time.

What about 7- and 8- digit timezones (like the ones in the linked
filter-repo issue report)?  Do you currently prevent users from
pushing those to GitHub, or do you allow those too?
I'm curious about whether there is anything else out there that might
help flag these commits or if it's just filter-repo.

> Sadly our commit message for the fsck tweak gives no further details,
> nor can I dig up anything out of issues/etc.
>
> I _think_ it wasn't GitHub/grit which did this (the 0-prefixed tree
> modes you might come across are, though). I couldn't find any mention of
> the fix there, at least. I'd suspect perhaps libgit2, but I also
> couldn't find any fix.
>
> But I think it would be safe to assume the bug is long-since fixed, and
> it's nice if you can be a bit more lenient on the parsing for historical
> issues like this. Arguably fast-export ought to be normalizing it to
> something syntactically correct (just like we probably do with other
> unparsable dates), though I guess you could argue that a filter might
> want to see the broken form in order to fix it in a custom way.

If we're going to be more lenient on the parsing, does that suggest
fast-import shouldn't die on these?  Currently, fast-import is the
thing dying, not fast-export or filter-repo (though filter-repo of
course halts when it notices that fast-import has died under it).

I put in special-case code in filter-repo to munge the +051800
timezone case to keep fast-import from dying, but these new cases seem
to suggest it's not just one bad timezone that I can check for and
correct, but rather that they are completely random 7- or 8- (or who
knows how many) digit timezones coupled with bogus
(century-into-the-future) unix epochs.  I'm a little less comfortable
working around all of these than the very specific +051800 issue.  On
the filter-repo side, I think the most I would want to do here is
provide cleaner warning or error messages than "fast-import died,
here's a traceback."  But I'm unusre if there are other steps we
should take as well, such as making the fast-import parser more
lenient.

  reply	other threads:[~2020-05-21 19:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21 17:49 Anyone know what is creating commits with bogus dates? Elijah Newren
2020-05-21 18:12 ` Eric Sunshine
2020-05-21 18:57 ` Jeff King
2020-05-21 19:31   ` Elijah Newren [this message]
2020-05-21 19:55     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABPp-BG+XdbeOgaL1Th6U8g-gRON41DCwZ-RDnN7CEgk2fvwDg@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).