2 ms·
> git dates are unsigned timestamps You are thinking of the in-memory representation of the (main) implementation, not the git format itself. The on-disk/wire
by progval 6y ago
> git dates are unsigned timestamps
You are thinking of the in-memory representation of the (main) implementation, not the git format itself.
The on-disk/wire format is text representation, encoded in decimal. You can add a minus sign in front of it, git won't crash when parsing it. The implementation will, however, display the wrong date on git log, but it's a bug that git developers are working on.
For example (coincidentally, it is also a constitution):
$ git init
$ curl https://archive.softwareheritage.org/api/1/vault/revision/5e8f80061263d818ae3fc6c8d2086b5278f271ea/gitfast/raw/ | gunzip | git fast-import > /dev/null
$ git show 5e8f80061263d818ae3fc6c8d2086b5278f271e | grep Date
Date: Thu Jan 1 00:00:00 1970 +0000
$ git cat-file -p 5e8f80061263d818ae3fc6c8d2086b5278f271e | grep author
author State Constitutional Conventions <> -5706313200 -0455