Created
April 15, 2022 17:06
-
-
Save Gems/b7a2e5df97d54ce24a3c71299186ee9c to your computer and use it in GitHub Desktop.
Git gpg that respects $GIT_COMMITTER_DATE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
LOG_FILE=/dev/null | |
exec > >(tee -a $LOG_FILE >&1) | |
exec 2> >(tee -a $LOG_FILE >&2) | |
if [ -n "$GIT_COMMITTER_DATE" ]; then | |
FST="--faked-system-time $(date -j -f '%Y-%m-%dT%H:%M:%S' $GIT_COMMITTER_DATE +'%s')" | |
fi | |
echo $FST "$@" >>$LOG_FILE | |
gpg $FST "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment