]> xenbits.xensource.com Git - people/larsk/xenproject-org-gitdm.git/commitdiff
Don't accept totally bogus dates
authorJonathan Corbet <corbet@lwn.net>
Fri, 5 Sep 2008 19:53:35 +0000 (13:53 -0600)
committerJonathan Corbet <corbet@lwn.net>
Fri, 5 Sep 2008 19:53:35 +0000 (13:53 -0600)
Yanmin Zhang committed a patch (09f2724a786f76475ef2985cf84f5359c553aade)
which claims to have been written in August, 2030.  Code that bleeding-edge
makes gitdm confused, so pretend it's just normal, contemporary stuff.

gitdm

diff --git a/gitdm b/gitdm
index 6c0574537a89fa31c0878ceaac34d84cb87dd2d4..20ec2573e742f1275fdf2b272bb573b401e7d3d9 100755 (executable)
--- a/gitdm
+++ b/gitdm
@@ -19,7 +19,7 @@ from patterns import *
 class patch:
     pass
 
-
+Today = datetime.date.today()
 #
 # Control options.
 #
@@ -181,6 +181,9 @@ def grabpatch():
         if m:
             dt = rfc822.parsedate(m.group (2))
             p.date = datetime.date (dt[0], dt[1], dt[2])
+            if p.date > Today:
+                sys.stderr.write ('Funky date: %s\n' % p.date)
+                p.date = Today
             continue
         #
         # If we have a file filter, check for file lines.