Keep your coding hours private by amending author/committer date and time.
Simpler one-bash-script alternative to EMPRI-DEVOPS/git-privacy
copy git-privacy to where your $PATH can reach it.
e.g.:
cd $(mktemp -d)
git clone <THIS REPO>
cp git-privacy/git-privacy ~/.local/bin/git-privacy uses a post-commit hook to redact timestamps and a pre-push hook
to verify if timestamps are not being leaked.
Rest assured, nothing inside .git/hooks/ is shared on git push ...,
therefore, you don't run the risk of ruining someone else's workflow.
Setup git-privacy on a repository using:
git-privacy initNow, all your next commits will have their timestamps' hours, minutes, seconds
and timezone info redacted to all zeroes (00:00:00+0000).
After installation, the commands git-privacy redact and git-privacy verify are
automatically run by the post-commit and pre-push hooks respectively,
however you can run them manually to further redact older commits.
To redact the last commit timestamp use:
git-privacy redactBy default, git-privacy redact only changes the last commit.
To verify that none of your local commits in the current branch are leaking timestamps use:
git-privacy verifyBy default, git-privacy verify checks only un-pushed commits.
To temporarily disable git-privacy, set the environment variable
GIT_PRIVACY_DISABLE to anything.
Run git privacy help for a list of all commands.
To make git-privacy work by default in all new repos,
simply init it on your git template
cp -r /usr/share/git-core/templates ~/.local/share/git/privacy-template
cd ~/.local/share/git/privacy-template
git-privacy init
git config --global init.templatedir ~/.local/share/git/privacy-templateYou can also install it directly on the default template
/usr/share/git-core/templates