Personal dotfiles for Linux, mostly for Nixpkgs/NixOS-based and Termux setups. Mirrored using GitLab's push mirroring feature.
gitlab.com/andreijiroh-dev/dotfiles
linux
dotfiles
1#!/bin/bash
2
3if [[ $1 != "" ]]; then
4 git filter-branch --env-filter '
5 WRONG_EMAIL=$1
6 NEW_NAME="Andrei Jiroh Eugenio Halili"
7 NEW_EMAIL="andreijiroh@madebythepins.tk"
8
9 if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
10 then
11 export GIT_COMMITTER_NAME="$NEW_NAME"
12 export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
13 fi
14 if [ "$GIT_AUTHOR_EMAIL" = "$WRONG_EMAIL" ]
15 then
16 export GIT_AUTHOR_NAME="$NEW_NAME"
17 export GIT_AUTHOR_EMAIL="$NEW_EMAIL"
18 fi
19 ' --tag-name-filter cat -- --branches --tags
20else
21 echo "Usage $0 <wrong-email@host.me>"
22 echo "Easily fix wrong emails in Git commit history. It is advised to use this script only"
23 echo "on non-public commits, since this might be distaterous for forks to pull any changes"
24 echo "in the public commits."
25fi