opentimestamps-client icon indicating copy to clipboard operation
opentimestamps-client copied to clipboard

Cache, store and upgrade git timestamps

Open kanzure opened this issue 5 years ago • 1 comments

Since git commits are considered final, it would be nice to upgrade git commit timestamps once they are mature, and store that information somewhere. This could be the cache, or it could be feasible to include them in a weird __hidden branch in each git repository- but it would still require ots to centrally track where each immature git commit timestamp was spawned from, so why not just upgrade the immature timestamps in the ~/.cache/ots/ directory?

kanzure avatar Jan 20 '20 15:01 kanzure

A 'weird __hidden branch' is not ideal (nobody likes software messing around in one's repository).

Nor is 'centrally tracking where each immature git commit was spawned' (repositories can move...).

The idea of putting a copy of the ots proof into the ~/.cache/ots is more into this direction. There could then be a ots verify-cached command that just goes through all not-yet-verified timestamps and verifies them. But then, just from the cache directory with these now-complete timestamps, the other direction is missing, i.e. to what repository and commit does that proof belong? ... Cat bites its own tail...

My solution to this is:

  • Synchronize ~/.cache/ots between machines (e.g. with syncthing) and back it up somehow. Sync conflicts are pretty much impossible as only new files will be added to the cache.

  • Define this git alias:

    git config --global alias.ots-check '!git rev-list --all | parallel --progress --bar --eta -ICOMMIT sh -c "'"'"'git verify-commit COMMIT >/dev/null 2>/dev/null'"'"'"'
    
  • Regularly run git ots-check in your repositories, which could also be automated:

    find -type d -name .git 2>/dev/null | xargs -d'\n' -L1 dirname | while IFS='\n' read repo;do (echo $repo;cd $repo && git ots-check);done
    
  • Your ~/.cache/ots will just grow and contain everything you need to prove your timestamped git commits without depending on the calendar servers.

@petertodd Is that right?

nobodyinperson avatar Nov 04 '21 08:11 nobodyinperson

Closing this as "won't fix", as backing up the calendars themselves is feasible and better for everyone.

petertodd avatar Mar 06 '23 14:03 petertodd