Well-past commit dates unsupported

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,

I'm trying to use a well-past date for a git commit, before the UNIX Epoch, but
this does not work for the reasons below. I'm on Mac OS X 10.8, git version
1.8.3.4, and `sizeof(time_t) == 8`. The date I'm trying to set is October 4,
1958, that is around timestamp -354808800.

First technique, using the commit `--date` flags with ISO 8601: it says
"invalid date".

Second technique, described in the git ml archive, not using the porcelain:
http://article.gmane.org/gmane.comp.version-control.git/152497/

    git commit
    git cat-file -p HEAD > tmp.txt
    # at this point, edit the file to replace the timestamp

    git hash-object -t commit -w tmp.txt
    #=> 2ee8fcc02658e23219143f5bcfe6f9a4615745f9
    git update-ref -m 'commit: foo' refs/heads/master \
        2ee8fcc02658e23219143f5bcfe6f9a4615745f9

Commit date is effectively updated, but `git show` clamps the date to zero
(`Jan 1 1970`). `tig(1)` displays `55 years ago` so the actual commit date is
properly stored.

Last issue: when trying to push this commit to a remote repository:

    #=> remote: error: object 2ee8fcc02658e23219143f5bcfe6f9a4615745f9:invalid
    #       author/committer line - bad date
    #=> remote: fatal: Error in object
    #=> error: unpack failed: index-pack abnormal exit

Finally, when running `test-date` from git sources:

    ./test-date show -354808800
    #=> -354808800 -> in the future

Is it a deliberate git behavior? Is fully supporting past or far future dates
in the roadmap, since the referenced message above from 2010? Should I try
to make a patch?

Thanks!

PS: use case for past dates is to match the historical law changes. As others
did before, I'm trying to map the history of France Constitution to git.

-- 
Jean Lauliac <jean@xxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]