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

Send git commit message to stdout after ots git wrapper failure

Open kanzure opened this issue 7 years ago • 9 comments

When the calendar servers are offline, signing with git commit -S leads to losing the commit message. Send the git commit message to stdout so that the author doesn't have to write a new message when retrying.

kanzure avatar May 26 '17 21:05 kanzure

Sounds like a good idea - git has this problem too in some cases. Though would writing the commit to a temporary file be better?

Also, the calendar servers are essentially never offline for me, so something odd is going on if you're getting that problem... Myself, I run into this same issue occasionally, but due to the PGP signing failing for various reasons like my smart card reader acting up.

petertodd avatar May 27 '17 17:05 petertodd

Alternative solution: always use gt commit and then sign with git commit --amend -S.

kanzure avatar Jul 27 '17 16:07 kanzure

Along those lines, maybe make the ots-git-commit thing leave a signed but non-timestamped git commit the OTS part fails?

petertodd avatar Jul 27 '17 17:07 petertodd

but then would probably need another utility to reconcile the non-timestamped commits, otherwise you might introduce inconsistencies in the expected signatures structure.

omarshibli avatar Sep 28 '17 00:09 omarshibli

What do you mean by "reconcile"?

The way I'd handle that is to have the error message suggest to the user that then do "git commit --amend --reset-author -S" again, which would re-sign the commit, reusing the commit message but resetting the exact date on the commit.

petertodd avatar Sep 29 '17 00:09 petertodd

By that I mean fix the inconsistencies if they occur, for example, if I have git stamping enabled, and for somehow the command failed to stamp it several times, let's say 5 commits out of 10, later on the network connection is back up, I want to fix the 5 commits signatures, how would i do this? do I need to cherry pick? I would rather have a tool/command that detects inconsistent signatures and fix it.

omarshibli avatar Sep 29 '17 03:09 omarshibli

But that's the thing: you can't fix the missing timestamps after the fact, because the point of the timestamp is they can't be backdated.

What you can do, is timestamp the most recent commit, which git commit --amend -S will do. If you need to add signatures to each git commit prior to the most recent, you can do that with git rebase -i, but for most workflows a signature on one commit is good enough - it signs all prior commits remember.

petertodd avatar Oct 16 '17 11:10 petertodd

makes sense, thanks for the input.

omarshibli avatar Oct 21 '17 01:10 omarshibli

Just realized this is a dupe of #29

kanzure avatar Jan 20 '20 14:01 kanzure