Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Many important software projects predate UNIX. Perhaps you want to create a Git repository for one of them, with historically accurate commit timestamps?


Well, Git doesn't seem to set file timestamps when cloning. And as the sibling comment says, Git doesn't use 32-bit signed integers to store timestamps. So this is not a problem.

If, however, Git were to some day get an option to set file mtimes and atimes at clone time to the last-modified time of the files based on commit history, then you could always just use a 64-bit system where `time_t` is 64-bit.


> Well, Git doesn't seem to set file timestamps when cloning.

This is intentional btw because otherwise with many build system things would not get rebuilt correctly when checking out an older snapshot.


More importantly than a git repository, you might have archives (a .tar or equivalent) of these software projects, and might want to unpack them while preserving the timestamps contained within these archives.


Unix did not exist before 1970. Neither did tar. There are no tar files with files with timestamps before 1970 _unless_ you've used `touch -t 195001010000` or `utime(2)` or `futimes(3)` to set the files' time to before 1970. That seems pretty unlikely.


If I create a new archive format today and use it to archive the contents of my disk or whatever USB stick I find do you not thing it might end up containing files with timestamps before today?


Git represents timestamps in ASCII strings, like "12345." Not time_t. (I am not sure if it even allows negative integers in this format.)


I was just using Git as an example of an application where pre-1970 timestamps could be useful. But as it turns out,

  $ git commit -m foo --date='1969-12-31 00:00:00'
  [main 25b6e63] foo
   Date: Sun Dec 30 23:00:00 2012 -0500
   1 file changed, 0 insertions(+), 0 deletions(-)
   create mode 100644 bar




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: