From b411aa65fddee419d85c07ca8b990e3d5bfc2dbf Mon Sep 17 00:00:00 2001 From: Someone Date: Thu, 22 May 2014 01:29:57 +0200 Subject: [PATCH] added script to fix names, emails and timestamps. --- filterBranchEnvEdit.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 filterBranchEnvEdit.sh diff --git a/filterBranchEnvEdit.sh b/filterBranchEnvEdit.sh new file mode 100755 index 0000000..b093627 --- /dev/null +++ b/filterBranchEnvEdit.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# Copyright 2011-2016 by Jan Vales (Someone ) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + + +SLEEPTIME=5 +echo "Will rewrite name, email and commitTS in repo `pwd` in ${SLEEPTIME} sec." +sleep $SLEEPTIME + +git filter-branch -f --env-filter ' + if [ "$GIT_AUTHOR_EMAIL" = "git@git.somenet.org" ]; then + export GIT_AUTHOR_EMAIL="git@git.somenet.org" + export GIT_AUTHOR_NAME="git" + fi + if [ "$GIT_AUTHOR_EMAIL" = "root@dev.somenet.org" ]; then + export GIT_AUTHOR_EMAIL="git@git.somenet.org" + export GIT_AUTHOR_NAME="git" + fi + if [ "$GIT_AUTHOR_EMAIL" = "jan@jvales.net" ]; then + export GIT_AUTHOR_EMAIL="someone@somenet.org" + export GIT_AUTHOR_NAME="Someone" + fi + export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" + export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" + export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" +# export GIT_AUTHOR_DATE="$GIT_COMMITTER_DATE" + ' -- --all + -- 2.43.0